|
1 define COMMANDS |
|
2 shellvar=hello |
|
3 test "$$shellvar" != "hello" |
|
4 endef |
|
5 |
|
6 define COMMANDS2 |
|
7 shellvar=hello; \ |
|
8 test "$$shellvar" = "hello" |
|
9 endef |
|
10 |
|
11 define VARWITHCOMMENT # comment |
|
12 value |
|
13 endef |
|
14 |
|
15 define TEST3 |
|
16 whitespace |
|
17 endef |
|
18 |
|
19 define TEST4 |
|
20 define TEST5 |
|
21 random |
|
22 endef |
|
23 endef |
|
24 |
|
25 ifdef TEST5 |
|
26 $(error TEST5 should not be set) |
|
27 endif |
|
28 |
|
29 define TEST6 |
|
30 define TEST7 |
|
31 random |
|
32 endef |
|
33 endef |
|
34 |
|
35 ifdef TEST7 |
|
36 $(error TEST7 should not be set) |
|
37 endif |
|
38 |
|
39 define TEST8 |
|
40 is this # a comment? |
|
41 endef |
|
42 |
|
43 ifneq ($(TEST8),is this \# a comment?) |
|
44 $(error TEST8 value not expected: $(TEST8)) |
|
45 endif |
|
46 |
|
47 # A backslash continuation "hides" the endef |
|
48 define TEST9 |
|
49 value \ |
|
50 endef |
|
51 endef |
|
52 |
|
53 # Test ridiculous spacing |
|
54 define TEST10 |
|
55 define TEST11 |
|
56 baz |
|
57 endef |
|
58 define TEST12 |
|
59 foo |
|
60 endef |
|
61 endef |
|
62 |
|
63 all: |
|
64 $(COMMANDS) |
|
65 $(COMMANDS2) |
|
66 test '$(VARWITHCOMMENT)' = 'value' |
|
67 test '$(COMMANDS2)' = 'shellvar=hello; test "$$shellvar" = "hello"' |
|
68 test "$(TEST3)" = " whitespace" |
|
69 @echo TEST-PASS |