diff options
author | Michael Brown <mcb30@etherboot.org> | 2007-12-08 00:50:57 +0000 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2007-12-08 00:50:57 +0000 |
commit | a8bddfe1537a0a69b7fde557e11ccba625b7bd7d (patch) | |
tree | b22352efc368973cf2c2f13c22d9e8f5f08a1d21 /src/Makefile.housekeeping | |
parent | 2c7a9e803c4bf8346911adcc6c05c714e2f22c4f (diff) | |
download | ipxe-a8bddfe1537a0a69b7fde557e11ccba625b7bd7d.zip ipxe-a8bddfe1537a0a69b7fde557e11ccba625b7bd7d.tar.gz ipxe-a8bddfe1537a0a69b7fde557e11ccba625b7bd7d.tar.bz2 |
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.housekeeping | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping index df290b9..7ffa24b 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))' \ |