From: Michael Brown Date: Tue, 31 Mar 2009 10:06:35 +0000 (+0100) Subject: [build] Don't assume the existence of "seq" X-Git-Tag: v0.9.8~171 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc387547a3cc37a2c5b5a3568405c961cf1edf84;p=thirdparty%2Fipxe.git [build] Don't assume the existence of "seq" The "seq" command is GNU-specific; a BSD userland will not have it. Use POSIX-conforming "awk" instead. Reported-by: Joshua Oreman Suggested-by: Stefan Hajnoczi --- diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping index 4f0a8bb30..8edb01278 100644 --- a/src/Makefile.housekeeping +++ b/src/Makefile.housekeeping @@ -52,6 +52,14 @@ VERYCLEANUP += .echocheck echo : @$(ECHO) "Using \"$(ECHO_E)\" for \"echo -e\"" +############################################################################### +# +# Generate a usable "seq" substitute +# +define seq + $(shell awk 'BEGIN { for ( i = $(1) ; i <= $(2) ; i++ ) print i }') +endef + ############################################################################### # # Determine host OS @@ -495,7 +503,7 @@ $(EMBEDDED_LIST) : VERYCLEANUP += $(EMBEDDED_LIST) EMBEDDED_FILES := $(subst $(COMMA), ,$(EMBEDDED_IMAGE)) -EMBED_ALL := $(foreach i,$(shell seq 1 $(words $(EMBEDDED_FILES))),\ +EMBED_ALL := $(foreach i,$(call seq,1,$(words $(EMBEDDED_FILES))),\ EMBED ( $(i), \"$(word $(i), $(EMBEDDED_FILES))\",\ \"$(notdir $(word $(i),$(EMBEDDED_FILES)))\" ))