Makefile 1.22 KB
Newer Older
1 2
TEST_CFILES := $(wildcard tools/ccanlint/tests/*.c)
TEST_OBJS := $(TEST_CFILES:.c=.o)
3

4
CORE_OBJS := \
5
	ccan/asort/asort.o \
6
	ccan/btree/btree.o \
Rusty Russell's avatar
Rusty Russell committed
7
	ccan/dgraph/dgraph.o \
8
	ccan/foreach/foreach.o \
9 10 11
	ccan/grab_file/grab_file.o \
	ccan/hash/hash.o \
	ccan/htable/htable.o \
12
	ccan/lbalance/lbalance.o \
13 14 15 16 17
	ccan/noerr/noerr.o \
	ccan/opt/helpers.o \
	ccan/opt/opt.o \
	ccan/opt/parse.o \
	ccan/opt/usage.o \
Rusty Russell's avatar
Rusty Russell committed
18
	ccan/read_write_all/read_write_all.o \
19 20
	ccan/str/str.o ccan/str/debug.o \
	ccan/str_talloc/str_talloc.o \
Rusty Russell's avatar
Rusty Russell committed
21
	ccan/strmap/strmap.o \
22 23
	ccan/talloc/talloc.o \
	ccan/talloc_link/talloc_link.o \
Rusty Russell's avatar
Rusty Russell committed
24
	ccan/time/time.o \
25
	tools/ccanlint/async.o \
26 27 28 29 30 31 32
	tools/ccanlint/ccanlint.o \
	tools/ccanlint/file_analysis.o \
	tools/ccanlint/licenses.o \
	tools/compile.o \
	tools/depends.o \
	tools/doc_extract-core.o \
	tools/tools.o
33 34

OBJS := $(CORE_OBJS) $(TEST_OBJS)
35

36
# FIXME: write a trivial C program to do this
37
tools/ccanlint/generated-testlist: $(TEST_CFILES)
38
	cat $^ | grep ^REGISTER_TEST > $@
39

40
$(TEST_OBJS): tools/ccanlint/generated-testlist
41

42
# Otherwise, ccanlint.c et al. may fail to build
43
$(CORE_OBJS): tools/ccanlint/generated-testlist config.h
44

45
tools/ccanlint/ccanlint: $(OBJS)
46 47

ccanlint-clean:
48
	$(RM) tools/ccanlint/generated-testlist
49
	$(RM) tools/ccanlint/ccanlint