File: varnesting

package info (click to toggle)
make-doc-non-dfsg 4.0-2
  • links: PTS, VCS
  • area: non-free
  • in suites: jessie, jessie-kfreebsd
  • size: 7,460 kB
  • ctags: 2,038
  • sloc: ansic: 26,371; sh: 4,962; perl: 1,135; makefile: 168; lisp: 26; sed: 16
file content (35 lines) | stat: -rw-r--r-- 629 bytes parent folder | download | duplicates (19)
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
#                                                                    -*-perl-*-
$description = "Test recursive variables";

$details = "";

run_make_test('
x = variable1
variable2 := Hello
y = $(subst 1,2,$(x))
z = y
a := $($($(z)))
all: 
	@echo $(a)
',
              '', "Hello\n");

# This tests resetting the value of a variable while expanding it.
# You may only see problems with this if you're using valgrind or
# some other memory checker that poisons freed memory.
# See Savannah patch #7534

run_make_test('
VARIABLE = $(eval VARIABLE := echo hi)$(VARIABLE)
wololo:
	@$(VARIABLE)
',
              '', "hi\n");

1;