mirror of
https://salsa.debian.org/srivasta/make-dfsg.git
synced 2025-01-05 21:00:35 +00:00
543521cd47
If we don't do this we'll continually add flags on recursion. This is mainly for users to set in their environment before invoking make.
40 lines
1.3 KiB
Perl
40 lines
1.3 KiB
Perl
# -*-perl-*-
|
|
|
|
$description = "Test proper behavior of GNUMAKEFLAGS";
|
|
|
|
# Accept flags from GNUMAKEFLAGS as well as MAKEFLAGS
|
|
# Results always go in MAKEFLAGS
|
|
|
|
$extraENV{'GNUMAKEFLAGS'} = '-e -r -R';
|
|
|
|
run_make_test(q!
|
|
all: ; @echo $(MAKEFLAGS)
|
|
!,
|
|
'', 'erR');
|
|
|
|
# Long arguments mean everything is prefixed with "-"
|
|
|
|
$extraENV{'GNUMAKEFLAGS'} = '--no-print-directory -e -r -R --trace';
|
|
|
|
run_make_test(q!
|
|
all: ; @echo $(MAKEFLAGS)
|
|
!,
|
|
'', "#MAKEFILE#:2: target 'all' does not exist
|
|
echo erR --trace --no-print-directory
|
|
erR --trace --no-print-directory");
|
|
|
|
# Verify that re-exec / recursion doesn't duplicate flags from GNUMAKEFLAGS
|
|
|
|
$extraENV{GNUMAKEFLAGS} = '-I/tmp -Oline';
|
|
|
|
run_make_test(q!
|
|
recurse: ; @echo $@; echo MAKEFLAGS = $$MAKEFLAGS; echo GNUMAKEFLAGS = $$GNUMAKEFLAGS; #MAKEPATH# -f #MAKEFILE# all
|
|
all: ; @echo $@; echo MAKEFLAGS = $$MAKEFLAGS; echo GNUMAKEFLAGS = $$GNUMAKEFLAGS
|
|
-include x.mk
|
|
x.mk: ; @echo $@; echo MAKEFLAGS = $$MAKEFLAGS; echo GNUMAKEFLAGS = $$GNUMAKEFLAGS; echo > $@
|
|
!,
|
|
"", "x.mk\nMAKEFLAGS = -I/tmp -Oline\nGNUMAKEFLAGS =\nrecurse\nMAKEFLAGS = -I/tmp -Oline\nGNUMAKEFLAGS =\n#MAKE#[1]: Entering directory '#PWD#'\nall\nMAKEFLAGS = w -I/tmp -Oline\nGNUMAKEFLAGS =\n#MAKE#[1]: Leaving directory '#PWD#'\n");
|
|
|
|
unlink('x.mk');
|
|
|
|
1;
|