makefiles: add "scores" target.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 3 Nov 2010 12:48:10 +0000 (23:18 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 3 Nov 2010 12:48:10 +0000 (23:18 +1030)
Makefile
Makefile-ccan
Makefile-web

index ae01880b4af02596fafed39461dd47219e5fb937..57d207f1ad3a2ad4bfaee991a236c244ea31d7b0 100644 (file)
--- a/Makefile
+++ b/Makefile
 # dependencies you don't have.
 EXCLUDE=wwviaudio ogg_to_pcm
 
-# Anything with an _info file is a module.
-ALL=$(filter-out $(EXCLUDE), $(patsubst ccan/%/_info, %, $(wildcard ccan/*/_info)))
-ALL_DEPENDS=$(patsubst %, ccan/%/.depends, $(ALL))
+# Where make scores puts the results
+SCOREDIR=scores/$(shell whoami)/$(shell uname -s)-$(shell uname -m)-$(CC)
+
+ALL=$(filter-out $(EXCLUDE), $(REALLY_ALL))
+
+ALL_DEPENDS=$(patsubst %, ccan/%/.depends, $(REALLY_ALL))
+
 # Not all modules have tests.
 ALL_TESTS=$(patsubst ccan/%/test/, %, $(foreach dir, $(ALL), $(wildcard ccan/$(dir)/test/)))
 
@@ -70,6 +74,18 @@ check: $(ALL_TESTS:%=summary-check-%)
 distclean: clean
        rm -f $(ALL_DEPENDS)
 
+scores: $(SCOREDIR)/SUMMARY
+
+$(SCOREDIR)/SUMMARY: $(patsubst ccan/%/_info, $(SCOREDIR)/score-%, $(wildcard ccan/*/_info))
+       git describe --always > $@
+       uname -a >> $@
+       $(CC) -v >> $@
+       cat $^ | grep 'Total score:' >> $@
+
+$(SCOREDIR)/score-%: ccan/%/_info tools/ccanlint/ccanlint $(OBJFILES)
+       mkdir -p $(SCOREDIR)
+       tools/ccanlint/ccanlint -v -s -d ccan/$* > $@ || true
+
 $(ALL_DEPENDS): %/.depends: %/_info tools/ccan_depends
        tools/ccan_depends $* > $@ || ( rm -f $@; exit 1 )
 
index 6911dffc28b73a1de92e0823308f2c87516c7e7d..4364bc160d817806747696d70816a9a920e94582 100644 (file)
@@ -13,8 +13,14 @@ default: libccan.a
 DEPGEN=-MD
 -include ccan/*/*.d
 
-# Every directory with .c files is included.
-DIRS=$(filter-out $(foreach d,$(EXCLUDE),ccan/$d), $(patsubst %/, %, $(sort $(dir $(wildcard ccan/*/*.c)))))
+# Anything with an _info file is a module.
+REALLY_ALL=$(patsubst ccan/%/_info, %, $(wildcard ccan/*/_info))
+
+# Exclude any modules we can't build.
+ALL=$(filter-out $(EXCLUDE), $(REALLY_ALL))
+
+# Anything with C files needs building; dir leaves / on, sort uniquifies
+DIRS=$(patsubst %/, %, $(sort $(foreach m, $(ALL), $(dir $(wildcard ccan/$m/*.c)))))
 
 # Generate everyone's separate Makefiles.
 -include $(foreach dir, $(DIRS), $(dir)-Makefile)
index 6079c9d9faf2cc14f2931f8d0db85401dd705784..d6ea6cc94806857bbee651ec15c735988a093128 100644 (file)
@@ -2,7 +2,6 @@
 WEBDIR=/home/rusty/www/html/ccan
 
 # Ignore EXCLUDE when making webpages.
-REALLY_ALL=$(patsubst ccan/%/_info, %, $(wildcard ccan/*/_info))
 ALL_PAGES=$(patsubst %, $(WEBDIR)/info/%.html, $(REALLY_ALL))
 DIRECT_TARBALLS=$(patsubst %, $(WEBDIR)/tarballs/%.tar.bz2, $(REALLY_ALL))
 DEPEND_TARBALLS=$(patsubst %, $(WEBDIR)/tarballs/with-deps/%.tar.bz2, $(REALLY_ALL))