-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (33 loc) · 1020 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
44
45
46
47
48
49
50
51
52
53
54
55
56
CCAN_DIR=~/src/ccan
CFLAGS:=-Og -std=gnu11 -Wall -g -march=native \
-D_GNU_SOURCE -I $(CCAN_DIR) -I $(abspath .) \
#-DDEBUG_ME_HARDER #-DCCAN_LIST_DEBUG=1
TEST_BIN:=$(patsubst t/%.c,t/%,$(wildcard t/*.c))
all: tags bench $(TEST_BIN)
clean:
@rm -f *.o t/*.o $(TEST_BIN)
distclean: clean
@rm -f bench tags core
@rm -rf .deps
check: $(TEST_BIN)
prove -v -m $(sort $(TEST_BIN))
tags: $(shell find . -iname "*.[ch]" -or -iname "*.p[lm]")
@ctags -R *
bench: bench.o pht.o \
ccan-list.o ccan-hash.o ccan-htable.o \
ccan-tally.o ccan-str.o ccan-read_write_all.o
@echo " LD $@"
@$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS)
t/%: t/%.o pht.o \
ccan-list.o ccan-htable.o ccan-hash.o ccan-tap.o
@echo " LD $@"
@$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS)
ccan-%.o ::
@echo " CC $@ <ccan>"
@$(CC) -c -o $@ $(CCAN_DIR)/ccan/$*/$*.c $(CFLAGS)
%.o: %.c
@echo " CC $@"
@$(CC) -c -o $@ $< $(CFLAGS) -MMD
@test -d .deps || mkdir -p .deps
@mv $(<:.c=.d) .deps/
include $(wildcard .deps/*.d)