Browse Source

Use "/bin/echo -e" instead of shell builtin echo; some shells don't

implement the -e option.

(Thanks to Jim McQuillan for this suggestion.)
tags/v0.9.3
Michael Brown 17 years ago
parent
commit
6f799db5bd
2 changed files with 88 additions and 95 deletions
  1. 23
    22
      src/Makefile
  2. 65
    73
      src/Makefile.housekeeping

+ 23
- 22
src/Makefile View File

42
 # message.
42
 # message.
43
 #
43
 #
44
 noargs : blib $(BIN)/NIC $(BIN)/gpxe.dsk $(BIN)/gpxe.iso $(BIN)/gpxe.usb
44
 noargs : blib $(BIN)/NIC $(BIN)/gpxe.dsk $(BIN)/gpxe.iso $(BIN)/gpxe.usb
45
-	@echo '==========================================================='
46
-	@echo
47
-	@echo 'To create a bootable floppy, type'
48
-	@echo '    cat $(BIN)/gpxe.dsk > /dev/fd0'
49
-	@echo 'where /dev/fd0 is your floppy drive.  This will erase any'
50
-	@echo 'data already on the disk.'
51
-	@echo
52
-	@echo 'To create a bootable USB key, type'
53
-	@echo '    cat $(BIN)/gpxe.usb > /dev/sdX'
54
-	@echo 'where /dev/sdX is your USB key, and is *not* a real hard'
55
-	@echo 'disk on your system.  This will erase any data already on'
56
-	@echo 'the USB key.'
57
-	@echo
58
-	@echo 'To create a bootable CD-ROM, burn the ISO image '
59
-	@echo '$(BIN)/gpxe.iso to a blank CD-ROM.'
60
-	@echo
61
-	@echo 'These images contain drivers for all supported cards.  You'
62
-	@echo 'can build more customised images, and ROM images, using'
63
-	@echo '    make bin/<rom-name>.<output-format>'
64
-	@echo
65
-	@echo '==========================================================='
45
+	@$(ECHO) '==========================================================='
46
+	@$(ECHO)
47
+	@$(ECHO) 'To create a bootable floppy, type'
48
+	@$(ECHO) '    cat $(BIN)/gpxe.dsk > /dev/fd0'
49
+	@$(ECHO) 'where /dev/fd0 is your floppy drive.  This will erase any'
50
+	@$(ECHO) 'data already on the disk.'
51
+	@$(ECHO)
52
+	@$(ECHO) 'To create a bootable USB key, type'
53
+	@$(ECHO) '    cat $(BIN)/gpxe.usb > /dev/sdX'
54
+	@$(ECHO) 'where /dev/sdX is your USB key, and is *not* a real hard'
55
+	@$(ECHO) 'disk on your system.  This will erase any data already on'
56
+	@$(ECHO) 'the USB key.'
57
+	@$(ECHO)
58
+	@$(ECHO) 'To create a bootable CD-ROM, burn the ISO image '
59
+	@$(ECHO) '$(BIN)/gpxe.iso to a blank CD-ROM.'
60
+	@$(ECHO)
61
+	@$(ECHO) 'These images contain drivers for all supported cards.  You'
62
+	@$(ECHO) 'can build more customised images, and ROM images, using'
63
+	@$(ECHO) '    make bin/<rom-name>.<output-format>'
64
+	@$(ECHO)
65
+	@$(ECHO) '==========================================================='
66
 
66
 
67
 # Locations of utilities
67
 # Locations of utilities
68
 #
68
 #
69
+ECHO		?= /bin/echo -e
69
 HOST_CC		?= gcc
70
 HOST_CC		?= gcc
70
 CPP		?= gcc -E -Wp,-Wall
71
 CPP		?= gcc -E -Wp,-Wall
71
 RM		?= rm -f
72
 RM		?= rm -f
120
 #
121
 #
121
 OBJ_CFLAGS	= $(CFLAGS_$(OBJECT)) -DOBJECT=$(subst -,_,$(OBJECT))
122
 OBJ_CFLAGS	= $(CFLAGS_$(OBJECT)) -DOBJECT=$(subst -,_,$(OBJECT))
122
 $(BIN)/%.flags :
123
 $(BIN)/%.flags :
