소스 검색

[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 년 전
부모
커밋
dc387547a3
1개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. 9
    1
      src/Makefile.housekeeping

+ 9
- 1
src/Makefile.housekeeping 파일 보기

@@ -52,6 +52,14 @@ VERYCLEANUP	+= .echocheck
52 52
 echo :
53 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 65
 # Determine host OS
@@ -495,7 +503,7 @@ $(EMBEDDED_LIST) :
495 503
 VERYCLEANUP	+= $(EMBEDDED_LIST)
496 504
 
497 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 507
 		     EMBED ( $(i), \"$(word $(i), $(EMBEDDED_FILES))\",\
500 508
 			     \"$(notdir $(word $(i),$(EMBEDDED_FILES)))\" ))
501 509
 

Loading…
취소
저장