diff options
author | Chris Kay <chris.kay@arm.com> | 2023-03-22 15:42:32 +0000 |
---|---|---|
committer | Chris Kay <chris.kay@arm.com> | 2023-05-03 15:36:08 +0200 |
commit | a123cb143ffa0c4ada46e05f85cbd42bd1bf7c6c (patch) | |
tree | 36e6c89b2c5b25d5876be3e965fc39cf33382b23 | |
parent | f50107d3df52204af137c8e6e1eb9b768ab34da9 (diff) | |
download | trusted-firmware-a-a123cb143ffa0c4ada46e05f85cbd42bd1bf7c6c.tar.gz |
build: allow BL-specific includes/definitions
This change introduces the `BLx_INCLUDE_DIRS` and `BLx_DEFINES`
Makefile variables, which can be used to append include directories
and preprocessor definitions to specific images created using the
`MAKE_BL` Makefile macro.
Change-Id: I9431f9d1cbde5b0b2624d9ce128a4f043c74c87f
Signed-off-by: Chris Kay <chris.kay@arm.com>
-rw-r--r-- | make_helpers/build_macros.mk | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk index 9ca6bdf0c..0c82a715a 100644 --- a/make_helpers/build_macros.mk +++ b/make_helpers/build_macros.mk @@ -326,7 +326,10 @@ define MAKE_C $(eval OBJ := $(1)/$(patsubst %.c,%.o,$(notdir $(2)))) $(eval DEP := $(patsubst %.o,%.d,$(OBJ))) -$(eval BL_CPPFLAGS := $($(call uppercase,$(3))_CPPFLAGS) -DIMAGE_$(call uppercase,$(3))) + +$(eval BL_DEFINES := $($(call uppercase,$(3))_DEFINES)) +$(eval BL_INCLUDE_DIRS := $($(call uppercase,$(3))_INCLUDE_DIRS)) +$(eval BL_CPPFLAGS := $($(call uppercase,$(3))_CPPFLAGS) -DIMAGE_$(call uppercase,$(3)) $(addprefix -D,$(BL_DEFINES)) $(addprefix -I,$(BL_INCLUDE_DIRS))) $(eval BL_CFLAGS := $($(call uppercase,$(3))_CFLAGS)) $(OBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | $(3)_dirs @@ -346,7 +349,10 @@ define MAKE_S $(eval OBJ := $(1)/$(patsubst %.S,%.o,$(notdir $(2)))) $(eval DEP := $(patsubst %.o,%.d,$(OBJ))) -$(eval BL_CPPFLAGS := $($(call uppercase,$(3))_CPPFLAGS) -DIMAGE_$(call uppercase,$(3))) + +$(eval BL_DEFINES := $($(call uppercase,$(3))_DEFINES)) +$(eval BL_INCLUDE_DIRS := $($(call uppercase,$(3))_INCLUDE_DIRS)) +$(eval BL_CPPFLAGS := $($(call uppercase,$(3))_CPPFLAGS) -DIMAGE_$(call uppercase,$(3)) $(addprefix -D,$(BL_DEFINES)) $(addprefix -I,$(BL_INCLUDE_DIRS))) $(eval BL_ASFLAGS := $($(call uppercase,$(3))_ASFLAGS)) $(OBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | $(3)_dirs @@ -365,7 +371,10 @@ endef define MAKE_LD $(eval DEP := $(1).d) -$(eval BL_CPPFLAGS := $($(call uppercase,$(3))_CPPFLAGS) -DIMAGE_$(call uppercase,$(3))) + +$(eval BL_DEFINES := $($(call uppercase,$(3))_DEFINES)) +$(eval BL_INCLUDE_DIRS := $($(call uppercase,$(3))_INCLUDE_DIRS)) +$(eval BL_CPPFLAGS := $($(call uppercase,$(3))_CPPFLAGS) -DIMAGE_$(call uppercase,$(3)) $(addprefix -D,$(BL_DEFINES)) $(addprefix -I,$(BL_INCLUDE_DIRS))) $(1): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | $(3)_dirs $$(ECHO) " PP $$<" |