From 9304c12c583d05e763bc5343d9f3f2ec95f36e44 Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Tue, 17 Jan 2012 00:32:54 +0400 Subject: [PATCH] fix toplevel arch/distro loops There was a somewhat subtle Makefile->main.mk rename leftover lurking in "everything" target: the default Makefile got used, not the supposed main.mk -- which resulted in an attempt to get way too much job done (the number of builds per target became $ARCH squared, not just $ARCH). Huge thanks to led@ for being an inspiring pedantic! --- Makefile | 2 ++ main.mk | 7 ++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 035ef679..d5f4a7cf 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,8 @@ export NUM_TARGETS := $(words $(MAKECMDGOALS)) echo "** goal: $@ [$$n/$(NUM_TARGETS)]"; \ fi; \ for ARCH in $(ARCHES); do \ + if [ "$$ARCH" != "$(firstword $(ARCHES))" ]; then echo; fi; \ + echo "** ARCH: $$ARCH"; \ $(MAKE) -f main.mk ARCH=$$ARCH $@; \ done; \ if [ "$$n" -lt "$(NUM_TARGETS)" ]; then echo; fi diff --git a/main.mk b/main.mk index 07c4478a..9ca1eb92 100644 --- a/main.mk +++ b/main.mk @@ -61,11 +61,8 @@ everything: @n=1; sum=$(words $(DISTROS)); \ for distro in $(DISTROS); do \ echo "** building $$distro [$$n/$$sum]:"; \ - $(MAKE) --no-print-directory \ - COUNT=$$n/$$sum \ - BUILDDIR=$(BUILDDIR) \ - $$distro; \ - echo; \ + $(MAKE) -f main.mk --no-print-directory $$distro; \ + [ "$$n" -lt "$$sum" ] && echo; \ n=$$(($$n+1)); \ done