aboutsummaryrefslogtreecommitdiffstats
path: root/Configurations
diff options
context:
space:
mode:
authorBob Beck <[email protected]>2026-08-08 01:13:07 +0200
committerTomas Mraz <[email protected]>2026-09-01 15:59:46 +0200
commiteedad09db21202d693fa0eabcedb0ced9297b82b (patch)
treedde1ee5c90aaf78bce80562e020ac30b3fd0b935 /Configurations
parentReplace generated crypto/objects files only when their content changes (diff)
downloadopenssl-eedad09db21202d693fa0eabcedb0ced9297b82b.tar.gz
openssl-eedad09db21202d693fa0eabcedb0ced9297b82b.zip
Skip the small generator scripts when their output is current
Guard the generate_apps, generate_crypto_bn, generate_crypto_conf, generate_crypto_asn1 and generate_fuzz_oids recipes with test -nt checks against their inputs, so "make update" no longer reruns them when nothing they consume has changed. Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Andrew Dinh <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> Merge-date: Tue Sep 1 14:03:01 2026 Merged-from: https://github.com/openssl/openssl/pull/32243
Diffstat (limited to 'Configurations')
-rw-r--r--Configurations/unix-Makefile.tmpl27
1 files changed, 22 insertions, 5 deletions
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index 2642a0d1a2f..67cce9901d2 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -1189,6 +1189,11 @@ uninstall_image_docs:
# is sensitive to build.info changes.
update: generate errors ordinals generate_buildinfo ## Update errors, ordinals and build info
+# $(UPTODATE) target input... succeeds when target exists and is strictly
+# newer than every input, and fails otherwise; used to skip regeneration
+# of a target that is already current.
+UPTODATE=$(PERL) -e 'my $$o = shift; exit 1 unless -e $$o; -M $$o < -M $$_ or exit 1 for @ARGV'
+
.PHONY: generate generate_apps generate_crypto_bn generate_crypto_objects \
generate_crypto_conf generate_crypto_asn1 generate_fuzz_oids
generate: generate_apps generate_crypto_bn generate_crypto_objects \
@@ -1234,11 +1239,16 @@ check-format: check-clang-format-diff-cmd ## Evaluate C code according to OpenSS
( cd $(SRCDIR); git diff -U0 --no-prefix --no-color | $(CLANG_FORMAT_DIFF) )
generate_apps:
- ( cd $(SRCDIR); $(PERL) VMS/VMSify-conf.pl \
+ ( cd $(SRCDIR); \
+ $(UPTODATE) apps/openssl-vms.cnf \
+ apps/openssl.cnf VMS/VMSify-conf.pl || \
+ $(PERL) VMS/VMSify-conf.pl \
< apps/openssl.cnf > apps/openssl-vms.cnf )
generate_crypto_bn:
- ( cd $(SRCDIR); $(PERL) crypto/bn/bn_prime.pl > crypto/bn/bn_prime.h )
+ ( cd $(SRCDIR); \
+ $(UPTODATE) crypto/bn/bn_prime.h crypto/bn/bn_prime.pl || \
+ $(PERL) crypto/bn/bn_prime.pl > crypto/bn/bn_prime.h )
generate_crypto_objects:
( cd $(SRCDIR); set -e; \
@@ -1271,15 +1281,22 @@ generate_crypto_objects:
done )
generate_crypto_conf:
- ( cd $(SRCDIR); $(PERL) crypto/conf/keysets.pl \
+ ( cd $(SRCDIR); \
+ $(UPTODATE) crypto/conf/conf_def.h crypto/conf/keysets.pl || \
+ $(PERL) crypto/conf/keysets.pl \
> crypto/conf/conf_def.h )
generate_crypto_asn1:
- ( cd $(SRCDIR); $(PERL) crypto/asn1/charmap.pl \
+ ( cd $(SRCDIR); \
+ $(UPTODATE) crypto/asn1/charmap.h crypto/asn1/charmap.pl || \
+ $(PERL) crypto/asn1/charmap.pl \
> crypto/asn1/charmap.h )
generate_fuzz_oids:
- ( cd $(SRCDIR); $(PERL) fuzz/mkfuzzoids.pl \
+ ( cd $(SRCDIR); \
+ $(UPTODATE) fuzz/oids.txt \
+ crypto/objects/obj_dat.h fuzz/mkfuzzoids.pl || \
+ $(PERL) fuzz/mkfuzzoids.pl \
crypto/objects/obj_dat.h \
> fuzz/oids.txt )