X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;ds=inline;f=tools%2Fccanlint%2FMakefile;h=16c4bfd2b3324daab2c6462af18341d7528601a8;hb=11d5072e4fb8c6032ef41a8702f983375398c55e;hp=cd507e5d08d8237ba06b0c138a85c39dd39d25c4;hpb=8f61c0bccb152b2365baf70deac1e59264d7feb7;p=ccan diff --git a/tools/ccanlint/Makefile b/tools/ccanlint/Makefile index cd507e5d..16c4bfd2 100644 --- a/tools/ccanlint/Makefile +++ b/tools/ccanlint/Makefile @@ -10,10 +10,14 @@ CORE_OBJS := tools/ccanlint/ccanlint.o \ OBJS := $(CORE_OBJS) $(TEST_OBJS) -tools/ccanlint/generated-init-tests: $(OBJS) - cat $(OBJS:.o=.c) | sed -n 's/^struct ccanlint \([A-Za-z0-9_]*\) = {/{ extern struct ccanlint \1; list_add(\&tests, \&\1.list); }/p' >$@ +# FIXME: write a trivial C program to do this +tools/ccanlint/generated-init-tests: $(TEST_CFILES) + cat $(TEST_CFILES) | grep ^REGISTER_TEST > $@ -tools/ccanlint/ccanlint.o: tools/ccanlint/generated-init-tests +$(TEST_OBJS): tools/ccanlint/generated-init-tests + +# Otherwise, ccanlint.c et al. may fail to build +$(CORE_OBJS): tools/ccanlint/generated-init-tests tools/ccanlint/ccanlint: $(OBJS)