1A := test
2$(KATI_deprecated_var A B C D)
3
4$(info Writing to an undefined deprecated variable)
5B := test
6ifndef KATI
7$(info Makefile:5: B has been deprecated.)
8endif
9
10$(info Reading from deprecated variables - set before/after/never the deprecation func)
11$(info Writing to an undefined deprecated variable)
12D := $(A)$(B)$(C)
13ifndef KATI
14$(info Makefile:12: A has been deprecated.)
15$(info Makefile:12: B has been deprecated.)
16$(info Makefile:12: C has been deprecated.)
17$(info Makefile:12: D has been deprecated.)
18endif
19
20$(info Writing to a reset deprecated variable)
21D += test
22ifndef KATI
23$(info Makefile:21: D has been deprecated.)
24endif
25
26$(info Using a custom message)
27$(KATI_deprecated_var E,Use X instead)
28E = $(C)
29ifndef KATI
30$(info Makefile:28: E has been deprecated. Use X instead.)
31endif
32
33$(info Expanding a recursive variable with an embedded deprecated variable)
34$(E)
35ifndef KATI
36$(info Makefile:34: E has been deprecated. Use X instead.)
37$(info Makefile:34: C has been deprecated.)
38endif
39
40$(info All of the previous variable references have been basic SymRefs, now check VarRefs)
41F = E
42G := $($(F))
43ifndef KATI
44$(info Makefile:42: E has been deprecated. Use X instead.)
45$(info Makefile:42: C has been deprecated.)
46endif
47
48$(info And check VarSubst)
49G := $(C:%.o=%.c)
50ifndef KATI
51$(info Makefile:49: C has been deprecated.)
52endif
53
54$(info Deprecated variable used in a rule-specific variable)
55test: A := $(E)
56ifndef KATI
57$(info Makefile:55: E has been deprecated. Use X instead.)
58$(info Makefile:55: C has been deprecated.)
59# A hides the global A variable, so is not considered deprecated.
60endif
61
62$(info Deprecated variable used as a macro)
63A := $(call B)
64ifndef KATI
65$(info Makefile:63: B has been deprecated.)
66$(info Makefile:63: A has been deprecated.)
67endif
68
69$(info Deprecated variable used in an ifdef)
70ifdef C
71endif
72ifndef KATI
73$(info Makefile:70: C has been deprecated.)
74endif
75
76$(info Deprecated variable used in a rule)
77test:
78 echo $(C)Done
79ifndef KATI
80$(info Makefile:78: C has been deprecated.)
81endif