summaryrefslogtreecommitdiffstats
path: root/src/Makefile.housekeeping
diff options
context:
space:
mode:
authorMichael Brown2007-12-08 01:50:57 +0100
committerMichael Brown2007-12-08 01:50:57 +0100
commita8bddfe1537a0a69b7fde557e11ccba625b7bd7d (patch)
treeb22352efc368973cf2c2f13c22d9e8f5f08a1d21 /src/Makefile.housekeeping
parentRemove the (unused) option to override _prefix_link_addr, (diff)
downloadipxe-a8bddfe1537a0a69b7fde557e11ccba625b7bd7d.tar.gz
ipxe-a8bddfe1537a0a69b7fde557e11ccba625b7bd7d.tar.xz
ipxe-a8bddfe1537a0a69b7fde557e11ccba625b7bd7d.zip
Another (hopefully more robust) attempt to find a usable substitute
for "echo -e" on the host system.
Diffstat (limited to 'src/Makefile.housekeeping')
-rw-r--r--src/Makefile.housekeeping35
1 files changed, 28 insertions, 7 deletions
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
index df290b9b..7ffa24ba 100644
--- a/src/Makefile.housekeeping
+++ b/src/Makefile.housekeeping
@@ -7,11 +7,6 @@
#
CLEANUP := $(BIN)/*.* # *.* to avoid catching the "CVS" directory
-# Show what we're using for "echo -e"
-#
-echo :
- @$(ECHO) Using "$(ECHO)" to echo
-
# Version number calculations
#
VERSION_MAJOR = 0
@@ -44,6 +39,32 @@ version :
@$(TOUCH) $@
VERYCLEANUP += .toolcheck
+# Find a usable "echo -e" substitute.
+#
+TAB := $(shell printf "\t")
+ifeq ($(shell echo '\t'),$(TAB))
+ECHO_E ?= echo
+endif
+ifeq ($(shell echo -e '\t'),$(TAB))
+ECHO_E ?= echo -e
+endif
+ifeq ($(shell /bin/echo '\t'),$(TAB))
+ECHO_E ?= /bin/echo
+endif
+ifeq ($(shell /bin/echo -e '\t'),$(TAB))
+ECHO_E ?= /bin/echo -e
+endif
+.echocheck :
+ifdef ECHO_E
+ $(TOUCH) $@
+else
+ @echo "No usable \"echo -e\" substitute found"
+ @exit 1
+endif
+VERYCLEANUP += .echocheck
+echo :
+ @$(ECHO) "Using \"$(ECHO_E)\" for \"echo -e\""
+
# Build verbosity
#
ifeq ($(V),1)
@@ -126,7 +147,7 @@ define obj_template
@$(CPP) $(CFLAGS) $(CFLAGS_$(3)) $(CFLAGS_$(4)) -DOBJECT=$(4) \
-Wno-error -M $(1) -MT "$(4)_DEPS" -MG -MP | \
sed 's/_DEPS\s*:/_DEPS =/' >> $(2)
- @$(ECHO) '\n$$(BIN)/$(4).o : $(1) $$(MAKEDEPS) $$($(4)_DEPS)' \
+ @$(ECHO_E) '\n$$(BIN)/$(4).o : $(1) $$(MAKEDEPS) $$($(4)_DEPS)' \
'\n\t$$(QM)$(ECHO) " [BUILD] $$@"\n' \
'\n\t$$(RULE_$(3))\n' \
'\nBOBJS += $$(BIN)/$(4).o\n' \
@@ -373,7 +394,7 @@ define media_template
@$(MKDIR) -p $(dir $(2))
@$(RM) $(2)
@$(TOUCH) $(2)
- @$(ECHO) '$$(BIN)/%.$(1) : $$(BIN)/%.$(1).zbin' \
+ @$(ECHO_E) '$$(BIN)/%.$(1) : $$(BIN)/%.$(1).zbin' \
'\n\t$$(QM)$(ECHO) " [FINISH] $$@"' \
'\n\t$$(Q)$$(CP) $$< $$@' \
'\n\t$$(Q)$$(FINALISE_$(1))' \