Fix the makedepend constructor in unix-Makefile.tmpl
[openssl.git] / Configurations / unix-Makefile.tmpl
index 84b3630c537ba58bbfce3086c8a97010ba91b727..bae16fd4fdf426feba12e36e18aeff4ccf373cc7 100644 (file)
@@ -85,7 +85,10 @@ ENGINESDIR={- use File::Spec::Functions;
 MANDIR=$(INSTALLTOP)/share/man
 HTMLDIR=$(INSTALLTOP)/share/doc/$(BASENAME)/html
 
-MANSUFFIX=ssl
+# 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=
 HTMLSUFFIX=html
 
 
@@ -123,6 +126,7 @@ NM= $(CROSS_COMPILE){- $target{nm} || "nm" -}
 RM= rm -f
 TAR= {- $target{tar} || "tar" -}
 TARFLAGS= {- $target{tarflags} -}
+MAKEDEPEND=$(CROSS_COMPILE){- $config{makedepprog} -}
 
 BASENAME=       openssl
 NAME=           $(BASENAME)-$(VERSION)
@@ -143,9 +147,15 @@ PROCESSOR= {- $config{processor} -}
 
 # The main targets ###################################################
 
-all: Makefile libcrypto.pc libssl.pc openssl.pc $(ENGINES) $(PROGRAMS) $(SCRIPTS) $(TESTPROGS) link-utils
+all: build_libs build_engines build_apps link-utils
 
-test tests: $(TESTPROGS) rehash
+# The pkg-config files depend on the libraries as well as Makefile
+build_libs: libcrypto.pc libssl.pc openssl.pc
+build_engines: $(ENGINES)
+build_apps: $(PROGRAMS) $(SCRIPTS)
+build_tests: $(TESTPROGS)
+
+test tests: build_tests build_apps build_engines rehash
        ( cd test; \
          SRCTOP=../$(SRCDIR) \
          BLDTOP=../$(BLDDIR) \
@@ -171,7 +181,7 @@ clean: libclean
        -rm -f `find $(BLDDIR) -type l`
        rm -f $(TARFILE)
 
-DCLEAN_CMD=sed -e '/^DO NOT DELETE.*/,$$d'
+DCLEAN_CMD=sed -e '/^DO NOT DELETE.*/,$$d'
 dclean:
        $(DCLEAN_CMD) < Makefile >Makefile.new
        mv -f Makefile.new Makefile
@@ -569,7 +579,7 @@ dist:
 
 # Helper targets #####################################################
 
-rehash: link-utils copy-certs
+rehash: link-utils copy-certs build_apps
        @if [ -z "$(CROSS_COMPILE)" ]; then \
                (OPENSSL="$(BLDDIR)/util/shlib_wrap.sh apps/openssl"; \
                [ -x "$(BLDDIR)/openssl.exe" ] && OPENSSL="$(BLDDIR)/openssl.exe" || :; \
@@ -734,10 +744,11 @@ Makefile: {- $config{build_file_template} -} $(SRCDIR)/Configure $(SRCDIR)/confi
           return <<"EOF";
 $dep : $deps
        rm -f \$\@.tmp; touch \$\@.tmp
-       \$(MAKEDEPEND) -f\$\@.tmp -o"|$obj"\
-           -- -DOPENSSL_DOING_MAKEDEPEND \$(DEPFLAGS)$incs \
-           -- $srcs
-       sed -e 's/^.*|//' -e 's/ \\/\\(\\\\.\\|[^ ]\\)*//g' -e '/: *\$/d' -e '/^\\(#.*\\| *\\)\$/d' \$\@.tmp > \$\@
+       \$(MAKEDEPEND) -f\$\@.tmp -o"|$obj" \\
+           -- -DOPENSSL_DOING_MAKEDEPEND \$(DEPFLAGS)$incs \\
+           -- $srcs \\
+           2>/dev/null
+       sed -e 's/^.*|//' -e 's/ \\/\\(\\\\.\\|[^ ]\\)*//g' -e '/: *\$\$/d' -e '/^\\(#.*\\| *\\)\$\$/d' \$\@.tmp > \$\@
        rm \$\@.tmp
 EOF
       }
@@ -876,7 +887,8 @@ EOF
                            rel2abs($config{builddir}));
       return <<"EOF";
 $script : $sources
-       \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" $sources > "$script"
+       \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
+           "-o$target{build_file}" $sources > "$script"
        chmod a+x $script
 EOF
   }