From: Rusty Russell Date: Wed, 3 Nov 2010 12:48:10 +0000 (+1030) Subject: makefiles: add "scores" target. X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=5c5cd4b84c0dfac65356979cf13b72c3ea9ae62c makefiles: add "scores" target. --- diff --git a/Makefile b/Makefile index ae01880b..57d207f1 100644 --- a/Makefile +++ b/Makefile @@ -14,9 +14,13 @@ # 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 ) diff --git a/Makefile-ccan b/Makefile-ccan index 6911dffc..4364bc16 100644 --- a/Makefile-ccan +++ b/Makefile-ccan @@ -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) diff --git a/Makefile-web b/Makefile-web index 6079c9d9..d6ea6cc9 100644 --- a/Makefile-web +++ b/Makefile-web @@ -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))