Build file templates: Use explicit files instead of $< or $? for pods
authorRichard Levitte <levitte@openssl.org>
Wed, 15 Jan 2020 07:28:46 +0000 (08:28 +0100)
committerRichard Levitte <levitte@openssl.org>
Fri, 17 Jan 2020 07:51:24 +0000 (08:51 +0100)
When generating html or manpages from POD files, we used $< or $? to
get the file name to process.  It turns out, though, that some make
implementations only define $< with implicit rules, so its expansion
remains empty in explicit rules.  $? is a fine replacement, but only
as long as we have one dependency, so it may cause problems in the
future.

The final solution seems to be to use explicit POD file names
instead.  That leaves no doubts.

Fixes #10817

Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/10849)

Configurations/descrip.mms.tmpl
Configurations/unix-Makefile.tmpl
Configurations/windows-makefile.tmpl

index f9f3aea4f4ef6a442dd28a5cef15cfc6fac9834c..d379a8230b8a3d6f559efa0dc272f4bee7513b94 100644 (file)
@@ -781,10 +781,11 @@ reconfigure reconf :
 
       if ($args{src} =~ /\.html$/) {
          my $title = basename($args{src}, ".html");
+         my $pod = $args{generator}->[0];
          return <<"EOF";
-$args{src}: $args{generator}->[0]
+$args{src}: $pod
        pipe pod2html "--podroot=\$(SRCDIR)/doc" --htmldir=.. -
-                      --podpath=man1:man3:man5:man7 "--infile=\$<" -
+                      --podpath=man1:man3:man5:man7 "--infile=$pod" -
                      "--title=$title" -
        | \$(PERL) -pe "s|href=""http://man\\.he\\.net/(man\d/[^""]+)(?:\\.html)?""|href=""../\$1.html|g;" -
        > \$\@
index 0edde3f5999b265a810dfade1b4d344c2003cb0f..f01040d39d35ae9ec0c1ff45d853100857d92ac7 100644 (file)
@@ -1184,20 +1184,22 @@ reconfigure reconf:
 
       if ($args{src} =~ /\.html$/) {
          my $title = basename($args{src}, ".html");
+         my $pod = $args{generator}->[0];
          return <<"EOF";
-$args{src}: $args{generator}->[0]
+$args{src}: $pod
        pod2html "--podroot=\$(SRCDIR)/doc" --htmldir=.. \\
-                --podpath=man1:man3:man5:man7 "--infile=\$<" "--title=$title" \\
+                --podpath=man1:man3:man5:man7 --infile=$pod "--title=$title" \\
        | \$(PERL) -pe 's|href="http://man\\.he\\.net/(man\\d/[^"]+)(?:\\.html)?"|href="../\$1.html|g;' \\
        > \$\@
 EOF
       } elsif ($args{src} =~ /\.(\d)$/) {
          my $section = $1;
          my $name = uc basename($args{src}, ".$section");
+         my $pod = $args{generator}->[0];
          return <<"EOF";
-$args{src}: $args{generator}->[0]
+$args{src}: $pod
        pod2man --name=$name --section=$section --center=OpenSSL \\
-               --release=\$(VERSION) \$< \\
+               --release=\$(VERSION) $pod \\
        > \$\@
 EOF
       } elsif (platform->isdef($args{src})) {
index 83df9f27a9b0d2bd4ddcc7ca95b40dd42dd8c7ec..275c93ebc1683541c90b7e9e961eefc2f53a4e7f 100644 (file)
@@ -586,10 +586,11 @@ reconfigure reconf:
 
       if ($args{src} =~ /\.html$/) {
          my $title = basename($args{src}, ".html");
+         my $pod = $args{generator}->[0];
          return <<"EOF";
-$args{src}: $args{generator}->[0]
+$args{src}: "$pod"
        pod2html "--podroot=\$(SRCDIR)/doc" --htmldir=.. \\
-                --podpath=man1:man3:man5:man7 "--infile=\$?" "--title=$title" \\
+                --podpath=man1:man3:man5:man7 "--infile=$pod" "--title=$title" \\
        | \$(PERL) -pe ^"s^|href=\\^"http://man\\.he\\.net/^(man\\d/[^^\\^"]+^)^(?:\.html^)?^"^|href=\\^"../\$\$1.html^|g;^" \\
        > \$\@
 EOF