From 9ca08f91e9817892c3545612a91d38687e593e14 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Thu, 4 Feb 2021 15:32:37 +0100 Subject: [PATCH] Makefile template: Allow separate generation of .pod.in -> .pod We do this by adding the attribute 'pod' to all .pod.in -> .pod generations, like this: DEPEND[NAME.pod]{pod}=NAME.pod.in, ... and selecting out the target files for those dependencies into a dedicated target 'build_generated_pods', which the 'doc-nits' and 'cmd-nits' make targets are made to depend on. Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/14067) --- Configurations/unix-Makefile.tmpl | 18 ++++++++++++++++-- doc/build.info | 1 + 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl index 174e52871e..0cf287ac5a 100644 --- a/Configurations/unix-Makefile.tmpl +++ b/Configurations/unix-Makefile.tmpl @@ -112,6 +112,19 @@ DEPS={- join(" \\\n" . ' ' x 5, GENERATED_MANDATORY={- join(" \\\n" . ' ' x 20, fill_lines(" ", $COLUMNS - 20, @{$unified_info{depends}->{""}})) -} +GENERATED_PODS={- # common0.tmpl provides @generated + join(" \\\n" . ' ' x 15, + fill_lines(" ", $COLUMNS - 15, + map { my $x = $_; + ( + grep { + $unified_info{attributes}->{depends} + ->{$x}->{$_}->{pod} // 0 + } + keys %{$unified_info{attributes}->{depends}->{$x}} + ) ? $x : (); + } + @generated)) -} GENERATED={- # common0.tmpl provides @generated join(" \\\n" . ' ' x 5, fill_lines(" ", $COLUMNS - 5, @@ -457,6 +470,7 @@ LANG=C {- dependmagic('build_modules'); -}: build_modules_nodep {- dependmagic('build_programs'); -}: build_programs_nodep +build_generated_pods: $(GENERATED_PODS) build_docs: build_man_docs build_html_docs build_man_docs: $(MANDOCS1) $(MANDOCS3) $(MANDOCS5) $(MANDOCS7) build_html_docs: $(HTMLDOCS1) $(HTMLDOCS3) $(HTMLDOCS5) $(HTMLDOCS7) @@ -1014,10 +1028,10 @@ generate: generate_apps generate_crypto_bn generate_crypto_objects \ generate_crypto_conf generate_crypto_asn1 generate_fuzz_oids .PHONY: doc-nits cmd-nits md-nits -doc-nits: build_generated +doc-nits: build_generated_pods $(PERL) $(SRCDIR)/util/find-doc-nits -n -l -e -cmd-nits: build_generated apps/openssl +cmd-nits: build_generated apps/openssl build_generated_pods $(PERL) $(SRCDIR)/util/find-doc-nits -c # This uses "mdl", the markdownlint application, which is written in ruby. diff --git a/doc/build.info b/doc/build.info index 83da34ee29..267629040d 100644 --- a/doc/build.info +++ b/doc/build.info @@ -56,6 +56,7 @@ DEPEND[$manfile]=$podfile GENERATE[$manfile]=$podfile _____ $OUT .= << "_____" if $podinfile; +DEPEND[$podfile]{pod}=$podinfile GENERATE[$podfile]=$podinfile _____ }