scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit aa783d1f4f3828158b8678e2ba327d91aafca816
parent 90b73f22d74ae1c07a10d3cd93ca75f8a91d365b
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:
MMakefile | 2+-
Msrc/cmd/cc/posix/mkconf | 4+---
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\"