|
@@ -41,27 +41,47 @@ VERYCLEANUP += .toolcheck
|
41
|
41
|
|
42
|
42
|
# Find a usable "echo -e" substitute.
|
43
|
43
|
#
|
44
|
|
-TAB := $(shell printf "\t")
|
45
|
|
-ifeq ($(shell echo '\t'),$(TAB))
|
46
|
|
-ECHO_E ?= echo
|
|
44
|
+TAB := $(shell $(PRINTF) '\t')
|
|
45
|
+ECHO_E_ECHO := $(ECHO)
|
|
46
|
+ECHO_E_ECHO_E := $(ECHO) -e
|
|
47
|
+ECHO_E_BIN_ECHO := /bin/echo
|
|
48
|
+ECHO_E_BIN_ECHO_E := /bin/echo -e
|
|
49
|
+ECHO_E_ECHO_TAB := $(shell $(ECHO_E_ECHO) '\t' | cat)
|
|
50
|
+ECHO_E_ECHO_E_TAB := $(shell $(ECHO_E_ECHO_E) '\t' | cat)
|
|
51
|
+ECHO_E_BIN_ECHO_TAB := $(shell $(ECHO_E_BIN_ECHO) '\t')
|
|
52
|
+ECHO_E_BIN_ECHO_E_TAB := $(shell $(ECHO_E_BIN_ECHO_E) '\t')
|
|
53
|
+
|
|
54
|
+ifeq ($(ECHO_E_ECHO_TAB),$(TAB))
|
|
55
|
+ECHO_E ?= $(ECHO_E_ECHO)
|
47
|
56
|
endif
|
48
|
|
-ifeq ($(shell echo -e '\t'),$(TAB))
|
49
|
|
-ECHO_E ?= echo -e
|
|
57
|
+ifeq ($(ECHO_E_ECHO_E_TAB),$(TAB))
|
|
58
|
+ECHO_E ?= $(ECHO_E_ECHO_E)
|
50
|
59
|
endif
|
51
|
|
-ifeq ($(shell /bin/echo '\t'),$(TAB))
|
52
|
|
-ECHO_E ?= /bin/echo
|
|
60
|
+ifeq ($(ECHO_E_BIN_ECHO_TAB),$(TAB))
|
|
61
|
+ECHO_E ?= $(ECHO_E_BIN_ECHO)
|
53
|
62
|
endif
|
54
|
|
-ifeq ($(shell /bin/echo -e '\t'),$(TAB))
|
55
|
|
-ECHO_E ?= /bin/echo -e
|
|
63
|
+ifeq ($(ECHO_E_BIN_ECHO_E_TAB),$(TAB))
|
|
64
|
+ECHO_E ?= $(ECHO_E_BIN_ECHO_E)
|
56
|
65
|
endif
|
|
66
|
+
|
57
|
67
|
.echocheck :
|
58
|
68
|
ifdef ECHO_E
|
59
|
|
- $(TOUCH) $@
|
|
69
|
+ @$(TOUCH) $@
|
60
|
70
|
else
|
61
|
|
- @echo "No usable \"echo -e\" substitute found"
|
|
71
|
+ @$(PRINTF) '%24s : x%sx\n' 'tab' '$(TAB)'
|
|
72
|
+ @$(PRINTF) '%24s : x%sx\n' '"$(ECHO_E_ECHO) \t"' \
|
|
73
|
+ '$(ECHO_E_ECHO_TAB)'
|
|
74
|
+ @$(PRINTF) '%24s : x%sx\n' '"$(ECHO_E_ECHO_E) \t"' \
|
|
75
|
+ '$(ECHO_E_ECHO_E_TAB)'
|
|
76
|
+ @$(PRINTF) '%24s : x%sx\n' '"$(ECHO_E_BIN_ECHO) \t"' \
|
|
77
|
+ '$(ECHO_E_BIN_ECHO_TAB)'
|
|
78
|
+ @$(PRINTF) '%24s : x%sx\n' '"$(ECHO_E_BIN_ECHO_E) \t"' \
|
|
79
|
+ '$(ECHO_E_BIN_ECHO_E_TAB)'
|
|
80
|
+ @$(ECHO) "No usable \"echo -e\" substitute found"
|
62
|
81
|
@exit 1
|
63
|
82
|
endif
|
64
|
83
|
VERYCLEANUP += .echocheck
|
|
84
|
+
|
65
|
85
|
echo :
|
66
|
86
|
@$(ECHO) "Using \"$(ECHO_E)\" for \"echo -e\""
|
67
|
87
|
|