File: eval

package info (click to toggle)
make-doc-non-dfsg 4.4.1-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid, trixie
  • size: 9,632 kB
  • sloc: ansic: 31,255; sh: 5,213; perl: 1,612; makefile: 160; lisp: 26; sed: 16
file content (44 lines) | stat: -rw-r--r-- 1,238 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#                                                                    -*-perl-*-

$description = "Test the --eval option.";

$details = "Verify that --eval options take effect,
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\ninfile\nall");

# Make sure that --eval is handled correctly during recursion
run_make_test(undef, ['--no-print-directory', '--eval=$(info eval)', 'recurse'],
              "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!
all: ; @echo $@
-include gen.mk
gen.mk: ; @echo > $@
!,
              ['--eval=$(info eval)'], "eval\neval\nall");

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;