123
-	@echo $(OBJ_CFLAGS)
124
+	@$(ECHO) $(OBJ_CFLAGS)
124
 
125
 
125
 # Rules for specific object types.
126
 # Rules for specific object types.
126
 #
127
 #

+ 65
- 73
src/Makefile.housekeeping View File

20
 		   -DVERSION=\"$(VERSION)\"
20
 		   -DVERSION=\"$(VERSION)\"
21
 IDENT		= '$(@F) $(VERSION) (GPL) etherboot.org'
21
 IDENT		= '$(@F) $(VERSION) (GPL) etherboot.org'
22
 version :
22
 version :
23
-	@echo $(VERSION)
23
+	@$(ECHO) $(VERSION)
24
 
24
 
25
 # Check for tools that can cause failed builds
25
 # Check for tools that can cause failed builds
26
 #
26
 #
27
 .toolcheck : Makefile Config
27
 .toolcheck : Makefile Config
28
 	@if $(CC) -v 2>&1 | grep -is 'gcc version 2\.96' > /dev/null; then \
28
 	@if $(CC) -v 2>&1 | grep -is 'gcc version 2\.96' > /dev/null; then \
29
-		echo 'gcc 2.96 is unsuitable for compiling Etherboot'; \
30
-		echo 'Use gcc 2.95 or gcc 3.x instead'; \
29
+		$(ECHO) 'gcc 2.96 is unsuitable for compiling Etherboot'; \
30
+		$(ECHO) 'Use gcc 2.95 or gcc 3.x instead'; \
31
 		exit 1; \
31
 		exit 1; \
32
 	fi
32
 	fi
33
 	@if [ `perl -e 'use bytes; print chr(255)' | wc -c` = 2 ]; then \
33
 	@if [ `perl -e 'use bytes; print chr(255)' | wc -c` = 2 ]; then \
34
-		echo 'Your Perl version has a Unicode handling bug'; \
35
-		echo 'Execute this command before compiling Etherboot:'; \
36
-		echo 'export LANG=$${LANG%.UTF-8}'; \
34
+		$(ECHO) 'Your Perl version has a Unicode handling bug'; \
35
+		$(ECHO) 'Execute this command before compiling Etherboot:'; \
36
+		$(ECHO) 'export LANG=$${LANG%.UTF-8}'; \
37
 		exit 1; \
37
 		exit 1; \
38
 	fi
38
 	fi
39
 	@$(TOUCH) $@
39
 	@$(TOUCH) $@
40
 VERYCLEANUP	+= .toolcheck
40
 VERYCLEANUP	+= .toolcheck
41
 
41
 
42
-# Check for correct syntax for echo -e
43
-#
44
-ifeq ($(shell echo '\0101'),A)
45
-ECHO_E = echo
46
-else
47
-ECHO_E = echo -e
48
-endif
49
-
50
 # Build verbosity
42
 # Build verbosity
51
 #
43
 #
52
 ifeq ($(V),1)
44
 ifeq ($(V),1)
59
 
51
 
60
 # Check for an old version of gas (binutils 2.9.1)
52
 # Check for an old version of gas (binutils 2.9.1)
61
 #
53
 #
62
-OLDGAS	:= $(shell $(AS) --version | grep -q '2\.9\.1' && echo -DGAS291)
54
+OLDGAS	:= $(shell $(AS) --version | grep -q '2\.9\.1' && $(ECHO) -DGAS291)
63
 CFLAGS	+= $(OLDGAS)
55
 CFLAGS	+= $(OLDGAS)
64
 oldgas :
56
 oldgas :
65
-	@echo $(oldgas)
57
+	@$(ECHO) $(oldgas)
66
 
58
 
67
 # compiler.h is needed for our linking and debugging system
59
 # compiler.h is needed for our linking and debugging system
68
 #
60
 #
75
 
67
 
76
 # SRCDIRS lists all directories containing source files.
68
 # SRCDIRS lists all directories containing source files.
77
 srcdirs :
69
 srcdirs :
78
-	@echo $(SRCDIRS)
70
+	@$(ECHO) $(SRCDIRS)
79
 
71
 
80
 # SRCS lists all .c or .S files found in any SRCDIR
72
 # SRCS lists all .c or .S files found in any SRCDIR
