# 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/)))
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 )
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)
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))