1999-09-14 02:03:19 +00:00
|
|
|
# -*-perl-*-
|
2005-02-10 00:10:57 +00:00
|
|
|
$description = "Test recursion.";
|
1999-09-14 02:03:19 +00:00
|
|
|
|
|
|
|
$details = "DETAILS";
|
|
|
|
|
2005-02-10 00:10:57 +00:00
|
|
|
# Test some basic recursion.
|
|
|
|
run_make_test('
|
2019-05-19 16:16:14 +00:00
|
|
|
.RECIPEPREFIX := |
|
2005-02-10 00:10:57 +00:00
|
|
|
all:
|
2019-05-19 16:16:14 +00:00
|
|
|
| $(MAKE) -f #MAKEFILE# foo
|
2005-02-10 00:10:57 +00:00
|
|
|
foo:
|
2019-05-19 16:16:14 +00:00
|
|
|
| @echo $(MAKE)
|
|
|
|
| @echo MAKELEVEL = $(MAKELEVEL)
|
|
|
|
| $(MAKE) -f #MAKEFILE# last
|
2005-02-10 00:10:57 +00:00
|
|
|
last:
|
2019-05-19 16:16:14 +00:00
|
|
|
| @echo $(MAKE)
|
|
|
|
| @echo MAKELEVEL = $(MAKELEVEL)
|
|
|
|
| @echo THE END
|
2005-02-10 00:10:57 +00:00
|
|
|
',
|
2010-07-01 07:16:00 +00:00
|
|
|
('CFLAGS=-O -w' . ($parallel_jobs ? ' -j 2' : '')),
|
2005-02-10 00:10:57 +00:00
|
|
|
($vos
|
2012-03-04 00:24:20 +00:00
|
|
|
? "#MAKE#: Entering directory '#PWD#'
|
2005-02-10 00:10:57 +00:00
|
|
|
make 'CFLAGS=-O' -f #MAKEFILE# foo
|
|
|
|
make CFLAGS=-O
|
|
|
|
MAKELEVEL = 0
|
|
|
|
make 'CFLAGS=-O' -f #MAKEFILE# last
|
|
|
|
make CFLAGS=-O
|
|
|
|
MAKELEVEL = 0
|
|
|
|
THE END
|
2012-03-04 00:24:20 +00:00
|
|
|
#MAKE#: Leaving directory '#PWD#'"
|
|
|
|
: "#MAKE#: Entering directory '#PWD#'
|
2005-02-10 00:10:57 +00:00
|
|
|
#MAKEPATH# -f #MAKEFILE# foo
|
2012-03-04 00:24:20 +00:00
|
|
|
#MAKE#[1]: Entering directory '#PWD#'
|
2005-02-10 00:10:57 +00:00
|
|
|
#MAKEPATH#
|
|
|
|
MAKELEVEL = 1
|
|
|
|
#MAKEPATH# -f #MAKEFILE# last
|
2012-03-04 00:24:20 +00:00
|
|
|
#MAKE#[2]: Entering directory '#PWD#'
|
2005-02-10 00:10:57 +00:00
|
|
|
#MAKEPATH#
|
|
|
|
MAKELEVEL = 2
|
|
|
|
THE END
|
2012-03-04 00:24:20 +00:00
|
|
|
#MAKE#[2]: Leaving directory '#PWD#'
|
|
|
|
#MAKE#[1]: Leaving directory '#PWD#'
|
|
|
|
#MAKE#: Leaving directory '#PWD#'"));
|
2005-02-10 00:10:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Test command line overrides.
|
|
|
|
run_make_test('
|
|
|
|
recur: all ; @$(MAKE) --no-print-directory -f #MAKEFILE# a=AA all
|
|
|
|
all: ; @echo "MAKEOVERRIDES = $(MAKEOVERRIDES)"
|
|
|
|
',
|
|
|
|
'a=ZZ',
|
|
|
|
'MAKEOVERRIDES = a=ZZ
|
|
|
|
MAKEOVERRIDES = a=AA
|
|
|
|
');
|
1999-09-14 02:03:19 +00:00
|
|
|
|
2019-05-19 16:16:14 +00:00
|
|
|
# SV 46013: Ensure that MAKEOVERRIDES is passed even if set in the makefile
|
|
|
|
run_make_test(q!
|
|
|
|
ifeq ($(MAKELEVEL),0)
|
|
|
|
MAKEOVERRIDES += FOO+=bar
|
|
|
|
endif
|
|
|
|
.PHONY: M R
|
|
|
|
M: ; @$(MAKE) --no-print-directory -f #MAKEFILE# R
|
|
|
|
R: ; @echo '$(FOO)'
|
|
|
|
!,
|
|
|
|
'', 'bar');
|
|
|
|
|
1999-09-14 02:03:19 +00:00
|
|
|
1;
|