[build] Don't assume the existence of "seq"
authorMichael Brown <mcb30@etherboot.org>
Tue, 31 Mar 2009 10:06:35 +0000 (11:06 +0100)
committerMichael Brown <mcb30@etherboot.org>
Tue, 31 Mar 2009 10:06:35 +0000 (11:06 +0100)
The "seq" command is GNU-specific; a BSD userland will not have it.
Use POSIX-conforming "awk" instead.

Reported-by: Joshua Oreman <oremanj@rwcr.net>
Suggested-by: Stefan Hajnoczi <stefanha@gmail.com>
src/Makefile.housekeeping

index 4f0a8bb..8edb012 100644 (file)
@@ -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)))\" ))