]> git.ozlabs.org Git - ccan/blobdiff - Makefile-ccan
crcsync byte-at-a-time test reveals flaws in buffer handling.
[ccan] / Makefile-ccan
index 68f7d02dd291948232441ad3e29d4acfb2265fd2..5d04109e0007c58b1838b03824d8077ff73ac877 100644 (file)
@@ -6,7 +6,7 @@ CFLAGS=-g -O3 -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototy
 
 # Automatic dependency generation: makes ccan/*.d files.
 DEPGEN=-MD
--include ccan/*.d
+-include ccan/*/*.d
 
 # Every directory with .c files (other than _info.c) is included.
 DIRS=$(patsubst %/, %, $(sort $(dir $(wildcard ccan/*/[a-z]*.c))))
@@ -18,6 +18,7 @@ libccan.a: $(OBJFILES)
        $(AR) r $@ $^
 
 # Dependencies are autogenerated in the .d files.
+# We create all the .o files and link them together.
 $(OBJFILES): %.o:
-       $(CC) $(CFLAGS) -c -o $@ $*/[a-z]*.c
+       cd $* && $(CC) -I../.. $(CFLAGS) -c [a-z]*.c && cd ../.. && $(LD) -r -o $@ `echo $*/[a-z]*.c ' ' | sed 's/\.c /.o /g'`