Tests depend on everything.
[openssl.git] / Configurations / unix-Makefile.tmpl
index 1db92a8..a663589 100644 (file)
@@ -82,8 +82,8 @@ LIBDIR={- #
 ENGINESDIR={- use File::Spec::Functions;
               catdir($prefix,$libdir,"engines") -}
 
 ENGINESDIR={- use File::Spec::Functions;
               catdir($prefix,$libdir,"engines") -}
 
-MANDIR=$(OPENSSLDIR)/man
-HTMLDIR=$(OPENSSLDIR)/html
+MANDIR=$(INSTALLTOP)/share/man
+HTMLDIR=$(INSTALLTOP)/share/doc/$(BASENAME)/html
 
 MANSUFFIX=ssl
 HTMLSUFFIX=html
 
 MANSUFFIX=ssl
 HTMLSUFFIX=html
@@ -112,6 +112,7 @@ SHARED_LDFLAGS={- $target{shared_ldflag}
                   # $prefix is not /usr.
                   . ($config{target} =~ m|^BSD-| && $prefix !~ m|^/usr/.*$|
                      ? " -Wl,-rpath,\$\$(LIBRPATH)" : "") -}
                   # $prefix is not /usr.
                   . ($config{target} =~ m|^BSD-| && $prefix !~ m|^/usr/.*$|
                      ? " -Wl,-rpath,\$\$(LIBRPATH)" : "") -}
+SHARED_RCFLAGS={- $target{shared_rcflag} -}
 
 PERL={- $config{perl} -}
 
 
 PERL={- $config{perl} -}
 
@@ -142,9 +143,15 @@ PROCESSOR= {- $config{processor} -}
 
 # The main targets ###################################################
 
 
 # The main targets ###################################################
 
