scc

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

commit aaa9094f0b94bf9f62f7c7c3fa860137830356fa
parent 6b33fc9f83b93dbfb021df836d094f3a1ebe0907
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu, 18 Jan 2024 14:03:58 +0100

make: Export argv[0] as MAKE macro

MAKE macro should point to the make program used to run the
Makefile and the only safe way is to use argv[0].

Diffstat:
Msrc/cmd/make/main.c | 1+
Mtests/make/execute/0015-pflag.sh | 1+
2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/cmd/make/main.c b/src/cmd/make/main.c @@ -307,6 +307,7 @@ main(int argc, char *argv[]) inject(defaults); parsemakeflags(); + setmacro("MAKE", argv[0], NOEXPORT); ++argv; parseargv(&argv, EXPORT); diff --git a/tests/make/execute/0015-pflag.sh b/tests/make/execute/0015-pflag.sh @@ -9,6 +9,7 @@ cat > $tmp2 <<'EOF' FC = fort77 YFLAGS = +MAKE = scc-make ARFLAGS = -rv LDFLAGS = LEX = lex