Shinichiro Hamaji | 497754d | 2015-03-31 02:02:11 +0900 | [diff] [blame] | 1 | VAR=var |
2 | VARREF=VAR | ||||
3 | EMPTY= | ||||
4 | UNDEFREF=UNDEFINED | ||||
5 | |||||
6 | RESULT= | ||||
7 | |||||
8 | ifdef VAR | ||||
9 | RESULT += PASS | ||||
10 | endif | ||||
11 | |||||
12 | ifdef VAR | ||||
13 | RESULT += PASS | ||||
14 | else | ||||
15 | RESULT += FAIL | ||||
16 | endif | ||||
17 | ifdef $(VARREF) | ||||
18 | RESULT += PASS | ||||
19 | else | ||||
20 | RESULT += FAIL | ||||
21 | endif | ||||
22 | ifdef UNDEFINED | ||||
23 | RESULT += FAIL | ||||
24 | else | ||||
25 | RESULT += PASS | ||||
26 | endif | ||||
27 | ifdef $(UNDEFREF) | ||||
28 | RESULT += FAIL | ||||
29 | else | ||||
30 | RESULT += PASS | ||||
31 | endif | ||||
32 | ifdef EMPTY | ||||
33 | RESULT += FAIL | ||||
34 | else | ||||
35 | RESULT += PASS | ||||
36 | endif | ||||
37 | |||||
38 | ifndef VAR | ||||
39 | RESULT += FAIL | ||||
40 | else | ||||
41 | RESULT += PASS | ||||
42 | endif | ||||
43 | ifndef $(VARREF) | ||||
44 | RESULT += FAIL | ||||
45 | else | ||||
46 | RESULT += PASS | ||||
47 | endif | ||||
48 | ifndef UNDEFINED | ||||
49 | RESULT += PASS | ||||
50 | else | ||||
51 | RESULT += FAIL | ||||
52 | endif | ||||
53 | ifndef $(UNDEFREF) | ||||
54 | RESULT += PASS | ||||
55 | else | ||||
56 | RESULT += FAIL | ||||
57 | endif | ||||
58 | |||||
Shinichiro Hamaji | af1e816 | 2015-03-31 02:15:37 +0900 | [diff] [blame] | 59 | ifeq ($(VAR),var) |
60 | RESULT += PASS | ||||
61 | else | ||||
62 | RESULT += FAIL | ||||
63 | endif | ||||
64 | ifneq ($(VAR),var) | ||||
65 | RESULT += FAIL | ||||
66 | else | ||||
67 | RESULT += PASS | ||||
68 | endif | ||||
Shinichiro Hamaji | 497754d | 2015-03-31 02:02:11 +0900 | [diff] [blame] | 69 | |
Shinichiro Hamaji | af1e816 | 2015-03-31 02:15:37 +0900 | [diff] [blame] | 70 | ifeq ($(UNDEFINED),) |
71 | RESULT += PASS | ||||
72 | else | ||||
73 | RESULT += FAIL | ||||
74 | endif | ||||
75 | ifeq (,$(UNDEFINED)) | ||||
76 | RESULT += PASS | ||||
77 | else | ||||
78 | RESULT += FAIL | ||||
79 | endif | ||||
Shinichiro Hamaji | 497754d | 2015-03-31 02:02:11 +0900 | [diff] [blame] | 80 | |
81 | # TODO: Support? | ||||
82 | # ifeq "$(VAR)" "var" | ||||
83 | # RESULT += PASS | ||||
84 | # else | ||||
85 | # RESULT += FAIL | ||||
86 | # endif | ||||
87 | |||||
88 | test: | ||||
89 | echo $(RESULT) |