commit 2a970ec6fe58cc4b033af6e8d2fb5ffe9ee57f7b
parent 094d960dbfe06abd87c1b48b61851d86a0738767
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Thu, 9 Jan 2025 11:57:58 +0100
make: Exit after printing rules with -p
It does not make sense to process any target when the output
is filled with debug information. This change makes the
behaviour more similar to the one found in GNU make.
Diffstat:
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/cmd/scc-make/main.c b/src/cmd/scc-make/main.c
@@ -355,6 +355,7 @@ main(int argc, char *argv[])
if (pflag) {
dumpmacros();
dumprules();
+ exit(EXIT_SUCCESS);
}
if (!*targets) {
diff --git a/tests/make/execute/0015-pflag.sh b/tests/make/execute/0015-pflag.sh
@@ -65,6 +65,7 @@ FFLAGS = -O 1
.SUFFIXES: .o .c .y .l .a .sh .f
all:
+ @echo hello
.sh:
cp $< $@
@@ -72,8 +73,9 @@ all:
EOF
-(scc make -pf - | grep -v MAKE > $tmp1 2>&1) <<'EOF'
+(scc make -pf - all | grep -v MAKE > $tmp1 2>&1) <<'EOF'
all:
+ @echo hello
EOF
diff -u $tmp1 $tmp2