81
 #
73
 #
82
 SRCS	+= $(wildcard $(patsubst %,%/*.c,$(SRCDIRS)))
74
 SRCS	+= $(wildcard $(patsubst %,%/*.c,$(SRCDIRS)))
83
 SRCS	+= $(wildcard $(patsubst %,%/*.S,$(SRCDIRS)))
75
 SRCS	+= $(wildcard $(patsubst %,%/*.S,$(SRCDIRS)))
84
 srcs :
76
 srcs :
85
-	@echo $(SRCS)
77
+	@$(ECHO) $(SRCS)
86
 
78
 
87
 # AUTO_SRCS lists all files in SRCS that are not mentioned in
79
 # AUTO_SRCS lists all files in SRCS that are not mentioned in
88
 # NON_AUTO_SRCS.  Files should be added to NON_AUTO_SRCS if they
80
 # NON_AUTO_SRCS.  Files should be added to NON_AUTO_SRCS if they
90
 #
82
 #
91
 AUTO_SRCS = $(filter-out $(NON_AUTO_SRCS),$(SRCS))
83
 AUTO_SRCS = $(filter-out $(NON_AUTO_SRCS),$(SRCS))
92
 autosrcs :
84
 autosrcs :
93
-	@echo $(AUTO_SRCS)
85
+	@$(ECHO) $(AUTO_SRCS)
94
 
86
 
95
 # We automatically generate rules for any file mentioned in AUTO_SRCS
87
 # We automatically generate rules for any file mentioned in AUTO_SRCS
96
 # using the following set of templates.  It would be cleaner to use
88
 # using the following set of templates.  It would be cleaner to use
105
 #
97
 #
106
 define src_template
98
 define src_template
107
 
99
 
108
-	@echo "Generating Makefile rules for $(1)"
100
+	@$(ECHO) "Generating Makefile rules for $(1)"
109
 	@$(MKDIR) -p $(dir $(2))
101
 	@$(MKDIR) -p $(dir $(2))
110
 	@$(RM) $(2)
102
 	@$(RM) $(2)
111
 	@$(TOUCH) $(2)
103
 	@$(TOUCH) $(2)
129
 	@$(CPP) $(CFLAGS) $(CFLAGS_$(3)) $(CFLAGS_$(4)) -DOBJECT=$(4) \
121
 	@$(CPP) $(CFLAGS) $(CFLAGS_$(3)) $(CFLAGS_$(4)) -DOBJECT=$(4) \
130
 		-Wno-error -M $(1) -MT "$(4)_DEPS" -MG -MP | \
122
 		-Wno-error -M $(1) -MT "$(4)_DEPS" -MG -MP | \
131
 		sed 's/_DEPS\s*:/_DEPS =/' >> $(2)
123
 		sed 's/_DEPS\s*:/_DEPS =/' >> $(2)
132
-	@$(ECHO_E) '\n$$(BIN)/$(4).o : $(1) $$(MAKEDEPS) $$($(4)_DEPS)' \
133
-		 '\n\t$$(QM)echo "  [BUILD] $$@"\n' \
124
+	@$(ECHO) '\n$$(BIN)/$(4).o : $(1) $$(MAKEDEPS) $$($(4)_DEPS)' \
125
+		 '\n\t$$(QM)$(ECHO) "  [BUILD] $$@"\n' \
134
 		 '\n\t$$(RULE_$(3))\n' \
126
 		 '\n\t$$(RULE_$(3))\n' \
135
 		 '\nBOBJS += $$(BIN)/$(4).o\n' \
127
 		 '\nBOBJS += $$(BIN)/$(4).o\n' \
136
 		 $(foreach TGT,$(DEBUG_TARGETS), \
128
 		 $(foreach TGT,$(DEBUG_TARGETS), \
137
 		    $(if $(RULE_$(3)_to_$(TGT)), \
129
 		    $(if $(RULE_$(3)_to_$(TGT)), \
138
 		    '\n$$(BIN)/$(4).$(TGT) : $(1) $$(MAKEDEPS) $$($(4)_DEPS)' \
130
 		    '\n$$(BIN)/$(4).$(TGT) : $(1) $$(MAKEDEPS) $$($(4)_DEPS)' \
139
-		    '\n\t$$(QM)echo "  [BUILD] $$@"\n' \
131
+		    '\n\t$$(QM)$(ECHO) "  [BUILD] $$@"\n' \
140
 		    '\n\t$$(RULE_$(3)_to_$(TGT))\n' \
132
 		    '\n\t$$(RULE_$(3)_to_$(TGT))\n' \
141
 		    '\n$(TGT)_OBJS += $$(BIN)/$(4).$(TGT)\n' ) ) \
133
 		    '\n$(TGT)_OBJS += $$(BIN)/$(4).$(TGT)\n' ) ) \
142
 		 '\n$(2) : $$($(4)_DEPS)\n' \
134
 		 '\n$(2) : $$($(4)_DEPS)\n' \
148
 # Rule to generate the Makefile rules files to be included
140
 # Rule to generate the Makefile rules files to be included
149
 #
141
 #
150
 $(BIN)/deps/%.d : % $(MAKEDEPS) $(PARSEROM)
142
 $(BIN)/deps/%.d : % $(MAKEDEPS) $(PARSEROM)
151
-	$(if $(filter $(AUTO_SRCS),$<),$(call src_template,$<,$@,$(subst .,,$(suffix $<)),$(basename $(notdir $<))),@echo 'ERROR: $< is not an AUTO_SRC' ; exit 1)
143
+	$(if $(filter $(AUTO_SRCS),$<),$(call src_template,$<,$@,$(subst .,,$(suffix $<)),$(basename $(notdir $<))),@$(ECHO) 'ERROR: $< is not an AUTO_SRC' ; exit 1)
152
 
144
 
153
 # Calculate and include the list of Makefile rules files
145
 # Calculate and include the list of Makefile rules files
154
 #
146
 #
155
 AUTO_DEPS	= $(patsubst %,$(BIN)/deps/%.d,$(AUTO_SRCS))
147
 AUTO_DEPS	= $(patsubst %,$(BIN)/deps/%.d,$(AUTO_SRCS))
156
 include $(AUTO_DEPS)
148
 include $(AUTO_DEPS)
157
 autodeps :
149
 autodeps :
158
-	@echo $(AUTO_DEPS)
150
+	@$(ECHO) $(AUTO_DEPS)
159
 VERYCLEANUP	+= $(BIN)/deps
151
 VERYCLEANUP	+= $(BIN)/deps
160
 
152
 
161
 # The following variables are created by the Makefile rules files
153
 # The following variables are created by the Makefile rules files
162
 #
154
 #
163
 bobjs :
155
 bobjs :
164
-	@echo $(BOBJS)
156
+	@$(ECHO) $(BOBJS)
165
 drivers :
157
 drivers :
166
-	@echo $(DRIVERS)
158
+	@$(ECHO) $(DRIVERS)
167
 .PHONY : drivers
159
 .PHONY : drivers
168
 roms :
160
 roms :
169
-	@echo $(ROMS)
161
+	@$(ECHO) $(ROMS)
170
 
162
 
171
 # Generate the NIC file from the parsed source files.  The NIC file is
163
 # Generate the NIC file from the parsed source files.  The NIC file is
172
 # only for rom-o-matic.
164
 # only for rom-o-matic.
173
 #
165
 #
174
 $(BIN)/NIC : $(AUTO_DEPS)
166
 $(BIN)/NIC : $(AUTO_DEPS)
175
-	@echo '# This is an automatically generated file, do not edit' > $@
176
-	@echo '# It does not affect anything in the build, ' \
167
+	@$(ECHO) '# This is an automatically generated file, do not edit' > $@
168
+	@$(ECHO) '# It does not affect anything in the build, ' \
177
 	     'it is only for rom-o-matic' >> $@
169
 	     'it is only for rom-o-matic' >> $@
178
-	@echo >> $@
170
+	@$(ECHO) >> $@
179
 	@perl -ne 'chomp; print "$$1\n" if /\# NIC\t(.*)$$/' $^ >> $@
171
 	@perl -ne 'chomp; print "$$1\n" if /\# NIC\t(.*)$$/' $^ >> $@
180
 CLEANUP		+= $(BIN)/NIC
172
 CLEANUP		+= $(BIN)/NIC
181
 
173
 
258
 # Print out all derived information for a given target.
250
 # Print out all derived information for a given target.
259
 #
251
 #
260
 $(BIN)/%.info :
252
 $(BIN)/%.info :
261
-	@echo 'Elements             : $(TGT_ELEMENTS)'
262
-	@echo 'Prefix               : $(TGT_PREFIX)'
263
-	@echo 'Drivers              : $(TGT_DRIVERS)'
264
-	@echo 'ROM name             : $(TGT_ROM_NAME)'
265
-	@echo 'Media                : $(TGT_MEDIA)'
266
-	@echo
267
-	@echo 'PCI vendor           : $(TGT_PCI_VENDOR)'
268
-	@echo 'PCI device           : $(TGT_PCI_DEVICE)'
269
-	@echo
270
-	@echo 'LD driver symbols    : $(TGT_LD_DRIVERS)'
271
-	@echo 'LD prefix symbols    : $(TGT_LD_PREFIX)'
272
-	@echo 'LD ID symbols        : $(TGT_LD_IDS)'
273
-	@echo
274
-	@echo 'LD target flags      : $(TGT_LD_FLAGS)'
275
-	@echo
276
-	@echo 'makerom target flags : $(TGT_MAKEROM_FLAGS)'
277
-	@echo
278
-	@echo 'Debugging objects    : $(DEBUG_OBJS)'
279
-	@echo 'Replaced objects     : $(DEBUG_ORIG_OBJS)'
253
+	@$(ECHO) 'Elements             : $(TGT_ELEMENTS)'
254
+	@$(ECHO) 'Prefix               : $(TGT_PREFIX)'
255
+	@$(ECHO) 'Drivers              : $(TGT_DRIVERS)'
256
+	@$(ECHO) 'ROM name             : $(TGT_ROM_NAME)'
257
+	@$(ECHO) 'Media                : $(TGT_MEDIA)'
258
+	@$(ECHO)
259
+	@$(ECHO) 'PCI vendor           : $(TGT_PCI_VENDOR)'
260
+	@$(ECHO) 'PCI device           : $(TGT_PCI_DEVICE)'
261
+	@$(ECHO)
262
+	@$(ECHO) 'LD driver symbols    : $(TGT_LD_DRIVERS)'
263
+	@$(ECHO) 'LD prefix symbols    : $(TGT_LD_PREFIX)'
264
+	@$(ECHO) 'LD ID symbols        : $(TGT_LD_IDS)'
265
+	@$(ECHO)
266
+	@$(ECHO) 'LD target flags      : $(TGT_LD_FLAGS)'
267
+	@$(ECHO)
268
+	@$(ECHO) 'makerom target flags : $(TGT_MAKEROM_FLAGS)'
269
+	@$(ECHO)
270
+	@$(ECHO) 'Debugging objects    : $(DEBUG_OBJS)'
271
+	@$(ECHO) 'Replaced objects     : $(DEBUG_ORIG_OBJS)'
280
 
272
 
281
 # List of objects included in the last build of blib.  This is needed
273
 # List of objects included in the last build of blib.  This is needed
282
 # in order to correctly rebuild blib whenever the list of objects
274
 # in order to correctly rebuild blib whenever the list of objects
284
 #
276
 #
285
 BLIB_LIST	= $(BIN)/.blib.list
277
 BLIB_LIST	= $(BIN)/.blib.list
286
 ifneq ($(shell cat $(BLIB_LIST)),$(BLIB_OBJS))
278
 ifneq ($(shell cat $(BLIB_LIST)),$(BLIB_OBJS))
287
-$(shell echo "$(BLIB_OBJS)" > $(BLIB_LIST))
279
+$(shell $(ECHO) "$(BLIB_OBJS)" > $(BLIB_LIST))
288
 endif
280
 endif
289
 
281
 
290
 $(BLIB_LIST) :
282
 $(BLIB_LIST) :
296
 BLIB		= $(BIN)/blib.a
288
 BLIB		= $(BIN)/blib.a
297
 $(BLIB) : $(BLIB_OBJS) $(BLIB_LIST) $(MAKEDEPS)
289
 $(BLIB) : $(BLIB_OBJS) $(BLIB_LIST) $(MAKEDEPS)
298
 	$(Q)$(RM) $(BLIB)
290
 	$(Q)$(RM) $(BLIB)
299
-	$(QM)echo "  [AR] $@"
291
+	$(QM)$(ECHO) "  [AR] $@"
300
 	$(Q)$(AR) r $@ $(BLIB_OBJS)
292
 	$(Q)$(AR) r $@ $(BLIB_OBJS)
301
 	$(Q)$(RANLIB) $@
293
 	$(Q)$(RANLIB) $@
302
 blib : $(BLIB)
294
 blib : $(BLIB)
305
 # specified target.
297
 # specified target.
306
 #
298
 #
307
 $(BIN)/%.tmp : $(BLIB) $(MAKEDEPS) $(LDSCRIPT) 
299
 $(BIN)/%.tmp : $(BLIB) $(MAKEDEPS) $(LDSCRIPT) 
308
-	$(QM)echo "  [LD] $@"
300
+	$(QM)$(ECHO) "  [LD] $@"
309
 	$(Q)$(LD) $(LDFLAGS) -T $(LDSCRIPT) $(TGT_LD_FLAGS) $(BLIB) -o $@ \
301
 	$(Q)$(LD) $(LDFLAGS) -T $(LDSCRIPT) $(TGT_LD_FLAGS) $(BLIB) -o $@ \
310
 		-Map $(BIN)/$*.tmp.map
302
 		-Map $(BIN)/$*.tmp.map
311
 	$(Q)$(OBJDUMP) -ht $@ | $(SORTOBJDUMP) >> $(BIN)/$*.tmp.map
303
 	$(Q)$(OBJDUMP) -ht $@ | $(SORTOBJDUMP) >> $(BIN)/$*.tmp.map
318
 # Extract compression information from intermediate object file
310
 # Extract compression information from intermediate object file
319
 #
311
 #
320
 $(BIN)/%.zinfo : $(BIN)/%.tmp
312
 $(BIN)/%.zinfo : $(BIN)/%.tmp
321
-	$(QM)echo "  [ZINFO] $@"
313
+	$(QM)$(ECHO) "  [ZINFO] $@"
322
 	$(Q)$(OBJCOPY) -O binary -j .zinfo $< $@
314
 	$(Q)$(OBJCOPY) -O binary -j .zinfo $< $@
323
 
315
 
324
 # Build raw binary file from intermediate object file
316
 # Build raw binary file from intermediate object file
325
 #
317
 #
326
 $(BIN)/%.bin : $(BIN)/%.tmp
318
 $(BIN)/%.bin : $(BIN)/%.tmp
327
-	$(QM)echo "  [BIN] $@"
319
+	$(QM)$(ECHO) "  [BIN] $@"
328
 	$(Q)$(OBJCOPY) -O binary -R .zinfo $< $@
320
 	$(Q)$(OBJCOPY) -O binary -R .zinfo $< $@
329
 
321
 
330
 # Compress raw binary file
322
 # Compress raw binary file
331
 #
323
 #
332
 $(BIN)/%.zbin : $(BIN)/%.bin $(BIN)/%.zinfo $(ZBIN)
324
 $(BIN)/%.zbin : $(BIN)/%.bin $(BIN)/%.zinfo $(ZBIN)
333
-	$(QM)echo "  [ZBIN] $@"
325
+	$(QM)$(ECHO) "  [ZBIN] $@"
334
 	$(Q)$(ZBIN) $(BIN)/$*.bin $(BIN)/$*.zinfo > $@
326
 	$(Q)$(ZBIN) $(BIN)/$*.bin $(BIN)/$*.zinfo > $@
335
 
327
 
336
 # Build bochs symbol table
328
 # Build bochs symbol table
359
 # much difference to the overall build time.
351
 # much difference to the overall build time.
360
 
352
 
361
 media :
353
 media :
362
-	@echo $(MEDIA)
354
+	@$(ECHO) $(MEDIA)
363
 
355
 
364
 AUTO_MEDIA	= $(filter-out $(NON_AUTO_MEDIA),$(MEDIA))
356
 AUTO_MEDIA	= $(filter-out $(NON_AUTO_MEDIA),$(MEDIA))
365
 automedia :
357
 automedia :
366
-	@echo $(AUTO_MEDIA)
358
+	@$(ECHO) $(AUTO_MEDIA)
367
 
359
 
368
 # media_template : create Makefile rules for specified media
360
 # media_template : create Makefile rules for specified media
369
 #
361
 #
372
 #
364
 #
373
 define media_template
365
 define media_template
374
 
366
 
375
-	@echo "Generating Makefile rules for $(1) media"
367
+	@$(ECHO) "Generating Makefile rules for $(1) media"
376
 	@$(MKDIR) -p $(dir $(2))
368
 	@$(MKDIR) -p $(dir $(2))
377
 	@$(RM) $(2)
369
 	@$(RM) $(2)
378
 	@$(TOUCH) $(2)
370
 	@$(TOUCH) $(2)
379
-	@$(ECHO_E) '$$(BIN)/%.$(1) : $$(BIN)/%.$(1).zbin' \
380
-		  '\n\t$$(QM)echo "  [FINISH] $$@"' \
371
+	@$(ECHO) '$$(BIN)/%.$(1) : $$(BIN)/%.$(1).zbin' \
372
+		  '\n\t$$(QM)$(ECHO) "  [FINISH] $$@"' \
381
 		  '\n\t$$(Q)$$(CP) $$< $$@' \
373
 		  '\n\t$$(Q)$$(CP) $$< $$@' \
382
 		  '\n\t$$(Q)$$(FINALISE_$(1))' \
374
 		  '\n\t$$(Q)$$(FINALISE_$(1))' \
383
 		> $(2)
375
 		> $(2)
389
 $(BIN)/deps/%.media.d : $(MAKEDEPS)
381
 $(BIN)/deps/%.media.d : $(MAKEDEPS)
390
 	$(if $(filter $(AUTO_MEDIA),$*), \
382
 	$(if $(filter $(AUTO_MEDIA),$*), \
391
 		$(call media_template,$*,$@), \
383
 		$(call media_template,$*,$@), \
392
-		@echo 'ERROR: $* is not an AUTO_MEDIA' ; exit 1)
384
+		@$(ECHO) 'ERROR: $* is not an AUTO_MEDIA' ; exit 1)
393
 
385
 
394
 # Calculate and include the list of Makefile rules files
386
 # Calculate and include the list of Makefile rules files
395
 #
387
 #
396
 MEDIA_DEPS		= $(patsubst %,$(BIN)/deps/%.media.d,$(AUTO_MEDIA))
388
 MEDIA_DEPS		= $(patsubst %,$(BIN)/deps/%.media.d,$(AUTO_MEDIA))
397
 mediadeps :
389
 mediadeps :
398
-	@echo $(MEDIA_DEPS)
390
+	@$(ECHO) $(MEDIA_DEPS)
399
 include $(MEDIA_DEPS)
391
 include $(MEDIA_DEPS)
400
 
392
 
401
 # The "allXXXs" targets for each suffix
393
 # The "allXXXs" targets for each suffix
412
 # The compression utilities
404
 # The compression utilities
413
 #
405
 #
414
 $(NRV2B) : util/nrv2b.c $(MAKEDEPS)
406
 $(NRV2B) : util/nrv2b.c $(MAKEDEPS)
415
-	$(QM)echo "  [HOSTCC] $@"
407
+	$(QM)$(ECHO) "  [HOSTCC] $@"
416
 	$(Q)$(HOST_CC) -O2 -DENCODE -DDECODE -DMAIN -DVERBOSE -DNDEBUG \
408
 	$(Q)$(HOST_CC) -O2 -DENCODE -DDECODE -DMAIN -DVERBOSE -DNDEBUG \
417
 		       -DBITSIZE=32 -DENDIAN=0 -o $@ $<
409
 		       -DBITSIZE=32 -DENDIAN=0 -o $@ $<
418
 CLEANUP	+= $(NRV2B)
410
 CLEANUP	+= $(NRV2B)
419
 
411
 
420
 $(ZBIN) : util/zbin.c util/nrv2b.c $(MAKEDEPS)
412
 $(ZBIN) : util/zbin.c util/nrv2b.c $(MAKEDEPS)
421
-	$(QM)echo "  [HOSTCC] $@"
413
+	$(QM)$(ECHO) "  [HOSTCC] $@"
422
 	$(Q)$(HOST_CC) -O2 -o $@ $<
414
 	$(Q)$(HOST_CC) -O2 -o $@ $<
423
 CLEANUP += $(ZBIN)
415
 CLEANUP += $(ZBIN)
424
 
416
 
431
 BUILDSERIAL_NEXT	= config/.buildserial.next
423
 BUILDSERIAL_NEXT	= config/.buildserial.next
432
 
424
 
433
 $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT) :
425
 $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT) :
434
-	echo 1 > $@
426
+	$(ECHO) 1 > $@
435
 
427
 
436
 $(BUILDSERIAL_H) : $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT)
428
 $(BUILDSERIAL_H) : $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT)
437
-	echo '#define BUILD_SERIAL_NUM $(shell cat $<)' > $@
429
+	$(ECHO) '#define BUILD_SERIAL_NUM $(shell cat $<)' > $@
438
 
430
 
439
 ifeq ($(filter bs,$(MAKECMDGOALS)),bs)
431
 ifeq ($(filter bs,$(MAKECMDGOALS)),bs)
440
 $(shell diff -q $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT) > /dev/null || \
432
 $(shell diff -q $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT) > /dev/null || \
442
 endif
434
 endif
443
 
435
 
444
 bs : $(BUILDSERIAL_NOW)
436
 bs : $(BUILDSERIAL_NOW)
445
-	@echo $$(( $(shell cat $<) + 1 )) > $(BUILDSERIAL_NEXT)
446
-	@echo "Build serial number is $(shell cat $<)"
437
+	@$(ECHO) $$(( $(shell cat $<) + 1 )) > $(BUILDSERIAL_NEXT)
438
+	@$(ECHO) "Build serial number is $(shell cat $<)"
447
 
439
 
448
 # List of available architectures
440
 # List of available architectures
449
 #
441
 #
450
 ARCHS	= $(filter-out CVS,$(patsubst arch/%,%,$(wildcard arch/*)))
442
 ARCHS	= $(filter-out CVS,$(patsubst arch/%,%,$(wildcard arch/*)))
451
 archs :
443
 archs :
452
-	@echo $(ARCHS)
444
+	@$(ECHO) $(ARCHS)
453
 
445
 
454
 OTHER_ARCHS	= $(filter-out $(ARCH),$(ARCHS))
446
 OTHER_ARCHS	= $(filter-out $(ARCH),$(ARCHS))
455
 otherarchs :
447
 otherarchs :
456
-	@echo $(OTHER_ARCHS)
448
+	@$(ECHO) $(OTHER_ARCHS)
457
 
449
 
458
 # Build the TAGS file for emacs
450
 # Build the TAGS file for emacs
459
 #
451
 #
503
 	@if [ -n "$$BROWSER" ] ; then \
495
 	@if [ -n "$$BROWSER" ] ; then \
504
 		( $$BROWSER $(BIN)/doc/html/index.html & ) ; \
496
 		( $$BROWSER $(BIN)/doc/html/index.html & ) ; \
505
 	else \
497
 	else \
506
-		echo "Documentation index in $(BIN)/doc/html/index.html" ; \
498
+		$(ECHO) "Documentation index in $(BIN)/doc/html/index.html" ; \
507
 	fi
499
 	fi
508
 
500
 
509
 # Clean-up
501
 # Clean-up
517
 # Make clean tarballs for release
509
 # Make clean tarballs for release
518
 
510
 
519
 gpxe-tarball : ../VERSION
511
 gpxe-tarball : ../VERSION
520
-	(echo -n $(VERSION) ''; date -u +'%Y-%m-%d') > ../VERSION
512
+	($(ECHO) -n $(VERSION) ''; date -u +'%Y-%m-%d') > ../VERSION
521
 	$(RM) -r /tmp/gpxe/gpxe-$(VERSION)
513
 	$(RM) -r /tmp/gpxe/gpxe-$(VERSION)
522
 	mkdir -p /tmp/gpxe/gpxe-$(VERSION)
514
 	mkdir -p /tmp/gpxe/gpxe-$(VERSION)
523
 	cp -rP .. /tmp/gpxe/gpxe-$(VERSION)
515
 	cp -rP .. /tmp/gpxe/gpxe-$(VERSION)

Loading…
Cancel
Save