1From aa57ce632c629fe72ff417e261e0f5bfd8db6bab Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= <vincent.stehle@arm.com>
3Date: Tue, 4 Jul 2023 16:14:02 +0200
4Subject: [PATCH] build(tools): avoid unnecessary link
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9In their respective makefiles, cert_create, encrypt_fw and fiptool
10depend on the --openssl phony target as a prerequisite. This forces
11those tools to be re-linked each time.
12
13Move the dependencies on the --openssl target from the tools to their
14makefiles all targets, to avoid unnecessary linking while preserving the
15OpenSSL version printing done in the --openssl targets when in debug.
16
17Fixes: cf2dd17ddda2 ("refactor(security): add OpenSSL 1.x compatibility")
18Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
19Change-Id: I98a3ab30f36dffc253cecaaf3a57d2712522135d
20Upstream: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/?id=aa57ce632c629fe72ff417e261e0f5bfd8db6bab
21---
22 tools/cert_create/Makefile | 4 ++--
23 tools/encrypt_fw/Makefile  | 4 ++--
24 tools/fiptool/Makefile     | 4 ++--
25 3 files changed, 6 insertions(+), 6 deletions(-)
26
27diff --git a/tools/cert_create/Makefile b/tools/cert_create/Makefile
28index 042e844626..b911d19d2b 100644
29--- a/tools/cert_create/Makefile
30+++ b/tools/cert_create/Makefile
31@@ -85,9 +85,9 @@ HOSTCC ?= gcc
32
33 .PHONY: all clean realclean --openssl
34
35-all: ${BINARY}
36+all: --openssl ${BINARY}
37
38-${BINARY}: --openssl ${OBJECTS} Makefile
39+${BINARY}: ${OBJECTS} Makefile
40 	@echo "  HOSTLD  $@"
41 	@echo 'const char build_msg[] = "Built : "__TIME__", "__DATE__; \
42                 const char platform_msg[] = "${PLAT_MSG}";' | \
43diff --git a/tools/encrypt_fw/Makefile b/tools/encrypt_fw/Makefile
44index 2939b142be..924e5febab 100644
45--- a/tools/encrypt_fw/Makefile
46+++ b/tools/encrypt_fw/Makefile
47@@ -65,9 +65,9 @@ HOSTCC ?= gcc
48
49 .PHONY: all clean realclean --openssl
50
51-all: ${BINARY}
52+all: --openssl ${BINARY}
53
54-${BINARY}: --openssl ${OBJECTS} Makefile
55+${BINARY}: ${OBJECTS} Makefile
56 	@echo "  HOSTLD  $@"
57 	@echo 'const char build_msg[] = "Built : "__TIME__", "__DATE__;' | \
58                 ${HOSTCC} -c ${HOSTCCFLAGS} -xc - -o src/build_msg.o
59diff --git a/tools/fiptool/Makefile b/tools/fiptool/Makefile
60index 2ebee33931..4bdebd9235 100644
61--- a/tools/fiptool/Makefile
62+++ b/tools/fiptool/Makefile
63@@ -68,9 +68,9 @@ DEPS := $(patsubst %.o,%.d,$(OBJECTS))
64
65 .PHONY: all clean distclean --openssl
66
67-all: ${PROJECT}
68+all: --openssl ${PROJECT}
69
70-${PROJECT}: --openssl ${OBJECTS} Makefile
71+${PROJECT}: ${OBJECTS} Makefile
72 	@echo "  HOSTLD  $@"
73 	${Q}${HOSTCC} ${OBJECTS} -o $@ ${LDLIBS}
74 	@${ECHO_BLANK_LINE}
75--
762.25.1
77
78