2013-05-13 06:48:04 +00:00
|
|
|
# -*-perl-*-
|
|
|
|
|
|
|
|
$description = "Test proper behavior of GNUMAKEFLAGS";
|
|
|
|
|
|
|
|
# Accept flags from GNUMAKEFLAGS as well as MAKEFLAGS
|
|
|
|
# Results always go in MAKEFLAGS
|
|
|
|
|
2020-04-01 05:58:33 +00:00
|
|
|
$ENV{'GNUMAKEFLAGS'} = '-e -r -R';
|
2013-05-13 06:48:04 +00:00
|
|
|
|
|
|
|
run_make_test(q!
|
|
|
|
all: ; @echo $(MAKEFLAGS)
|
|
|
|
!,
|
2013-05-22 11:51:46 +00:00
|
|
|
'', 'erR');
|
2013-05-13 06:48:04 +00:00
|
|
|
|
|
|
|
# Long arguments mean everything is prefixed with "-"
|
|
|
|
|
2020-04-01 05:58:33 +00:00
|
|
|
$ENV{'GNUMAKEFLAGS'} = '--no-print-directory -e -r -R --trace';
|
2013-05-13 06:48:04 +00:00
|
|
|
|
|
|
|
run_make_test(q!
|
|
|
|
all: ; @echo $(MAKEFLAGS)
|
|
|
|
!,
|
2020-12-05 21:25:12 +00:00
|
|
|
'', "#MAKEFILE#:2: update target 'all' due to: target does not exist
|
2013-09-12 08:07:52 +00:00
|
|
|
echo erR --trace --no-print-directory
|
|
|
|
erR --trace --no-print-directory");
|
2013-05-13 06:48:04 +00:00
|
|
|
|
2013-09-29 17:15:00 +00:00
|
|
|
# Verify that re-exec / recursion doesn't duplicate flags from GNUMAKEFLAGS
|
|
|
|
|
2013-09-30 14:56:20 +00:00
|
|
|
unlink('x.mk');
|
|
|
|
|
2020-04-01 05:58:33 +00:00
|
|
|
$ENV{GNUMAKEFLAGS} = '-Itst/bad';
|
2013-09-29 17:15:00 +00:00
|
|
|
|
|
|
|
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 > $@
|
|
|
|
!,
|
2020-03-30 18:07:10 +00:00
|
|
|
"", "x.mk\nMAKEFLAGS = -Itst/bad\nGNUMAKEFLAGS =\nrecurse\nMAKEFLAGS = -Itst/bad\nGNUMAKEFLAGS =\n#MAKE#[1]: Entering directory '#PWD#'\nall\nMAKEFLAGS = -Itst/bad\nGNUMAKEFLAGS =\n#MAKE#[1]: Leaving directory '#PWD#'\n");
|
2013-09-29 17:15:00 +00:00
|
|
|
|
|
|
|
unlink('x.mk');
|
|
|
|
|
2013-05-13 06:48:04 +00:00
|
|
|
1;
|