Configurations/unix-Makefile.tmpl: make cleanup faster

Walk the source tree once instead of thrice when removing generated
dependency files, object files, and symlinks;  avoid descending into
submodules.

Co-Authored-by: Eugene Syromiatnikov <esyr@openssl.org>
Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Thu May 21 09:02:44 2026
(Merged from https://github.com/openssl/openssl/pull/31212)
This commit is contained in:
Nikola Pajkovsky 2026-05-05 10:20:57 +02:00 committed by Tomas Mraz
parent 9674d08e18
commit 70741ee62a

View file

@ -640,13 +640,30 @@ clean: libclean ## Clean the workspace, keep the configuration
$(RM) $(MANDOCS7)
$(RM) $(PROGRAMS) $(TESTPROGS) $(MODULES) $(FIPSMODULE) $(SCRIPTS)
$(RM) $(GENERATED_MANDATORY) $(GENERATED)
-find . -name '*{- platform->depext() -}' \! -name '.*' \! -type d -exec $(RM) {} \;
-find . -name '*{- platform->objext() -}' \! -name '.*' \! -type d -exec $(RM) {} \;
$(RM) core
$(RM) tags TAGS doc-nits md-nits
$(RM) -r $(RESULT_D)
$(RM) providers/fips*.new
-find . -type l \! -name '.*' \! -path './pkcs11-provider/*' -exec $(RM) {} \;
# Remove the generated dependency files, object files, and symlinks
# in a single pass, avoid descending into submodules.
-find . \( -path './cloudflare-quiche' \
-o -path './fuzz/corpora' \
-o -path './gost-engine' \
-o -path './krb5' \
-o -path './oqs-provider' \
-o -path './pkcs11-provider' \
-o -path './pyca-cryptography' \
-o -path './python-ecdsa' \
-o -path './tlsfuzzer' \
-o -path './tlslite-ng' \
-o -path './wycheproof' \
-prune \) \
-o \! -type d \
\( -name '*{- platform->depext() -}' \
-o -name '*{- platform->objext() -}' \
-o -type l \) \
\! -name '.*' \
-exec $(RM) '{}' +
distclean: clean cov-clean ## Clean and remove the configuration
$(RM) include/openssl/configuration.h