Martin Roth | 9231f0b | 2022-10-28 22:39:23 -0600 | [diff] [blame] | 1 | ## SPDX-License-Identifier: GPL-2.0-only |
Furquan Shaikh | 6ef863c | 2021-10-01 11:39:48 -0700 | [diff] [blame] | 2 | ifeq ($(CONFIG_STITCH_ME_BIN),y) |
| 3 | |
| 4 | objcse := $(obj)/cse |
| 5 | additional-dirs += $(objcse) |
| 6 | |
| 7 | define cse_input_path |
| 8 | $(call strip_quotes,$(CONFIG_CSE_COMPONENTS_PATH))/$(call strip_quotes,$(1)) |
| 9 | endef |
| 10 | |
| 11 | define cse_add_dummy |
| 12 | $(eval cse_$(1)_ingredients+=$(2)) |
| 13 | endef |
| 14 | |
| 15 | define cse_add_dummy_to_bp1_bp2 |
| 16 | $(call cse_add_dummy,bp1,$(1)) |
| 17 | $(call cse_add_dummy,bp2,$(1)) |
| 18 | endef |
| 19 | |
| 20 | define 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))) |
| 25 | endef |
| 26 | |
| 27 | define cse_add_decomp |
| 28 | $(call cse_add_file,cse_decomp_files,$(objcse)/$(2),$(1),$(2)) |
| 29 | endef |
| 30 | |
| 31 | define cse_add_decomp_to_bp1_bp2 |
| 32 | $(call cse_add_decomp,bp1,$(1)) |
| 33 | $(call cse_add_decomp,bp2,$(1)) |
| 34 | endef |
| 35 | |
Reka Norman | c377345 | 2023-09-21 13:36:05 +1000 | [diff] [blame] | 36 | # (Comment to help with greping for uses) |
| 37 | # |
| 38 | # This uses the following Kconfigs: |
| 39 | # CSE_PMCP_FILE |
| 40 | # CSE_IOMP_FILE |
| 41 | # CSE_TBTP_FILE |
| 42 | # CSE_NPHY_FILE |
| 43 | # CSE_PCHC_FILE |
| 44 | # CSE_IUNP_FILE |
| 45 | # CSE_OEMP_FILE |
| 46 | # |
| 47 | # For example `$(call cse_add_input_to_bp1_bp2,PMCP)` will process CONFIG_CSE_PMCP_FILE |
Furquan Shaikh | 6ef863c | 2021-10-01 11:39:48 -0700 | [diff] [blame] | 48 | define cse_add_input |
| 49 | $(call cse_add_file,cse_input_files,$(call cse_input_path,$(CONFIG_CSE_$(2)_FILE)),$(1),$(2)) |
| 50 | endef |
| 51 | |
| 52 | define cse_add_input_to_bp1_bp2 |
| 53 | $(call cse_add_input,bp1,$(1)) |
| 54 | $(call cse_add_input,bp2,$(1)) |
| 55 | endef |
| 56 | |
| 57 | endif |