david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[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 <oremanj@rwcr.net>
Suggested-by: Stefan Hajnoczi <stefanha@gmail.com>
This commit is contained in:
Michael Brown 2009-03-31 11:06:35 +01:00
parent 3dd7ce1c26
commit dc387547a3
1 changed files with 9 additions and 1 deletions

View 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)))\" ))