Makefile template: Allow separate generation of .pod.in -> .pod
authorRichard Levitte <levitte@openssl.org>
Thu, 4 Feb 2021 14:32:37 +0000 (15:32 +0100)
committerRichard Levitte <levitte@openssl.org>
Fri, 5 Feb 2021 14:51:31 +0000 (15:51 +0100)
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 <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14067)

Configurations/unix-Makefile.tmpl
doc/build.info

index 174e52871ec45f22b7191ab69b22eb3a3711e33c..0cf287ac5a14cdf56bd84d1c1a6c1d9358816eab 100644 (file)
@@ -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.
index 83da34ee29d940c2314906ad089faa7bd0455170..267629040dafa1522002ed3f56032e82a562dc33 100644 (file)
@@ -56,6 +56,7 @@ DEPEND[$manfile]=$podfile
 GENERATE[$manfile]=$podfile
 _____
          $OUT .= << "_____" if $podinfile;
+DEPEND[$podfile]{pod}=$podinfile
 GENERATE[$podfile]=$podinfile
 _____
      }