-all: Makefile libcrypto.pc libssl.pc openssl.pc $(ENGINES) $(PROGRAMS) $(SCRIPTS) $(TESTPROGS)
+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 build_libs rehash
        ( cd test; \
          SRCTOP=../$(SRCDIR) \
          BLDTOP=../$(BLDDIR) \
        ( cd test; \
          SRCTOP=../$(SRCDIR) \
          BLDTOP=../$(BLDDIR) \
@@ -156,7 +163,7 @@ list-tests:
 libclean:
        -rm -f `find $(BLDDIR) -name '*$(LIB_EXT)' -o -name '*$(SHLIB_EXT)'`
 
 libclean:
        -rm -f `find $(BLDDIR) -name '*$(LIB_EXT)' -o -name '*$(SHLIB_EXT)'`
 
-install: install_sw install_docs
+install: install_sw install_ssldirs install_docs
 
 uninstall: uninstall_docs uninstall_sw
 
 
 uninstall: uninstall_docs uninstall_sw
 
@@ -195,6 +202,10 @@ install_docs: install_man_docs install_html_docs
 
 uninstall_docs: uninstall_man_docs uninstall_html_docs
 
 
 uninstall_docs: uninstall_man_docs uninstall_html_docs
 
+install_ssldirs:
+       @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/certs
+       @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/private
+
 install_dev:
        @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
        @echo "*** Installing development files"
 install_dev:
        @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
        @echo "*** Installing development files"
@@ -235,9 +246,9 @@ install_dev:
                chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.a.new; \
                mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.a.new \
                      $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.a; \
                chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.a.new; \
                mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.a.new \
                      $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.a; \
-               : {- output_on() -}; \
+               : {- output_on() unless windowsdll(); "" -}; \
        done
        done
-       @ : {- output_on() -}
+       @ : {- output_on() if $config{no_shared}; "" -}
        @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
        @echo "install libcrypto.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc"
        @cp libcrypto.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
        @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
        @echo "install libcrypto.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc"
        @cp libcrypto.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
@@ -274,7 +285,7 @@ uninstall_dev:
                : {- output_off() unless windowsdll(); "" -}; \
                echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.a"; \
                $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.a; \
                : {- output_off() unless windowsdll(); "" -}; \
                echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.a"; \
                $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.a; \
-               : {- output_on() -}; \
+               : {- output_on() unless windowsdll(); "" -}; \
        done
        @echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc"
        @$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
        done
        @echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc"
        @$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
@@ -318,7 +329,7 @@ install_runtime:
                mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
                      $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
        done
                mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
                      $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
        done
-       : {- output_on() -};
+       : {- output_on() unless windowsdll(); "" -};
        @set -e; for x in $(PROGRAMS); do \
                fn=`basename $$x`; \
                echo "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
        @set -e; for x in $(PROGRAMS); do \
                fn=`basename $$x`; \
                echo "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
@@ -374,7 +385,7 @@ uninstall_runtime:
                echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
                $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
        done
                echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
                $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
        done
-       : {- output_on() -};
+       : {- output_on() unless windowsdll(); "" -};
        $(RM) $(DESTDIR)$(OPENSSLDIR)/openssl.cnf
 
 # A method to extract all names from a .pod file
        $(RM) $(DESTDIR)$(OPENSSLDIR)/openssl.cnf
 
 # A method to extract all names from a .pod file
@@ -406,7 +417,14 @@ PROCESS_PODS=\
                names=`cat $$p | $(EXTRACT_NAMES)`; \
                ( cd $$top/man$$SEC; \
                  for n in $$names; do \
                names=`cat $$p | $(EXTRACT_NAMES)`; \
                ( cd $$top/man$$SEC; \
                  for n in $$names; do \
-                     if [ "$$n" != "$$fn" ]; then \
+                     comp_n="$$n"; \
+                     comp_fn="$$fn"; \
+                     case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
+                         comp_n=`echo "$$n" | tr [A-Z] [a-z]`; \
+                         comp_fn=`echo "$$fn" | tr [A-Z] [a-z]`; \
+                         ;; \
+                     esac; \
+                     if [ "$$comp_n" != "$$comp_fn" ]; then \
                          echo "link $$top/man$$SEC/$$n$$suf -> $$top/man$$SEC/$$fn$$suf"; \
                          PLATFORM=$(PLATFORM) $$point $$fn$$suf $$n$$suf; \
                      fi; \
                          echo "link $$top/man$$SEC/$$n$$suf -> $$top/man$$SEC/$$fn$$suf"; \
                          PLATFORM=$(PLATFORM) $$point $$fn$$suf $$n$$suf; \
                      fi; \
@@ -429,7 +447,14 @@ UNINSTALL_DOCS=\
                $(RM) $$top/man$$SEC/$$fn$$suf; \
                names=`cat $$p | $(EXTRACT_NAMES)`; \
                for n in $$names; do \
                $(RM) $$top/man$$SEC/$$fn$$suf; \
                names=`cat $$p | $(EXTRACT_NAMES)`; \
                for n in $$names; do \
-                   if [ "$$n" != "$$fn" ]; then \
+                   comp_n="$$n"; \
+                   comp_fn="$$fn"; \
+                   case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
+                       comp_n=`echo "$$n" | tr [A-Z] [a-z]`; \
+                       comp_fn=`echo "$$fn" | tr [A-Z] [a-z]`; \
+                       ;; \
+                   esac; \
+                   if [ "$$comp_n" != "$$comp_fn" ]; then \
                        echo "$(RM) $$top/man$$SEC/$$n$$suf"; \
                        $(RM) $$top/man$$SEC/$$n$$suf; \
                    fi; \
                        echo "$(RM) $$top/man$$SEC/$$n$$suf"; \
                        $(RM) $$top/man$$SEC/$$n$$suf; \
                    fi; \
@@ -776,6 +801,7 @@ $shlibtarget : $lib\$(LIB_EXT) $deps $ordinalsfile
                CC="\$(CC)" CFLAGS="\$(CFLAGS)" LDFLAGS="\$(LDFLAGS)" \\
                CROSS_COMPILE="\$(CROSS_COMPILE)" \\
                SHARED_LDFLAGS="\$(SHARED_LDFLAGS)" SHLIB_EXT=\$(SHLIB_EXT) \\
                CC="\$(CC)" CFLAGS="\$(CFLAGS)" LDFLAGS="\$(LDFLAGS)" \\
                CROSS_COMPILE="\$(CROSS_COMPILE)" \\
                SHARED_LDFLAGS="\$(SHARED_LDFLAGS)" SHLIB_EXT=\$(SHLIB_EXT) \\
+               SHARED_RCFLAGS="\$(SHARED_RCFLAGS)" \\
                link_a.$shlib_target
 EOF
          . (windowsdll() ? <<"EOF" : "");
                link_a.$shlib_target
 EOF
          . (windowsdll() ? <<"EOF" : "");
@@ -841,7 +867,7 @@ $bin\$(EXE_EXT) : $objs $deps
        \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
                PERL=\$(PERL) SRCDIR=\$(SRCDIR) \\
                APPNAME=$bin OBJECTS="$objs" \\
        \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
                PERL=\$(PERL) SRCDIR=\$(SRCDIR) \\
                APPNAME=$bin OBJECTS="$objs" \\
-               LIBDEPS="\$(PLIB_LDFLAGS) \$(LDFLAGS) $linklibs \$(EX_LIBS)" \\
+               LIBDEPS="\$(PLIB_LDFLAGS) $linklibs \$(EX_LIBS)" \\
                CC="\$(CC)" CFLAGS="\$(CFLAGS)" LDFLAGS="\$(LDFLAGS)" \\
                LIBRPATH="\$(INSTALLTOP)/\$(LIBDIR)" \\
                link_app.$shlib_target
                CC="\$(CC)" CFLAGS="\$(CFLAGS)" LDFLAGS="\$(LDFLAGS)" \\
                LIBRPATH="\$(INSTALLTOP)/\$(LIBDIR)" \\
                link_app.$shlib_target
@@ -856,7 +882,8 @@ EOF
                            rel2abs($config{builddir}));
       return <<"EOF";
 $script : $sources
                            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
   }
        chmod a+x $script
 EOF
   }