From: Mikael Olsson Date: Thu, 8 Dec 2022 16:07:06 +0000 (+0100) Subject: build(fiptool): add object dependency generation X-Git-Tag: baikal/aarch64/sdk5.10~1^2~111^2~19 X-Git-Url: https://git.baikalelectronics.ru/?a=commitdiff_plain;h=0165ddd7c06fe2d0556865fce89ced8694e3812e;p=arm-tf.git build(fiptool): add object dependency generation The object target in the fiptool Makefile only depends on the corresponding source file so it won't rebuild the object, if a header file used by the source file is changed. To make it rebuild the object file for both source and header file changes, a dependency file will now be generated for each object and included in the Makefile. Signed-off-by: Mikael Olsson Change-Id: I0468c6e9c54126242150667268d471f28e011b0d --- diff --git a/tools/fiptool/Makefile b/tools/fiptool/Makefile index d7e0fe5be..ac262cdff 100644 --- a/tools/fiptool/Makefile +++ b/tools/fiptool/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2014-2022, Arm Limited and Contributors. All rights reserved. +# Copyright (c) 2014-2023, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -61,6 +61,8 @@ ifneq (,$(wildcard ${PLAT_FIPTOOL_HELPER_MK})) include ${PLAT_FIPTOOL_HELPER_MK} endif +DEPS := $(patsubst %.o,%.d,$(OBJECTS)) + .PHONY: all clean distclean --openssl all: ${PROJECT} @@ -74,7 +76,9 @@ ${PROJECT}: --openssl ${OBJECTS} Makefile %.o: %.c Makefile @echo " HOSTCC $<" - ${Q}${HOSTCC} -c ${CPPFLAGS} ${HOSTCCFLAGS} ${INCLUDE_PATHS} $< -o $@ + ${Q}${HOSTCC} -c ${CPPFLAGS} ${HOSTCCFLAGS} ${INCLUDE_PATHS} -MD -MP $< -o $@ + +-include $(DEPS) --openssl: ifeq ($(DEBUG),1) @@ -83,4 +87,4 @@ endif clean: - $(call SHELL_DELETE_ALL, ${PROJECT} ${OBJECTS}) + $(call SHELL_DELETE_ALL, ${PROJECT} ${OBJECTS} $(DEPS))