blob: 9a7ad7499e7e4cf87b806e0ef4f2e2e5b97f30d2 [file] [log] [blame]
Martin Roth9231f0b2022-10-28 22:39:23 -06001## SPDX-License-Identifier: GPL-2.0-only
Furquan Shaikh6ef863c2021-10-01 11:39:48 -07002ifeq ($(CONFIG_STITCH_ME_BIN),y)
3
4objcse := $(obj)/cse
5additional-dirs += $(objcse)
6
7define cse_input_path
8$(call strip_quotes,$(CONFIG_CSE_COMPONENTS_PATH))/$(call strip_quotes,$(1))
9endef
10
11define cse_add_dummy
12$(eval cse_$(1)_ingredients+=$(2))
13endef
14
15define cse_add_dummy_to_bp1_bp2
16$(call cse_add_dummy,bp1,$(1))
17$(call cse_add_dummy,bp2,$(1))
18endef
19
20define cse_add_file
21$(eval cse_$(3)_ingredients+=$(4))
22$(eval file=$(2))
23$(eval $(4)-file=$(file))
24$(eval $(1)+=$(if $(filter $(file),$($(1))),,$(file)))
25endef
26
27define cse_add_decomp
28$(call cse_add_file,cse_decomp_files,$(objcse)/$(2),$(1),$(2))
29endef
30
31define cse_add_decomp_to_bp1_bp2
32$(call cse_add_decomp,bp1,$(1))
33$(call cse_add_decomp,bp2,$(1))
34endef
35
36define cse_add_input
37$(call cse_add_file,cse_input_files,$(call cse_input_path,$(CONFIG_CSE_$(2)_FILE)),$(1),$(2))
38endef
39
40define cse_add_input_to_bp1_bp2
41$(call cse_add_input,bp1,$(1))
42$(call cse_add_input,bp2,$(1))
43endef
44
45endif