diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk index a6b1d528b..4815efa74 100644 --- a/make_helpers/build_macros.mk +++ b/make_helpers/build_macros.mk @@ -274,10 +274,11 @@ MAKE_DEP = -Wp,-MD,$(DEP) -MT $$@ -MP define MAKE_C_LIB $(eval OBJ := $(1)/$(patsubst %.c,%.o,$(notdir $(2)))) $(eval DEP := $(patsubst %.o,%.d,$(OBJ))) +$(eval LIB := $(call uppercase, $(notdir $(1)))) $(OBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | lib$(3)_dirs $$(ECHO) " CC $$<" - $$(Q)$$(CC) $$(TF_CFLAGS) $$(CFLAGS) $(MAKE_DEP) -c $$< -o $$@ + $$(Q)$$(CC) $$($(LIB)_CFLAGS) $$(TF_CFLAGS) $$(CFLAGS) $(MAKE_DEP) -c $$< -o $$@ -include $(DEP)