mirror of
https://github.com/mirror/make.git
synced 2026-08-31 11:48:08 +08:00
* main.c (switches): Add -E as an alias for --eval.
* make.1: Document the -E and --eval options. * doc/make.texi: Document the -E option. * tests/scripts/options/eval: Test the -E option and MAKEFILES. * NEWS: Add information about the new option.
This commit is contained in:
@@ -7,14 +7,22 @@ and are passed to sub-makes.";
|
||||
|
||||
# Verify that --eval is evaluated first
|
||||
run_make_test(q!
|
||||
$(info infile)
|
||||
BAR = bar
|
||||
all: ; @echo all
|
||||
recurse: ; @$(MAKE) -f #MAKEFILE# && echo recurse!,
|
||||
'--eval=\$\(info\ eval\) FOO=\$\(BAR\)', "eval\nall");
|
||||
'--eval=\$\(info\ eval\) FOO=\$\(BAR\)', "eval\ninfile\nall");
|
||||
|
||||
# Make sure that --eval is handled correctly during recursion
|
||||
run_make_test(undef, '--no-print-directory --eval=\$\(info\ eval\) recurse',
|
||||
"eval\neval\nall\nrecurse");
|
||||
"eval\ninfile\neval\ninfile\nall\nrecurse");
|
||||
|
||||
# Make sure that --eval is not passed in MAKEFLAGS
|
||||
run_make_test(q!
|
||||
all: ; @echo "MAKEFLAGS=$$MAKEFLAGS"
|
||||
!,
|
||||
'--eval=\$\(info\ eval\)',
|
||||
"eval\n".'MAKEFLAGS= --eval=$$(info\ eval)');
|
||||
|
||||
# Make sure that --eval is handled correctly during restarting
|
||||
run_make_test(q!
|
||||
@@ -26,4 +34,11 @@ gen.mk: ; @echo > $@
|
||||
|
||||
unlink('gen.mk');
|
||||
|
||||
# Check -E
|
||||
run_make_test(q!
|
||||
BAR = bar
|
||||
all: ; @echo all
|
||||
recurse: ; @$(MAKE) -f #MAKEFILE# && echo recurse!,
|
||||
'-E \$\(info\ eval\) FOO=\$\(BAR\)', "eval\nall");
|
||||
|
||||
1;
|
||||
|
||||
Reference in New Issue
Block a user