shithub: scc

Download patch

ref: aa783d1f4f3828158b8678e2ba327d91aafca816
parent: 90b73f22d74ae1c07a10d3cd93ca75f8a91d365b
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Wed Oct 6 16:34:57 EDT 2021

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.

--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@
 NODEP = 1
 
 all:
-	+@$(MAKE) `$(SCRIPTDIR)/config` toolchain
+	+@PREFIX=$(PREFIX) $(MAKE) `$(SCRIPTDIR)/config` toolchain
 	+@$(MAKE) `$(SCRIPTDIR)/config` `uname -m`
 
 x86_64 amd64: FORCE
--- a/src/cmd/cc/posix/mkconf
+++ b/src/cmd/cc/posix/mkconf
@@ -5,11 +5,9 @@
 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\"