-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
43 lines (33 loc) · 879 Bytes
/
Makefile
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
41
42
43
CC = gcc
LD = ld
CFLAGS = -Wall -O2 -g
GLUCOSE_OBJS = main.o hiddev.o utils.o options.o contour-protocol.o
ALL_OBJS = $(GLUCOSE_OBJS)
ALL_DEBS = $(shell echo " "$(ALL_OBJS) | sed -e "s,[^ ]*\.a,,g" -e \
"s,\([^ ]*\)/\([^ /]*\)\.o,\1/.\2.o.d,g" -e "s, \([^ \
/]*\)\.o, .\1.o.d,g" )
ifeq ($(V),1)
Q =
QUIET_CC =
QUIET_LINK =
else
Q = @
QUIET_CC = @echo " CC " $@;
QUIET_LINK = @echo " LINK " $@;
endif
all: glucose
glucose: $(GLUCOSE_OBJS)
$(QUIET_LINK)$(CC) -lusb-1.0 $(CFLAGS) -o $@ $^
clean:
rm -vf glucose *~ *.o .*.d
.c.o:
$(QUIET_CC)$(CC) -MMD -MF [email protected] $(CFLAGS) -c $< -o $@
$(Q)cp [email protected] [email protected]; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < [email protected] >> [email protected]; \
TAGS:
@echo -e "\tTAGS\t"
@etags *.[ch]
.PHONY: all clean TAGS
-include $(ALL_DEBS)