]> git.ozlabs.org Git - ccan/commitdiff
Makefile: Define CFLAGS_FORCE_C_SOURCE macro
authorKevin Locke <kevin@kevinlocke.name>
Thu, 29 Sep 2016 00:44:47 +0000 (18:44 -0600)
committerDavid Gibson <david@gibson.dropbear.id.au>
Fri, 30 Sep 2016 03:51:27 +0000 (13:51 +1000)
This macro holds the C compiler flag(s) to force input files to be
recognized as C sources regardless of extension.  It is defined to allow
overriding on the make command line.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Makefile
Makefile-ccan

index 127b8757808eedeabec2c53425ef0850c89ce5c6..37ff17de389ecba5797780bf1ed49f88a87ef1ba 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -64,7 +64,7 @@ summary-fastcheck/%: tools/ccanlint/ccanlint $(OBJFILES)
        $(CCANLINT_FAST) -s ccan/$*
 
 ccan/%/info: ccan/%/_info config.h
        $(CCANLINT_FAST) -s ccan/$*
 
 ccan/%/info: ccan/%/_info config.h
-       $(CC) $(CCAN_CFLAGS) -I. -o $@ -x c $<
+       $(CC) $(CCAN_CFLAGS) -I. -o $@ $(CFLAGS_FORCE_C_SOURCE) $<
 
 all_info: $(MODS:%=ccan/%/info)
 
 
 all_info: $(MODS:%=ccan/%/info)
 
index 5c8dea2e4b00ed2a92facf0288e1f80bc222d118..d4a55286eae1b9844647feb73b4c38c3234162d7 100644 (file)
@@ -5,6 +5,7 @@
 #CCAN_CFLAGS=-g -O3 -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wwrite-strings -Wundef -DCCAN_STR_DEBUG=1
 CCAN_CFLAGS=-g3 -ggdb -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wwrite-strings -Wundef -DCCAN_STR_DEBUG=1
 CFLAGS = $(CCAN_CFLAGS) -I. $(DEPGEN)
 #CCAN_CFLAGS=-g -O3 -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wwrite-strings -Wundef -DCCAN_STR_DEBUG=1
 CCAN_CFLAGS=-g3 -ggdb -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wwrite-strings -Wundef -DCCAN_STR_DEBUG=1
 CFLAGS = $(CCAN_CFLAGS) -I. $(DEPGEN)
+CFLAGS_FORCE_C_SOURCE = -x c
 
 MODS := a_star \
        aga \
 
 MODS := a_star \
        aga \