david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

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

implement the -e option.

(Thanks to Jim McQuillan for this suggestion.)
This commit is contained in:
Michael Brown 2007-09-08 23:38:17 +01:00
parent 972f293e46
commit 6f799db5bd
2 changed files with 88 additions and 95 deletions

View File

@ -42,30 +42,31 @@ include arch/$(ARCH)/Config
# message. # message.
# #
noargs : blib $(BIN)/NIC $(BIN)/gpxe.dsk $(BIN)/gpxe.iso $(BIN)/gpxe.usb noargs : blib $(BIN)/NIC $(BIN)/gpxe.dsk $(BIN)/gpxe.iso $(BIN)/gpxe.usb
@echo '===========================================================' @$(ECHO) '==========================================================='
@echo @$(ECHO)
@echo 'To create a bootable floppy, type' @$(ECHO) 'To create a bootable floppy, type'
@echo ' cat $(BIN)/gpxe.dsk > /dev/fd0' @$(ECHO) ' cat $(BIN)/gpxe.dsk > /dev/fd0'
@echo 'where /dev/fd0 is your floppy drive. This will erase any' @$(ECHO) 'where /dev/fd0 is your floppy drive. This will erase any'
@echo 'data already on the disk.' @$(ECHO) 'data already on the disk.'
@echo @$(ECHO)
@echo 'To create a bootable USB key, type' @$(ECHO) 'To create a bootable USB key, type'
@echo ' cat $(BIN)/gpxe.usb > /dev/sdX' @$(ECHO) ' cat $(BIN)/gpxe.usb > /dev/sdX'
@echo 'where /dev/sdX is your USB key, and is *not* a real hard' @$(ECHO) 'where /dev/sdX is your USB key, and is *not* a real hard'
@echo 'disk on your system. This will erase any data already on' @$(ECHO) 'disk on your system. This will erase any data already on'
@echo 'the USB key.' @$(ECHO) 'the USB key.'
@echo @$(ECHO)
@echo 'To create a bootable CD-ROM, burn the ISO image ' @$(ECHO) 'To create a bootable CD-ROM, burn the ISO image '
@echo '$(BIN)/gpxe.iso to a blank CD-ROM.' @$(ECHO) '$(BIN)/gpxe.iso to a blank CD-ROM.'
@echo @$(ECHO)
@echo 'These images contain drivers for all supported cards. You' @$(ECHO) 'These images contain drivers for all supported cards. You'
@echo 'can build more customised images, and ROM images, using' @$(ECHO) 'can build more customised images, and ROM images, using'
@echo ' make bin/<rom-name>.<output-format>' @$(ECHO) ' make bin/<rom-name>.<output-format>'
@echo @$(ECHO)
@echo '===========================================================' @$(ECHO) '==========================================================='
# Locations of utilities # Locations of utilities
# #
ECHO ?= /bin/echo -e
HOST_CC ?= gcc HOST_CC ?= gcc
CPP ?= gcc -E -Wp,-Wall CPP ?= gcc -E -Wp,-Wall
RM ?= rm -f RM ?= rm -f
@ -120,7 +121,7 @@ OBJECT = $(firstword $(subst ., ,$(@F)))
# #
OBJ_CFLAGS = $(CFLAGS_$(OBJECT)) -DOBJECT=$(subst -,_,$(OBJECT)) OBJ_CFLAGS = $(CFLAGS_$(OBJECT)) -DOBJECT=$(subst -,_,$(OBJECT))
$(BIN)/%.flags : $(BIN)/%.flags :
@echo $(OBJ_CFLAGS) @$(ECHO) $(OBJ_CFLAGS)
# Rules for specific object types. # Rules for specific object types.
# #

View File

