Browse Source

[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>
tags/v0.9.8
Michael Brown 15 years ago
parent
commit
dc387547a3
1 changed files with 9 additions and 1 deletions
  1. 9
    1
      src/Makefile.housekeeping

+ 9
- 1
src/Makefile.housekeeping View File

52
 echo :
52
 echo :
53
 	@$(ECHO) "Using \"$(ECHO_E)\" for \"echo -e\""
53
 	@$(ECHO) "Using \"$(ECHO_E)\" for \"echo -e\""
54
 
54
 
55
+###############################################################################
56
+#
57
+# Generate a usable "seq" substitute
58
+#
59
+define seq
60
+	$(shell awk 'BEGIN { for ( i = $(1) ; i <= $(2) ; i++ ) print i }')
61
+endef
62
+
55
 ###############################################################################
63
 ###############################################################################
56
 #
64
 #
57
 # Determine host OS
65
 # Determine host OS
495
 VERYCLEANUP	+= $(EMBEDDED_LIST)
503
 VERYCLEANUP	+= $(EMBEDDED_LIST)
496
 
504
 
497
 EMBEDDED_FILES	:= $(subst $(COMMA), ,$(EMBEDDED_IMAGE))
505
 EMBEDDED_FILES	:= $(subst $(COMMA), ,$(EMBEDDED_IMAGE))
498
-EMBED_ALL	:= $(foreach i,$(shell seq 1 $(words $(EMBEDDED_FILES))),\
506
+EMBED_ALL	:= $(foreach i,$(call seq,1,$(words $(EMBEDDED_FILES))),\
499
 		     EMBED ( $(i), \"$(word $(i), $(EMBEDDED_FILES))\",\
507
 		     EMBED ( $(i), \"$(word $(i), $(EMBEDDED_FILES))\",\
500
 			     \"$(notdir $(word $(i),$(EMBEDDED_FILES)))\" ))
508
 			     \"$(notdir $(word $(i),$(EMBEDDED_FILES)))\" ))
501
 
509
 

Loading…
Cancel
Save