From e15591aaf47ab45941f0d7a03abf3e4a830ac1d9 Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez Date: Wed, 31 Mar 2021 12:22:45 +0200 Subject: [PATCH] fix(cert_create): let distclean Makefile target remove the cert_create tool For some targets, Make recursively invokes itself in subdirectories. When delegating the distclean target to tools/cert_create/Makefile, the submake is called with the clean target instead of realclean. Because of this, the submake never removes the cert_create executable. A proper but more intrusive fix would * avoid confusion about the semantics by following traditions or using new names https://www.gnu.org/prep/standards/standards.html#Standard-Targets * avoid typing errors with the special $@ variable. Something like: In tools/cert_create/Makefile: mostlyclean: # Remove most objects but keep some results. $(call SHELL_DELETE_ALL, src/build_msg.o ${OBJECTS}) clean: mostlyclean # mostlyclean, then remove things built by Make. $(call SHELL_DELETE,${BINARY}) distclean: clean # clean, then remove things built by ./configure (none here). realclean maintainer-clean: distclean # distclean, then remove things built by autootols (none here). In Makefile: mostlyclean clean distclean realclean maintainer-clean: $(MAKE) -C subdir1 $@ $(MAKE) -C subdir2 $@ Signed-off-by: Nicolas Boulenguez Change-Id: Iabfeca3da5724ab90a56ad6dcd6870d0a1d6b07f --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1baacf0f1..cac3e1297 100644 --- a/Makefile +++ b/Makefile @@ -1360,7 +1360,7 @@ else ${Q}set MAKEFLAGS= && ${MSVC_NMAKE} /nologo /f ${FIPTOOLPATH}/Makefile.msvc FIPTOOLPATH=$(subst /,\,$(FIPTOOLPATH)) FIPTOOL=$(subst /,\,$(FIPTOOL)) realclean endif ${Q}${MAKE} --no-print-directory -C ${SPTOOLPATH} clean - ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} clean + ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} realclean ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${ENCTOOLPATH} realclean ${Q}${MAKE} --no-print-directory -C ${ROMLIBPATH} clean