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 | |
parent | 2c7a9e803c4bf8346911adcc6c05c714e2f22c4f (diff) | |
download | ipxe-a8bddfe1537a0a69b7fde557e11ccba625b7bd7d.tar.gz |
Another (hopefully more robust) attempt to find a usable substitute
for "echo -e" on the host system.
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 21 | ||||
-rw-r--r-- | src/Makefile.housekeeping | 35 |
2 files changed, 30 insertions, 26 deletions
diff --git a/src/Makefile b/src/Makefile index add47abe..a65ce2bc 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,6 +1,6 @@ # Initialise variables that get added to throughout the various Makefiles # -MAKEDEPS := Makefile .toolcheck +MAKEDEPS := Makefile .toolcheck .echocheck SRCDIRS := SRCS := NON_AUTO_SRCS := @@ -9,24 +9,6 @@ ROMS := MEDIA := NON_AUTO_MEDIA := -# Find a usable "echo -e" substitute. -# -ifeq ($(shell echo '\101'),A) -ECHO ?= echo -endif -ifeq ($(shell echo -e '\101'),A) -ECHO ?= echo -e -endif -ifeq ($(shell /bin/echo '\101'),A) -ECHO ?= /bin/echo -endif -ifeq ($(shell /bin/echo -e '\101'),A) -ECHO ?= /bin/echo -e -endif -ifndef ECHO -ECHO := echo -endif - # Grab the central Config file. # MAKEDEPS += Config @@ -90,6 +72,7 @@ RM ?= rm -f TOUCH ?= touch MKDIR ?= mkdir CP ?= cp +ECHO ?= echo PERL ?= /usr/bin/perl CC ?= $(CROSS_COMPILE)gcc AS ?= $(CROSS_COMPILE)as 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))' \ |