forked from amboar/tceetree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (33 loc) · 1.21 KB
/
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
44
45
SRCS=$(wildcard *.c)
OBJS=$(patsubst %.c,%.o,$(SRCS))
DEPS:=$(OBJS:.o=.d)
CCAN_SRCS=ccan/strmap/strmap.c ccan/str/debug.c ccan/str/str.c \
ccan/ilog/ilog.c ccan/strmap/strmap.c ccan/str/debug.c \
ccan/str/str.c ccan/ilog/ilog.c ccan/take/take.c \
ccan/likely/likely.c ccan/tal/str/str.c ccan/tal/tal.c \
ccan/tal/talloc/talloc.c ccan/hash/hash.c ccan/talloc/talloc.c \
ccan/htable/htable.c ccan/list/list.c
CCAN_OBJS=$(patsubst %.c,%.o,$(CCAN_SRCS))
CCAN_DEPS=$(CCAN_OBJS:.o=.d)
CFLAGS=-I. -O2 -g -ggdb -Wall -std=gnu11
tceetree: $(CCAN_OBJS) $(OBJS)
CONFIGURATOR := tools/configurator/configurator
$(CONFIGURATOR): $(CONFIGURATOR).c
$(PRE)$(CC) $(CCAN_CFLAGS) $(DEP_CFLAGS) $< -o $@
config.h: $(CONFIGURATOR)
./$(CONFIGURATOR) $(CC) $(CCAN_CFLAGS) >[email protected] && mv [email protected] $@
$(OBJS) $(CCAN_OBJS): config.h
check: tceetree test-cscope
cd test && ./test.sh || echo Tests failed
clean:
$(RM) tceetree $(OBJS) $(DEPS)
$(RM) config.h $(CCAN_OBJS) $(CONFIGURATOR) $(CCAN_DEPS)
cscope:
find . -name '*.c' > cscope.files
cscope -b -c -R
test-cscope:
find test/src -name '*.c' > test/cscope.files
cscope -b -c -R -itest/cscope.files -ftest/cscope.out
%.o: %.c
$(CC) -c $(CFLAGS) -MMD -o $@ $<
.PHONY: clean check