@ -20,33 +20,25 @@ CFLAGS += -DVERSION_MAJOR=$(VERSION_MAJOR) \
-DVERSION=\"$(VERSION)\" -DVERSION=\"$(VERSION)\"
IDENT = '$(@F) $(VERSION) (GPL) etherboot.org' IDENT = '$(@F) $(VERSION) (GPL) etherboot.org'
version : version :
@echo $(VERSION) @$(ECHO) $(VERSION)
# Check for tools that can cause failed builds # Check for tools that can cause failed builds
# #
.toolcheck : Makefile Config .toolcheck : Makefile Config
@if $(CC) -v 2>&1 | grep -is 'gcc version 2\.96' > /dev/null; then \ @if $(CC) -v 2>&1 | grep -is 'gcc version 2\.96' > /dev/null; then \
echo 'gcc 2.96 is unsuitable for compiling Etherboot'; \ $(ECHO) 'gcc 2.96 is unsuitable for compiling Etherboot'; \
echo 'Use gcc 2.95 or gcc 3.x instead'; \ $(ECHO) 'Use gcc 2.95 or gcc 3.x instead'; \
exit 1; \ exit 1; \
fi fi
@if [ `perl -e 'use bytes; print chr(255)' | wc -c` = 2 ]; then \ @if [ `perl -e 'use bytes; print chr(255)' | wc -c` = 2 ]; then \
echo 'Your Perl version has a Unicode handling bug'; \ $(ECHO) 'Your Perl version has a Unicode handling bug'; \
echo 'Execute this command before compiling Etherboot:'; \ $(ECHO) 'Execute this command before compiling Etherboot:'; \
echo 'export LANG=$${LANG%.UTF-8}'; \ $(ECHO) 'export LANG=$${LANG%.UTF-8}'; \
exit 1; \ exit 1; \
fi fi
@$(TOUCH) $@ @$(TOUCH) $@
VERYCLEANUP += .toolcheck VERYCLEANUP += .toolcheck
# Check for correct syntax for echo -e
#
ifeq ($(shell echo '\0101'),A)
ECHO_E = echo
else
ECHO_E = echo -e
endif
# Build verbosity # Build verbosity
# #
ifeq ($(V),1) ifeq ($(V),1)
@ -59,10 +51,10 @@ endif
# Check for an old version of gas (binutils 2.9.1) # Check for an old version of gas (binutils 2.9.1)
# #
OLDGAS := $(shell $(AS) --version | grep -q '2\.9\.1' && echo -DGAS291) OLDGAS := $(shell $(AS) --version | grep -q '2\.9\.1' && $(ECHO) -DGAS291)
CFLAGS += $(OLDGAS) CFLAGS += $(OLDGAS)
oldgas : oldgas :
@echo $(oldgas) @$(ECHO) $(oldgas)
# compiler.h is needed for our linking and debugging system # compiler.h is needed for our linking and debugging system
# #
@ -75,14 +67,14 @@ CLEANUP += config/*.h
# SRCDIRS lists all directories containing source files. # SRCDIRS lists all directories containing source files.
srcdirs : srcdirs :
@echo $(SRCDIRS) @$(ECHO) $(SRCDIRS)
# SRCS lists all .c or .S files found in any SRCDIR # SRCS lists all .c or .S files found in any SRCDIR
# #
SRCS += $(wildcard $(patsubst %,%/*.c,$(SRCDIRS))) SRCS += $(wildcard $(patsubst %,%/*.c,$(SRCDIRS)))
SRCS += $(wildcard $(patsubst %,%/*.S,$(SRCDIRS))) SRCS += $(wildcard $(patsubst %,%/*.S,$(SRCDIRS)))
srcs : srcs :
@echo $(SRCS) @$(ECHO) $(SRCS)
# AUTO_SRCS lists all files in SRCS that are not mentioned in # AUTO_SRCS lists all files in SRCS that are not mentioned in
# NON_AUTO_SRCS. Files should be added to NON_AUTO_SRCS if they # NON_AUTO_SRCS. Files should be added to NON_AUTO_SRCS if they
@ -90,7 +82,7 @@ srcs :
# #
AUTO_SRCS = $(filter-out $(NON_AUTO_SRCS),$(SRCS)) AUTO_SRCS = $(filter-out $(NON_AUTO_SRCS),$(SRCS))
autosrcs : autosrcs :
@echo $(AUTO_SRCS) @$(ECHO) $(AUTO_SRCS)
# We automatically generate rules for any file mentioned in AUTO_SRCS # We automatically generate rules for any file mentioned in AUTO_SRCS
# using the following set of templates. It would be cleaner to use # using the following set of templates. It would be cleaner to use
@ -105,7 +97,7 @@ autosrcs :
# #
define src_template define src_template
@echo "Generating Makefile rules for $(1)" @$(ECHO) "Generating Makefile rules for $(1)"
@$(MKDIR) -p $(dir $(2)) @$(MKDIR) -p $(dir $(2))
@$(RM) $(2) @$(RM) $(2)
@$(TOUCH) $(2) @$(TOUCH) $(2)
@ -129,14 +121,14 @@ define obj_template
@$(CPP) $(CFLAGS) $(CFLAGS_$(3)) $(CFLAGS_$(4)) -DOBJECT=$(4) \ @$(CPP) $(CFLAGS) $(CFLAGS_$(3)) $(CFLAGS_$(4)) -DOBJECT=$(4) \
-Wno-error -M $(1) -MT "$(4)_DEPS" -MG -MP | \ -Wno-error -M $(1) -MT "$(4)_DEPS" -MG -MP | \
sed 's/_DEPS\s*:/_DEPS =/' >> $(2) sed 's/_DEPS\s*:/_DEPS =/' >> $(2)
@$(ECHO_E) '\n$$(BIN)/$(4).o : $(1) $$(MAKEDEPS) $$($(4)_DEPS)' \ @$(ECHO) '\n$$(BIN)/$(4).o : $(1) $$(MAKEDEPS) $$($(4)_DEPS)' \
'\n\t$$(QM)echo " [BUILD] $$@"\n' \ '\n\t$$(QM)$(ECHO) " [BUILD] $$@"\n' \
'\n\t$$(RULE_$(3))\n' \ '\n\t$$(RULE_$(3))\n' \
'\nBOBJS += $$(BIN)/$(4).o\n' \ '\nBOBJS += $$(BIN)/$(4).o\n' \
$(foreach TGT,$(DEBUG_TARGETS), \ $(foreach TGT,$(DEBUG_TARGETS), \
$(if $(RULE_$(3)_to_$(TGT)), \ $(if $(RULE_$(3)_to_$(TGT)), \
'\n$$(BIN)/$(4).$(TGT) : $(1) $$(MAKEDEPS) $$($(4)_DEPS)' \ '\n$$(BIN)/$(4).$(TGT) : $(1) $$(MAKEDEPS) $$($(4)_DEPS)' \
'\n\t$$(QM)echo " [BUILD] $$@"\n' \ '\n\t$$(QM)$(ECHO) " [BUILD] $$@"\n' \
'\n\t$$(RULE_$(3)_to_$(TGT))\n' \ '\n\t$$(RULE_$(3)_to_$(TGT))\n' \
'\n$(TGT)_OBJS += $$(BIN)/$(4).$(TGT)\n' ) ) \ '\n$(TGT)_OBJS += $$(BIN)/$(4).$(TGT)\n' ) ) \
'\n$(2) : $$($(4)_DEPS)\n' \ '\n$(2) : $$($(4)_DEPS)\n' \
@ -148,34 +140,34 @@ endef
# Rule to generate the Makefile rules files to be included # Rule to generate the Makefile rules files to be included
# #
$(BIN)/deps/%.d : % $(MAKEDEPS) $(PARSEROM) $(BIN)/deps/%.d : % $(MAKEDEPS) $(PARSEROM)
$(if $(filter $(AUTO_SRCS),$<),$(call src_template,$<,$@,$(subst .,,$(suffix $<)),$(basename $(notdir $<))),@echo 'ERROR: $< is not an AUTO_SRC' ; exit 1) $(if $(filter $(AUTO_SRCS),$<),$(call src_template,$<,$@,$(subst .,,$(suffix $<)),$(basename $(notdir $<))),@$(ECHO) 'ERROR: $< is not an AUTO_SRC' ; exit 1)
# Calculate and include the list of Makefile rules files # Calculate and include the list of Makefile rules files
# #
AUTO_DEPS = $(patsubst %,$(BIN)/deps/%.d,$(AUTO_SRCS)) AUTO_DEPS = $(patsubst %,$(BIN)/deps/%.d,$(AUTO_SRCS))
include $(AUTO_DEPS) include $(AUTO_DEPS)
autodeps : autodeps :
@echo $(AUTO_DEPS) @$(ECHO) $(AUTO_DEPS)
VERYCLEANUP += $(BIN)/deps VERYCLEANUP += $(BIN)/deps
# The following variables are created by the Makefile rules files # The following variables are created by the Makefile rules files
# #
bobjs : bobjs :
@echo $(BOBJS) @$(ECHO) $(BOBJS)
drivers : drivers :
@echo $(DRIVERS) @$(ECHO) $(DRIVERS)
.PHONY : drivers .PHONY : drivers
roms : roms :
@echo $(ROMS) @$(ECHO) $(ROMS)
# Generate the NIC file from the parsed source files. The NIC file is # Generate the NIC file from the parsed source files. The NIC file is
# only for rom-o-matic. # only for rom-o-matic.
# #
$(BIN)/NIC : $(AUTO_DEPS) $(BIN)/NIC : $(AUTO_DEPS)
@echo '# This is an automatically generated file, do not edit' > $@ @$(ECHO) '# This is an automatically generated file, do not edit' > $@
@echo '# It does not affect anything in the build, ' \ @$(ECHO) '# It does not affect anything in the build, ' \
'it is only for rom-o-matic' >> $@ 'it is only for rom-o-matic' >> $@
@echo >> $@ @$(ECHO) >> $@
@perl -ne 'chomp; print "$$1\n" if /\# NIC\t(.*)$$/' $^ >> $@ @perl -ne 'chomp; print "$$1\n" if /\# NIC\t(.*)$$/' $^ >> $@
CLEANUP += $(BIN)/NIC CLEANUP += $(BIN)/NIC
@ -258,25 +250,25 @@ BLIB_OBJS = $(DEBUG_OBJS) $(filter-out $(DEBUG_ORIG_OBJS),$(BOBJS))
# Print out all derived information for a given target. # Print out all derived information for a given target.
# #
$(BIN)/%.info : $(BIN)/%.info :
@echo 'Elements : $(TGT_ELEMENTS)' @$(ECHO) 'Elements : $(TGT_ELEMENTS)'
@echo 'Prefix : $(TGT_PREFIX)' @$(ECHO) 'Prefix : $(TGT_PREFIX)'
@echo 'Drivers : $(TGT_DRIVERS)' @$(ECHO) 'Drivers : $(TGT_DRIVERS)'
@echo 'ROM name : $(TGT_ROM_NAME)' @$(ECHO) 'ROM name : $(TGT_ROM_NAME)'
@echo 'Media : $(TGT_MEDIA)' @$(ECHO) 'Media : $(TGT_MEDIA)'
@echo @$(ECHO)
@echo 'PCI vendor : $(TGT_PCI_VENDOR)' @$(ECHO) 'PCI vendor : $(TGT_PCI_VENDOR)'
@echo 'PCI device : $(TGT_PCI_DEVICE)' @$(ECHO) 'PCI device : $(TGT_PCI_DEVICE)'
@echo @$(ECHO)
@echo 'LD driver symbols : $(TGT_LD_DRIVERS)' @$(ECHO) 'LD driver symbols : $(TGT_LD_DRIVERS)'
@echo 'LD prefix symbols : $(TGT_LD_PREFIX)' @$(ECHO) 'LD prefix symbols : $(TGT_LD_PREFIX)'
@echo 'LD ID symbols : $(TGT_LD_IDS)' @$(ECHO) 'LD ID symbols : $(TGT_LD_IDS)'
@echo @$(ECHO)
@echo 'LD target flags : $(TGT_LD_FLAGS)' @$(ECHO) 'LD target flags : $(TGT_LD_FLAGS)'
@echo @$(ECHO)
@echo 'makerom target flags : $(TGT_MAKEROM_FLAGS)' @$(ECHO) 'makerom target flags : $(TGT_MAKEROM_FLAGS)'
@echo @$(ECHO)
@echo 'Debugging objects : $(DEBUG_OBJS)' @$(ECHO) 'Debugging objects : $(DEBUG_OBJS)'
@echo 'Replaced objects : $(DEBUG_ORIG_OBJS)' @$(ECHO) 'Replaced objects : $(DEBUG_ORIG_OBJS)'
# List of objects included in the last build of blib. This is needed # List of objects included in the last build of blib. This is needed
# in order to correctly rebuild blib whenever the list of objects # in order to correctly rebuild blib whenever the list of objects
@ -284,7 +276,7 @@ $(BIN)/%.info :
# #
BLIB_LIST = $(BIN)/.blib.list BLIB_LIST = $(BIN)/.blib.list
ifneq ($(shell cat $(BLIB_LIST)),$(BLIB_OBJS)) ifneq ($(shell cat $(BLIB_LIST)),$(BLIB_OBJS))
$(shell echo "$(BLIB_OBJS)" > $(BLIB_LIST)) $(shell $(ECHO) "$(BLIB_OBJS)" > $(BLIB_LIST))
endif endif
$(BLIB_LIST) : $(BLIB_LIST) :
@ -296,7 +288,7 @@ VERYCLEANUP += $(BLIB_LIST)
BLIB = $(BIN)/blib.a BLIB = $(BIN)/blib.a
$(BLIB) : $(BLIB_OBJS) $(BLIB_LIST) $(MAKEDEPS) $(BLIB) : $(BLIB_OBJS) $(BLIB_LIST) $(MAKEDEPS)
$(Q)$(RM) $(BLIB) $(Q)$(RM) $(BLIB)
$(QM)echo " [AR] $@" $(QM)$(ECHO) " [AR] $@"
$(Q)$(AR) r $@ $(BLIB_OBJS) $(Q)$(AR) r $@ $(BLIB_OBJS)
$(Q)$(RANLIB) $@ $(Q)$(RANLIB) $@
blib : $(BLIB) blib : $(BLIB)
@ -305,7 +297,7 @@ blib : $(BLIB)
# specified target. # specified target.
# #
$(BIN)/%.tmp : $(BLIB) $(MAKEDEPS) $(LDSCRIPT) $(BIN)/%.tmp : $(BLIB) $(MAKEDEPS) $(LDSCRIPT)
$(QM)echo " [LD] $@" $(QM)$(ECHO) " [LD] $@"
$(Q)$(LD) $(LDFLAGS) -T $(LDSCRIPT) $(TGT_LD_FLAGS) $(BLIB) -o $@ \ $(Q)$(LD) $(LDFLAGS) -T $(LDSCRIPT) $(TGT_LD_FLAGS) $(BLIB) -o $@ \
-Map $(BIN)/$*.tmp.map -Map $(BIN)/$*.tmp.map
$(Q)$(OBJDUMP) -ht $@ | $(SORTOBJDUMP) >> $(BIN)/$*.tmp.map $(Q)$(OBJDUMP) -ht $@ | $(SORTOBJDUMP) >> $(BIN)/$*.tmp.map
@ -318,19 +310,19 @@ $(BIN)/%.map : $(BIN)/%.tmp
# Extract compression information from intermediate object file # Extract compression information from intermediate object file
# #
$(BIN)/%.zinfo : $(BIN)/%.tmp $(BIN)/%.zinfo : $(BIN)/%.tmp
$(QM)echo " [ZINFO] $@" $(QM)$(ECHO) " [ZINFO] $@"
$(Q)$(OBJCOPY) -O binary -j .zinfo $< $@ $(Q)$(OBJCOPY) -O binary -j .zinfo $< $@
# Build raw binary file from intermediate object file # Build raw binary file from intermediate object file
# #
$(BIN)/%.bin : $(BIN)/%.tmp $(BIN)/%.bin : $(BIN)/%.tmp
$(QM)echo " [BIN] $@" $(QM)$(ECHO) " [BIN] $@"
$(Q)$(OBJCOPY) -O binary -R .zinfo $< $@ $(Q)$(OBJCOPY) -O binary -R .zinfo $< $@
# Compress raw binary file # Compress raw binary file
# #
$(BIN)/%.zbin : $(BIN)/%.bin $(BIN)/%.zinfo $(ZBIN) $(BIN)/%.zbin : $(BIN)/%.bin $(BIN)/%.zinfo $(ZBIN)
$(QM)echo " [ZBIN] $@" $(QM)$(ECHO) " [ZBIN] $@"
$(Q)$(ZBIN) $(BIN)/$*.bin $(BIN)/$*.zinfo > $@ $(Q)$(ZBIN) $(BIN)/$*.bin $(BIN)/$*.zinfo > $@
# Build bochs symbol table # Build bochs symbol table
@ -359,11 +351,11 @@ $(BIN)/%.bxs : $(BIN)/%.tmp
# much difference to the overall build time. # much difference to the overall build time.
media : media :
@echo $(MEDIA) @$(ECHO) $(MEDIA)
AUTO_MEDIA = $(filter-out $(NON_AUTO_MEDIA),$(MEDIA)) AUTO_MEDIA = $(filter-out $(NON_AUTO_MEDIA),$(MEDIA))
automedia : automedia :
@echo $(AUTO_MEDIA) @$(ECHO) $(AUTO_MEDIA)
# media_template : create Makefile rules for specified media # media_template : create Makefile rules for specified media
# #
@ -372,12 +364,12 @@ automedia :
# #
define media_template define media_template
@echo "Generating Makefile rules for $(1) media" @$(ECHO) "Generating Makefile rules for $(1) media"
@$(MKDIR) -p $(dir $(2)) @$(MKDIR) -p $(dir $(2))
@$(RM) $(2) @$(RM) $(2)
@$(TOUCH) $(2) @$(TOUCH) $(2)
@$(ECHO_E) '$$(BIN)/%.$(1) : $$(BIN)/%.$(1).zbin' \ @$(ECHO) '$$(BIN)/%.$(1) : $$(BIN)/%.$(1).zbin' \
'\n\t$$(QM)echo " [FINISH] $$@"' \ '\n\t$$(QM)$(ECHO) " [FINISH] $$@"' \
'\n\t$$(Q)$$(CP) $$< $$@' \ '\n\t$$(Q)$$(CP) $$< $$@' \
'\n\t$$(Q)$$(FINALISE_$(1))' \ '\n\t$$(Q)$$(FINALISE_$(1))' \
> $(2) > $(2)
@ -389,13 +381,13 @@ endef
$(BIN)/deps/%.media.d : $(MAKEDEPS) $(BIN)/deps/%.media.d : $(MAKEDEPS)
$(if $(filter $(AUTO_MEDIA),$*), \ $(if $(filter $(AUTO_MEDIA),$*), \
$(call media_template,$*,$@), \ $(call media_template,$*,$@), \
@echo 'ERROR: $* is not an AUTO_MEDIA' ; exit 1) @$(ECHO) 'ERROR: $* is not an AUTO_MEDIA' ; exit 1)
# Calculate and include the list of Makefile rules files # Calculate and include the list of Makefile rules files
# #
MEDIA_DEPS = $(patsubst %,$(BIN)/deps/%.media.d,$(AUTO_MEDIA)) MEDIA_DEPS = $(patsubst %,$(BIN)/deps/%.media.d,$(AUTO_MEDIA))
mediadeps : mediadeps :
@echo $(MEDIA_DEPS) @$(ECHO) $(MEDIA_DEPS)
include $(MEDIA_DEPS) include $(MEDIA_DEPS)
# The "allXXXs" targets for each suffix # The "allXXXs" targets for each suffix
@ -412,13 +404,13 @@ $(BIN)/etherboot.% : $(BIN)/gpxe.%
# The compression utilities # The compression utilities
# #
$(NRV2B) : util/nrv2b.c $(MAKEDEPS) $(NRV2B) : util/nrv2b.c $(MAKEDEPS)
$(QM)echo " [HOSTCC] $@" $(QM)$(ECHO) " [HOSTCC] $@"
$(Q)$(HOST_CC) -O2 -DENCODE -DDECODE -DMAIN -DVERBOSE -DNDEBUG \ $(Q)$(HOST_CC) -O2 -DENCODE -DDECODE -DMAIN -DVERBOSE -DNDEBUG \
-DBITSIZE=32 -DENDIAN=0 -o $@ $< -DBITSIZE=32 -DENDIAN=0 -o $@ $<
CLEANUP += $(NRV2B) CLEANUP += $(NRV2B)
$(ZBIN) : util/zbin.c util/nrv2b.c $(MAKEDEPS) $(ZBIN) : util/zbin.c util/nrv2b.c $(MAKEDEPS)
$(QM)echo " [HOSTCC] $@" $(QM)$(ECHO) " [HOSTCC] $@"
$(Q)$(HOST_CC) -O2 -o $@ $< $(Q)$(HOST_CC) -O2 -o $@ $<
CLEANUP += $(ZBIN) CLEANUP += $(ZBIN)
@ -431,10 +423,10 @@ BUILDSERIAL_NOW = config/.buildserial.now
BUILDSERIAL_NEXT = config/.buildserial.next BUILDSERIAL_NEXT = config/.buildserial.next
$(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT) : $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT) :
echo 1 > $@ $(ECHO) 1 > $@
$(BUILDSERIAL_H) : $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT) $(BUILDSERIAL_H) : $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT)
echo '#define BUILD_SERIAL_NUM $(shell cat $<)' > $@ $(ECHO) '#define BUILD_SERIAL_NUM $(shell cat $<)' > $@
ifeq ($(filter bs,$(MAKECMDGOALS)),bs) ifeq ($(filter bs,$(MAKECMDGOALS)),bs)
$(shell diff -q $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT) > /dev/null || \ $(shell diff -q $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT) > /dev/null || \
@ -442,18 +434,18 @@ $(shell diff -q $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT) > /dev/null || \
endif endif
bs : $(BUILDSERIAL_NOW) bs : $(BUILDSERIAL_NOW)
@echo $$(( $(shell cat $<) + 1 )) > $(BUILDSERIAL_NEXT) @$(ECHO) $$(( $(shell cat $<) + 1 )) > $(BUILDSERIAL_NEXT)
@echo "Build serial number is $(shell cat $<)" @$(ECHO) "Build serial number is $(shell cat $<)"
# List of available architectures # List of available architectures
# #
ARCHS = $(filter-out CVS,$(patsubst arch/%,%,$(wildcard arch/*))) ARCHS = $(filter-out CVS,$(patsubst arch/%,%,$(wildcard arch/*)))
archs : archs :
@echo $(ARCHS) @$(ECHO) $(ARCHS)
OTHER_ARCHS = $(filter-out $(ARCH),$(ARCHS)) OTHER_ARCHS = $(filter-out $(ARCH),$(ARCHS))
otherarchs : otherarchs :
@echo $(OTHER_ARCHS) @$(ECHO) $(OTHER_ARCHS)
# Build the TAGS file for emacs # Build the TAGS file for emacs
# #
@ -503,7 +495,7 @@ docview :
@if [ -n "$$BROWSER" ] ; then \ @if [ -n "$$BROWSER" ] ; then \
( $$BROWSER $(BIN)/doc/html/index.html & ) ; \ ( $$BROWSER $(BIN)/doc/html/index.html & ) ; \
else \ else \
echo "Documentation index in $(BIN)/doc/html/index.html" ; \ $(ECHO) "Documentation index in $(BIN)/doc/html/index.html" ; \
fi fi
# Clean-up # Clean-up
@ -517,7 +509,7 @@ veryclean : clean
# Make clean tarballs for release # Make clean tarballs for release
gpxe-tarball : ../VERSION gpxe-tarball : ../VERSION
(echo -n $(VERSION) ''; date -u +'%Y-%m-%d') > ../VERSION ($(ECHO) -n $(VERSION) ''; date -u +'%Y-%m-%d') > ../VERSION
$(RM) -r /tmp/gpxe/gpxe-$(VERSION) $(RM) -r /tmp/gpxe/gpxe-$(VERSION)
mkdir -p /tmp/gpxe/gpxe-$(VERSION) mkdir -p /tmp/gpxe/gpxe-$(VERSION)
cp -rP .. /tmp/gpxe/gpxe-$(VERSION) cp -rP .. /tmp/gpxe/gpxe-$(VERSION)