File: variables.mk

package info (click to toggle)
android-platform-build-kati 10.0.0%2Br32%2Bgit20220314.09dfa26c4e59-7.1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,628 kB
  • sloc: cpp: 10,340; sh: 1,087; python: 85; makefile: 46
file content (44 lines) | stat: -rw-r--r-- 1,514 bytes parent folder | download | duplicates (2)
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

SET_BEFORE := should_not_appear_in_output_before

# Save .VARIABLES so we can filter out all the built-in stuff later
BEFORE:=$(.VARIABLES)

# Simple variable
ONE := 1

# This is := so $(1) is evaluable right now
EVALUABLE := $(ONE)$(1)

# Deferred execution with $(1), so call it a function
LOOKS_LIKE_A_FUNCTION_1 = $(1)
LOOKS_LIKE_A_FUNCTION_2 = $(ONE)$(1)

# Deferred execution without $(1), so should not be a function
NOT_A_FUNCTION_1 = SIMPLE_TEXT
NOT_A_FUNCTION_2 = $(ONE)

# We can't evaluate it without eval, so we assume that it *is* a function.
THE_EDGE_CASE_1 = $($(ONE))
THE_EDGE_CASE_2 = $($(SET_BEFORE))
THE_EDGE_CASE_3 = asdf$($(SET_BEFORE))
THE_EDGE_CASE_4 = $($(SET_BEFORE))fsda
THE_EDGE_CASE_5 = fdsa$($(SET_BEFORE))fdsa

# This was already set before we saved the snapshot, so it shouldn't
# reappear
SET_BEFORE += should_not_appear_in_output_before

$(info .VARIABLES (from make): $(sort $(filter-out $(BEFORE), $(.VARIABLES))))
$(info .VARIABLES (hard coded): BEFORE EVALUABLE LOOKS_LIKE_A_FUNCTION_1 LOOKS_LIKE_A_FUNCTION_2 NOT_A_FUNCTION_1 NOT_A_FUNCTION_2 ONE THE_EDGE_CASE_1 THE_EDGE_CASE_2 THE_EDGE_CASE_3 THE_EDGE_CASE_4 THE_EDGE_CASE_5)

ifdef KATI
$(info .KATI_SYMBOLS: $(sort $(filter-out $(BEFORE), $(.KATI_SYMBOLS))))
else
# Make doesn't support .VARIABLES so output the expected values manually
# for comparison
$(info .KATI_SYMBOLS: BEFORE EVALUABLE NOT_A_FUNCTION_1 NOT_A_FUNCTION_2 ONE)
endif

# Updating this variable should not cause it to appear
SET_BEFORE += a_new_value