From a7bbd8e7fe30deef932434a71e388113dcadfd98 Mon Sep 17 00:00:00 2001 From: Chris Kay Date: Wed, 11 Sep 2024 11:50:00 +0000 Subject: [PATCH] build: use parameters in calls to `MAKE_DEP` This is a small change to the behaviour of the `MAKE_DEP` macro to force it to take its inputs as arguments, rather than assuming the variables that its inputs come from. Change-Id: Ibe44f19e6bea43c9feed34710cdd30704576b4d7 Signed-off-by: Chris Kay --- make_helpers/build_macros.mk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk index c53894aa7..b1b299cd9 100644 --- a/make_helpers/build_macros.mk +++ b/make_helpers/build_macros.mk @@ -282,7 +282,7 @@ GZIP_SUFFIX := .gz # Auxiliary macros to build TF images from sources ################################################################################ -MAKE_DEP = -Wp,-MD,$(DEP) -MT $$@ -MP +MAKE_DEP = -Wp,-MD,$1 -MT $2 -MP # MAKE_C_LIB builds a C source file and generates the dependency file @@ -297,7 +297,7 @@ $(eval LIB := $(notdir $(1))) $(OBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | $$$$(@D)/ $$(s)echo " CC $$<" - $$(q)$($(ARCH)-cc) $$($(LIB)_CFLAGS) $$(TF_CFLAGS) $$(CFLAGS) $(MAKE_DEP) -c $$< -o $$@ + $$(q)$($(ARCH)-cc) $$($(LIB)_CFLAGS) $$(TF_CFLAGS) $$(CFLAGS) $(call MAKE_DEP,$(DEP),$(OBJ)) -c $$< -o $$@ -include $(DEP) @@ -314,7 +314,7 @@ $(eval DEP := $(patsubst %.o,%.d,$(OBJ))) $(OBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | $$$$(@D)/ $$(s)echo " AS $$<" - $$(q)$($(ARCH)-as) -x assembler-with-cpp $$(TF_CFLAGS_$(ARCH)) $$(ASFLAGS) $(MAKE_DEP) -c $$< -o $$@ + $$(q)$($(ARCH)-as) -x assembler-with-cpp $$(TF_CFLAGS_$(ARCH)) $$(ASFLAGS) $(call MAKE_DEP,$(DEP),$(OBJ)) -c $$< -o $$@ -include $(DEP) @@ -338,7 +338,7 @@ $(eval BL_CFLAGS := $($(4)_CFLAGS) $(PLAT_BL_COMMON_CFLAGS)) $(OBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | $$$$(@D)/ $$(s)echo " CC $$<" - $$(q)$($(ARCH)-cc) $$(LTO_CFLAGS) $$(TF_CFLAGS) $$(CFLAGS) $(BL_CPPFLAGS) $(BL_CFLAGS) $(MAKE_DEP) -c $$< -o $$@ + $$(q)$($(ARCH)-cc) $$(LTO_CFLAGS) $$(TF_CFLAGS) $$(CFLAGS) $(BL_CPPFLAGS) $(BL_CFLAGS) $(call MAKE_DEP,$(DEP),$(OBJ)) -c $$< -o $$@ -include $(DEP) @@ -362,7 +362,7 @@ $(eval BL_ASFLAGS := $($(4)_ASFLAGS) $(PLAT_BL_COMMON_ASFLAGS)) $(OBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | $$$$(@D)/ $$(s)echo " AS $$<" - $$(q)$($(ARCH)-as) -x assembler-with-cpp $$(TF_CFLAGS_$(ARCH)) $$(ASFLAGS) $(BL_CPPFLAGS) $(BL_ASFLAGS) $(MAKE_DEP) -c $$< -o $$@ + $$(q)$($(ARCH)-as) -x assembler-with-cpp $$(TF_CFLAGS_$(ARCH)) $$(ASFLAGS) $(BL_CPPFLAGS) $(BL_ASFLAGS) $(call MAKE_DEP,$(DEP),$(OBJ)) -c $$< -o $$@ -include $(DEP) @@ -384,7 +384,7 @@ $(eval BL_CPPFLAGS := $($(4)_CPPFLAGS) $(addprefix -D,$(BL_DEFINES)) $(addprefix $(1): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | $$$$(@D)/ $$(s)echo " PP $$<" - $$(q)$($(ARCH)-cpp) -E $$(CPPFLAGS) $(BL_CPPFLAGS) $(TF_CFLAGS_$(ARCH)) -P -x assembler-with-cpp -D__LINKER__ $(MAKE_DEP) -o $$@ $$< + $$(q)$($(ARCH)-cpp) -E $$(CPPFLAGS) $(BL_CPPFLAGS) $(TF_CFLAGS_$(ARCH)) -P -x assembler-with-cpp -D__LINKER__ $(call MAKE_DEP,$(DEP),$1) -o $$@ $$< -include $(DEP)