Configure/Makefile: fix the `-macopt` argument of the fipsinstall command
[openssl.git] / Configurations / unix-Makefile.tmpl
index 1ff418c4c627108f31074fbc3c497bcee5a3520b..e7287b6290d68e660f62f510c7341d79a1f86711 100644 (file)
@@ -3,7 +3,8 @@
 ##
 ## {- join("\n## ", @autowarntext) -}
 {-
-     our $makedepprog = platform->makedepprog();
+     our $makedep_scheme = $config{makedep_scheme};
+     our $makedepcmd = platform->makedepcmd();
 
      sub windowsdll { $config{target} =~ /^(?:Cygwin|mingw)/ }
 
@@ -288,7 +289,7 @@ HTMLDIR=$(DOCDIR)/html
 # MANSUFFIX is for the benefit of anyone who may want to have a suffix
 # appended after the manpage file section number.  "ssl" is popular,
 # resulting in files such as config.5ssl rather than config.5.
-MANSUFFIX=
+MANSUFFIX=ossl
 HTMLSUFFIX=html
 
 # For "optional" echo messages, to get "real" silence
@@ -315,7 +316,7 @@ CXXFLAGS={- join(' ', @{$config{CXXFLAGS}}) -}
 LDFLAGS= {- join(' ', @{$config{LDFLAGS}}) -}
 EX_LIBS= {- join(' ', @{$config{LDLIBS}}) -}
 
-MAKEDEPEND={- $config{makedepprog} -}
+MAKEDEPEND={- $config{makedepcmd} -}
 
 PERL={- $config{PERL} -}
 
@@ -561,7 +562,6 @@ clean: libclean
        $(RM) -r test/test-runs
        $(RM) openssl.pc libcrypto.pc libssl.pc
        -find . -type l \! -name '.*' -exec $(RM) {} \;
-       $(RM) $(TARFILE)
 
 distclean: clean
        $(RM) configdata.pm
@@ -571,9 +571,7 @@ distclean: clean
 # concatenate only if that is true.
 depend:
        @: {- output_off() if $disabled{makedepend}; "" -}
-       @$(PERL) $(SRCDIR)/util/add-depends.pl {-
-                defined $makedepprog  && $makedepprog =~ /\/makedepend/
-                 ? 'makedepend' : 'gcc' -}
+       @$(PERL) $(SRCDIR)/util/add-depends.pl "{- $makedep_scheme -}"
        @: {- output_on() if $disabled{makedepend}; "" -}
 
 # Install helper targets #############################################
@@ -592,7 +590,7 @@ install_fips: install_sw
        @$(ECHO) "fipsinstall $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).cnf"
        @openssl fipsinstall -module $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME) \
                -out $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).cnf \
-               -macopt 'key:$(FIPSKEY)'
+               -macopt 'hexkey:$(FIPSKEY)'
 
 uninstall_fips: uninstall_sw
        @$(ECHO) "*** Uninstalling FIPS module configuration"
@@ -1356,7 +1354,7 @@ EOF
           my $pod = $gen0;
           return <<"EOF";
 $args{src}: $pod
-       pod2man --name=$name --section=$section --center=OpenSSL \\
+       pod2man --name=$name --section=$section\$(MANSUFFIX) --center=OpenSSL \\
                --release=\$(VERSION) $pod >\$\@
 EOF
       } elsif (platform->isdef($args{src})) {
@@ -1508,7 +1506,7 @@ $obj: $deps
        $cmd $cmdflags -c -o \$\@ $srcs
 EOF
       } elsif (grep /\.S$/, @srcs) {
-          # Originally there was mutli-step rule with $(CC) -E file.S
+          # Originally there was multi-step rule with $(CC) -E file.S
           # followed by $(CC) -c file.s. It compensated for one of
           # legacy platform compiler's inability to handle .S files.
           # The platform is long discontinued by vendor so there is
@@ -1517,8 +1515,7 @@ EOF
 $obj: $deps
        $cmd $incs $defs $cmdflags -c -o \$\@ $srcs
 EOF
-      } elsif (defined $makedepprog && $makedepprog !~ /\/makedepend/
-               && !grep /\.rc$/, @srcs) {
+      } elsif ($makedep_scheme eq 'gcc' && !grep /\.rc$/, @srcs) {
           $recipe .= <<"EOF";
 $obj: $deps
        $cmd $incs $defs $cmdflags -MMD -MF $dep.tmp -MT \$\@ -c -o \$\@ $srcs
@@ -1534,7 +1531,7 @@ EOF
 $obj: $deps
        $cmd $incs $defs $cmdflags $cmdcompile -o \$\@ $srcs
 EOF
-          if (defined $makedepprog  && $makedepprog =~ /\/makedepend/) {
+          if ($makedep_scheme eq 'makedepend') {
               $recipe .= <<"EOF";
        \$(MAKEDEPEND) -f- -Y -- $incs $cmdflags -- $srcs 2>/dev/null \\
            > $dep
@@ -1696,7 +1693,7 @@ EOF
                  @{$args{objs}};
       my @deps = compute_lib_depends(@{$args{deps}});
       my $shared_def = join("", map { ' '.$target{shared_defflag}.$_ } @defs);
-      # TODO(3.0): next line needs to become "less magic" (see PR #11950)
+      # Next line needs to become "less magic" (see PR #11950)
       $shared_def .= ' '.$target{shared_fipsflag} if (m/providers\/fips/ && defined $target{shared_fipsflag});
       my $objs = join(" \\\n\t\t", fill_lines(' ', $COLUMNS - 16, @objs));
       my $deps = join(" \\\n" . ' ' x (length($dso) + 2),