-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (27 loc) · 1 KB
/
Copy pathMakefile
File metadata and controls
40 lines (27 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
CFLAGS=-O2 -Wall -Wextra -pipe
LDFLAGS=-L. -lthinklight
PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
# uncomment this to use the legacy file in the /proc-directory
# CFLAGS+=-DPROC_LEGACY
.PHONY: all clean install
all: tl-on tl-off tl-morse tl-strobo tl-toggle
tl-morse: tl-morsestrobo.c libthinklight.a
$(CC) -o $@ $(CFLAGS) -DMORSE $< $(LDFLAGS)
tl-strobo: tl-morsestrobo.c libthinklight.a
$(CC) -o $@ $(CFLAGS) -DSTROBO $< $(LDFLAGS)
tl-on: tl-onofftoggle.c libthinklight.a
$(CC) -o $@ $(CFLAGS) -DON $< $(LDFLAGS)
tl-off: tl-onofftoggle.c libthinklight.a
$(CC) -o $@ $(CFLAGS) -DOFF $< $(LDFLAGS)
tl-toggle: tl-onofftoggle.c libthinklight.a
$(CC) -o $@ $(CFLAGS) -DTOGGLE $< $(LDFLAGS)
%.o: %.c thinklight.h
$(CC) -c -o $@ $(CFLAGS) $<
libthinklight.a: tl_init.o tl_deinit.o tl_on.o tl_off.o tl_status.o tl_toggle.o
ar cr $@ $^
ranlib $@
clean:
$(RM) tl-on tl-off tl-morse tl-strobo tl-toggle *.o libthinklight.a
install:
install -Ds -m u+rwx,go+rx,u+s tl-on tl-off tl-morse tl-strobo tl-toggle $(BINDIR)