]> git.ozlabs.org Git - ccan/commitdiff
Build info files
authorDavid Gibson <david@gibson.dropbear.id.au>
Mon, 9 May 2016 19:44:47 +0000 (20:44 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 9 May 2016 19:44:47 +0000 (20:44 +0100)
All modules have a _info file (a C file, despite the lack of extension)
giving metadata for the module.  The Makefiles have a rule to build these..
but it's broken (missing an include directive).

This patch fixes the rule, and builds the info binaries for all modules by
default.  This is a useful check and also useful for manually inspecting
a module's metadata.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Makefile
ccan/.gitignore

index 2ce014586fe1b23a70a9635823185dc717d7ba6b..127b8757808eedeabec2c53425ef0850c89ce5c6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@ SCOREDIR=scores/$(shell whoami)/$(shell uname -s)-$(shell uname -m)-$(CC)-$(shel
 CCANLINT=tools/ccanlint/ccanlint --deps-fail-ignore
 CCANLINT_FAST=$(CCANLINT) -x tests_pass_valgrind -x tests_compile_coverage
 
 CCANLINT=tools/ccanlint/ccanlint --deps-fail-ignore
 CCANLINT_FAST=$(CCANLINT) -x tests_pass_valgrind -x tests_compile_coverage
 
-default: libccan.a
+default: all_info libccan.a
 
 ALL_DEPENDS=$(patsubst %, ccan/%/.depends, $(MODS))
 
 
 ALL_DEPENDS=$(patsubst %, ccan/%/.depends, $(MODS))
 
@@ -63,8 +63,10 @@ summary-check/%: tools/ccanlint/ccanlint $(OBJFILES)
 summary-fastcheck/%: tools/ccanlint/ccanlint $(OBJFILES)
        $(CCANLINT_FAST) -s ccan/$*
 
 summary-fastcheck/%: tools/ccanlint/ccanlint $(OBJFILES)
        $(CCANLINT_FAST) -s ccan/$*
 
-ccan/%/info: ccan/%/_info
-       $(CC) $(CCAN_CFLAGS) -o $@ -x c $<
+ccan/%/info: ccan/%/_info config.h
+       $(CC) $(CCAN_CFLAGS) -I. -o $@ -x c $<
+
+all_info: $(MODS:%=ccan/%/info)
 
 clean: tools-clean
        rm -f `find * -name '*.o'` `find * -name '.depends'` `find * -name '*.a'`  `find * -name info` `find * -name '*.d'` `find ccan -name '*-Makefile'`
 
 clean: tools-clean
        rm -f `find * -name '*.o'` `find * -name '.depends'` `find * -name '*.a'`  `find * -name info` `find * -name '*.d'` `find ccan -name '*-Makefile'`
index 714e66ab8d7f3b3c4f65722f8368f145096a3e20..e497e74ef6bf56014e55d33255fb8f835cd09e7a 100644 (file)
@@ -1 +1,3 @@
 *-Makefile
 *-Makefile
+info
+