Browse Source

Try to fix echo-detection to work on all systems that provide any

suitable "echo -e" substitute.
tags/v0.9.3
Michael Brown 17 years ago
parent
commit
3b58fc0baf
2 changed files with 17 additions and 1 deletions
  1. 12
    1
      src/Makefile
  2. 5
    0
      src/Makefile.housekeeping

+ 12
- 1
src/Makefile View File

@@ -9,6 +9,18 @@ ROMS		:=
9 9
 MEDIA		:=
10 10
 NON_AUTO_MEDIA	:=
11 11
 
12
+# Find a usable "echo -e".
13
+#
14
+ifeq ($(shell echo '\0101'),A)
15
+ECHO		:= echo
16
+else ifeq ($(shell echo -e '\0101'),A)
17
+ECHO		:= echo -e
18
+else ifeq ($(shell /bin/echo '\0101'),A)
19
+ECHO		:= /bin/echo
20
+else ifeq ($(shell /bin/echo -e '\0101'),A)
21
+ECHO		:= /bin/echo -e
22
+endif
23
+
12 24
 # Grab the central Config file.
13 25
 #
14 26
 MAKEDEPS	+= Config
@@ -66,7 +78,6 @@ noargs : blib $(BIN)/NIC $(BIN)/gpxe.dsk $(BIN)/gpxe.iso $(BIN)/gpxe.usb
66 78
 
67 79
 # Locations of utilities
68 80
 #
69
-ECHO		?= /bin/echo -e
70 81
 HOST_CC		?= gcc
71 82
 CPP		?= gcc -E -Wp,-Wall
72 83
 RM		?= rm -f

+ 5
- 0
src/Makefile.housekeeping View File

@@ -7,6 +7,11 @@
7 7
 #
8 8
 CLEANUP	:= $(BIN)/*.* # *.* to avoid catching the "CVS" directory
9 9
 
10
+# Show what we're using for "echo -e"
11
+#
12
+echo :
13
+	@$(ECHO) Using "$(ECHO)" to echo
14
+
10 15
 # Version number calculations 
11 16
 #
12 17
 VERSION_MAJOR	= 0

Loading…
Cancel
Save