From 11095a90f120545c915c92b8ebf48f04723d1837 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Mon, 24 Oct 2005 13:01:39 +0000 Subject: Make second expansion optional (partial implementation). I decided this feature was too impacting to make the permanent default behavior. This set of changes makes the default behavior of make the old behavior (no second expansion). If you want second expansion, you must define the .SECONDEXPANSION: special target before the first target that needs it. This set of changes ONLY fixes explicit and static pattern rules to work like this. Implicit rules still have second expansion enabled all the time: I'll work on that next. Note that there is still a backward-incompatibility: now to get the old SysV behavior using $$@ etc. in the prerequisites list you need to set .SECONDEXPANSION: as well. --- tests/scripts/variables/automatic | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests/scripts/variables/automatic') diff --git a/tests/scripts/variables/automatic b/tests/scripts/variables/automatic index 484cd16..dc08bd7 100644 --- a/tests/scripts/variables/automatic +++ b/tests/scripts/variables/automatic @@ -27,7 +27,7 @@ $(dir)/bar.y baz.z : ; touch $@ EOF close(MAKEFILE); -# TEST #1 -- simple test +# TEST #0 -- simple test # ------- # Touch these into the past @@ -46,7 +46,7 @@ touch $dir/foo.x\n"; unlink(qw(foo.x bar.y baz.z)); -# TEST #2 -- test the SysV emulation of $$@ etc. +# TEST #1 -- test the SysV emulation of $$@ etc. # ------- $makefile2 = &get_tmpfile; @@ -54,6 +54,7 @@ $makefile2 = &get_tmpfile; open(MAKEFILE, "> $makefile2"); print MAKEFILE "dir = $dir\n"; print MAKEFILE <<'EOF'; +.SECONDEXPANSION: .SUFFIXES: .DEFAULT: ; @echo '$@' @@ -78,7 +79,7 @@ $answer = ".x\n$dir/x.z.x\nx\n\$@.x\n$dir.x\nx.z.x\n.y\n$dir/y.z.y\n\y\n\$@.y\n$ $answer = "$dir/biz.x\n$dir.x\nbiz.x\n"; &compare_output($answer, &get_logfile(1)); -# TEST #3 -- test for Savannah bug #12320. +# TEST #2 -- test for Savannah bug #12320. # run_make_test(' .SUFFIXES: .b .src -- cgit v1.2.3