commit 0e027fffa4904f7d186948f5a39ba9cc82c1977f
parent 0ed3dcecf30d55c64e5e9650e22553a7714e6ddb
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Wed, 6 Oct 2021 20:34:57 +0200
driver: Populate PREFIX in Makefiles
PREFIX is a variable in the top Makefile and it was not
propagated to the recursive Makefiles. Setting PREFIX
like an environment variable of the first Makefile
called makes it visible to all the other Makefiles.
Diffstat:
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
@@ -14,7 +14,7 @@ PREFIX= /usr/local
NODEP = 1
all:
- +@$(MAKE) `$(SCRIPTDIR)/config` toolchain
+ +@PREFIX=$(PREFIX) $(MAKE) `$(SCRIPTDIR)/config` toolchain
+@$(MAKE) `$(SCRIPTDIR)/config` `uname -m`
x86_64 amd64: FORCE
diff --git a/src/cmd/cc/posix/mkconf b/src/cmd/cc/posix/mkconf
@@ -5,11 +5,9 @@ set -e
rm -f config.h
trap "rm -f $$.h" 0 2 3
-PREFIX=${PREFIX-$HOME}
-
echo $@ |
(IFS='- ' read arch abi sys format r
-echo \#define PREFIX \"$PREFIX\"
+echo \#define PREFIX \"${PREFIX-$HOME}\"
echo \#define ARCH \"$arch\"
echo \#define SYS \"$sys\"
echo \#define ABI \"$abi\"