mirror of https://github.com/ipxe/ipxe.git
Another (hopefully more robust) attempt to find a usable substitute
for "echo -e" on the host system.pull/1/head
parent
2c7a9e803c
commit
a8bddfe153
21
src/Makefile
21
src/Makefile
|
@ -1,6 +1,6 @@
|
||||||
# Initialise variables that get added to throughout the various Makefiles
|
# Initialise variables that get added to throughout the various Makefiles
|
||||||
#
|
#
|
||||||
MAKEDEPS := Makefile .toolcheck
|
MAKEDEPS := Makefile .toolcheck .echocheck
|
||||||
SRCDIRS :=
|
SRCDIRS :=
|
||||||
SRCS :=
|
SRCS :=
|
||||||
NON_AUTO_SRCS :=
|
NON_AUTO_SRCS :=
|
||||||
|
@ -9,24 +9,6 @@ ROMS :=
|
||||||
MEDIA :=
|
MEDIA :=
|
||||||
NON_AUTO_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.
|
# Grab the central Config file.
|
||||||
#
|
#
|
||||||
MAKEDEPS += Config
|
MAKEDEPS += Config
|
||||||
|
@ -90,6 +72,7 @@ RM ?= rm -f
|
||||||
TOUCH ?= touch
|
TOUCH ?= touch
|
||||||
MKDIR ?= mkdir
|
MKDIR ?= mkdir
|
||||||
CP ?= cp
|
CP ?= cp
|
||||||
|
ECHO ?= echo
|
||||||
PERL ?= /usr/bin/perl
|
PERL ?= /usr/bin/perl
|
||||||
CC ?= $(CROSS_COMPILE)gcc
|
CC ?= $(CROSS_COMPILE)gcc
|
||||||
AS ?= $(CROSS_COMPILE)as
|
AS ?= $(CROSS_COMPILE)as
|
||||||
|
|
|
@ -7,11 +7,6 @@
|
||||||
#
|
#
|
||||||
CLEANUP := $(BIN)/*.* # *.* to avoid catching the "CVS" directory
|
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 number calculations
|
||||||
#
|
#
|
||||||
VERSION_MAJOR = 0
|
VERSION_MAJOR = 0
|
||||||
|
@ -44,6 +39,32 @@ version :
|
||||||
@$(TOUCH) $@
|
@$(TOUCH) $@
|
||||||
VERYCLEANUP += .toolcheck
|
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
|
# Build verbosity
|
||||||
#
|
#
|
||||||
ifeq ($(V),1)
|
ifeq ($(V),1)
|
||||||
|
@ -126,7 +147,7 @@ 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) '\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$$(QM)$(ECHO) " [BUILD] $$@"\n' \
|
||||||
'\n\t$$(RULE_$(3))\n' \
|
'\n\t$$(RULE_$(3))\n' \
|
||||||
'\nBOBJS += $$(BIN)/$(4).o\n' \
|
'\nBOBJS += $$(BIN)/$(4).o\n' \
|
||||||
|
@ -373,7 +394,7 @@ define media_template
|
||||||
@$(MKDIR) -p $(dir $(2))
|
@$(MKDIR) -p $(dir $(2))
|
||||||
@$(RM) $(2)
|
@$(RM) $(2)
|
||||||
@$(TOUCH) $(2)
|
@$(TOUCH) $(2)
|
||||||
@$(ECHO) '$$(BIN)/%.$(1) : $$(BIN)/%.$(1).zbin' \
|
@$(ECHO_E) '$$(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))' \
|
||||||
|
|
Loading…
Reference in New Issue