aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2020-11-24 15:38:08 +0100
committerManish Pandey <manish.pandey2@arm.com>2021-01-07 13:23:15 +0000
commita98122064dcc3704a54c44323ba2eda8de7358dd (patch)
tree2c1b36226319dc79bc4205861f0e2b2114989b78 /Makefile
parentf422a7bf5b179be476e97b930fcc25950bf9374b (diff)
downloadarm-trusted-firmware-a98122064dcc3704a54c44323ba2eda8de7358dd.tar.gz
Makefile: Do not mark file targets as .PHONY target
Only non-file targets should be set a .PHONY. Otherwise if file target is set as .PHONY then targets which depends on those file .PHONY targets would be always rebuilt even when their prerequisites are not changed. File target which needs to be always rebuilt can be specified in Make system via having a prerequisite on some .PHONY target, instead of marking whole target as .PHONY. In Makefile projects it is common to create empty .PHONY target named FORCE for this purpose. This patch changes all file targets which are set as .PHONY to depends on new .PHONY target FORCE, to ensure that these file targets are always rebuilt (as before). Basically they are those targets which calls external make subprocess. After FORCE target is specified in main Makefile, remove it from other Makefile files to prevent duplicate definitions. Signed-off-by: Pali Rohár <pali@kernel.org> Change-Id: Iee3b4e0de93879b95eb29a1745a041538412e69e
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 8 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 2d5a5bb2e..b0399f15b 100644
--- a/Makefile
+++ b/Makefile
@@ -1245,8 +1245,7 @@ checkpatch: locate-checkpatch
certtool: ${CRTTOOL}
-.PHONY: ${CRTTOOL}
-${CRTTOOL}:
+${CRTTOOL}: FORCE
${Q}${MAKE} PLAT=${PLAT} USE_TBBR_DEFS=${USE_TBBR_DEFS} COT=${COT} OPENSSL_DIR=${OPENSSL_DIR} CRTTOOL=${CRTTOOL} --no-print-directory -C ${CRTTOOLPATH}
@${ECHO_BLANK_LINE}
@echo "Built $@ successfully"
@@ -1288,8 +1287,7 @@ fiptool: ${FIPTOOL}
fip: ${BUILD_PLAT}/${FIP_NAME}
fwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME}
-.PHONY: ${FIPTOOL}
-${FIPTOOL}:
+${FIPTOOL}: FORCE
@${ECHO_BLANK_LINE}
@echo "Building $@"
ifdef UNIX_MK
@@ -1302,12 +1300,10 @@ endif
@${ECHO_BLANK_LINE}
sptool: ${SPTOOL}
-.PHONY: ${SPTOOL}
-${SPTOOL}:
+${SPTOOL}: FORCE
${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" SPTOOL=${SPTOOL} --no-print-directory -C ${SPTOOLPATH}
-.PHONY: libraries
-romlib.bin: libraries
+romlib.bin: libraries FORCE
${Q}${MAKE} PLAT_DIR=${PLAT_DIR} BUILD_PLAT=${BUILD_PLAT} ENABLE_BTI=${ENABLE_BTI} ARM_ARCH_MINOR=${ARM_ARCH_MINOR} INCLUDES='${INCLUDES}' DEFINES='${DEFINES}' --no-print-directory -C ${ROMLIBPATH} all
# Call print_memory_map tool
@@ -1320,8 +1316,7 @@ doc:
enctool: ${ENCTOOL}
-.PHONY: ${ENCTOOL}
-${ENCTOOL}:
+${ENCTOOL}: FORCE
${Q}${MAKE} PLAT=${PLAT} BUILD_INFO=0 OPENSSL_DIR=${OPENSSL_DIR} ENCTOOL=${ENCTOOL} --no-print-directory -C ${ENCTOOLPATH}
@${ECHO_BLANK_LINE}
@echo "Built $@ successfully"
@@ -1375,3 +1370,6 @@ help:
@echo ""
@echo "example: build all targets for the FVP platform:"
@echo " CROSS_COMPILE=aarch64-none-elf- make PLAT=fvp all"
+
+.PHONY: FORCE
+FORCE:;