Unified - do a better job when uninstalling
[openssl.git] / Configurations / unix-Makefile.tmpl
index 092a7b348c5c9d906d0929b8ba6b0565c582c682..175718c22aeb62f9edffa9c5c9d5f0d507cd1881 100644 (file)
@@ -87,7 +87,8 @@ ENGINESDIR={- use File::Spec::Functions;
               catdir($prefix,$libdir,"engines") -}
 
 MANDIR=$(INSTALLTOP)/share/man
-HTMLDIR=$(INSTALLTOP)/share/doc/$(BASENAME)/html
+DOCDIR=$(INSTALLTOP)/share/doc/$(BASENAME)
+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,
@@ -150,16 +151,16 @@ PROCESSOR= {- $config{processor} -}
 
 # The main targets ###################################################
 
-all: config.timestamp build_libs_nodep build_engines_nodep build_apps_nodep \
+all: configdata.pm build_libs_nodep build_engines_nodep build_apps_nodep \
      depend link-utils
 
-build_libs: config.timestamp build_libs_nodep depend
+build_libs: configdata.pm build_libs_nodep depend
 build_libs_nodep: libcrypto.pc libssl.pc openssl.pc
-build_engines: config.timestamp build_engines_nodep depend
+build_engines: configdata.pm build_engines_nodep depend
 build_engines_nodep: $(ENGINES)
-build_apps: config.timestamp build_apps_nodep depend
+build_apps: configdata.pm build_apps_nodep depend
 build_apps_nodep: $(PROGRAMS) $(SCRIPTS)
-build_tests: config.timestamp build_tests_nodep depend
+build_tests: configdata.pm build_tests_nodep depend
 build_tests_nodep: $(TESTPROGS)
 
 test tests: build_tests_nodep build_apps_nodep build_engines_nodep depend rehash
@@ -211,6 +212,7 @@ uninstall_sw: uninstall_dev uninstall_engines uninstall_runtime
 install_docs: install_man_docs install_html_docs
 
 uninstall_docs: uninstall_man_docs uninstall_html_docs
+       $(RM) -r -v $(DESTDIR)$(DOCDIR)
 
 install_ssldirs:
        @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/certs
@@ -469,6 +471,7 @@ UNINSTALL_DOCS=\
                        $(RM) $$top/man$$SEC/$$n$$suf; \
                    fi; \
                done; \
+               ( $(RMDIR) $$top/man$$SEC 2>/dev/null || exit 0 ); \
            done; \
        done
 
@@ -598,12 +601,12 @@ rehash: link-utils copy-certs build_apps_nodep
 
 link-utils: $(BLDDIR)/util/opensslwrap.sh $(BLDDIR)/util/shlib_wrap.sh
 
-$(BLDDIR)/util/opensslwrap.sh: config.timestamp
+$(BLDDIR)/util/opensslwrap.sh: configdata.pm
        @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
            mkdir -p "$(BLDDIR)/util"; \
            ln -sf "../$(SRCDIR)/util/opensslwrap.sh" "$(BLDDIR)/util"; \
        fi
-$(BLDDIR)/util/shlib_wrap.sh: config.timestamp
+$(BLDDIR)/util/shlib_wrap.sh: configdata.pm
        @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
            mkdir -p "$(BLDDIR)/util"; \
            ln -sf "../$(SRCDIR)/util/shlib_wrap.sh" "$(BLDDIR)/util"; \
@@ -661,7 +664,7 @@ FORCE:
 
 # Building targets ###################################################
 
-libcrypto.pc libssl.pc openssl.pc: config.timestamp $(LIBS)
+libcrypto.pc libssl.pc openssl.pc: configdata.pm $(LIBS)
 libcrypto.pc:
        @ ( echo 'prefix=$(INSTALLTOP)'; \
            echo 'exec_prefix=$${prefix}'; \
@@ -704,8 +707,8 @@ openssl.pc:
 # wasn't passed down automatically.  It's quite safe to use it like we do
 # below; if it doesn't exist, the result will be empty and 'make' will pick
 # up $(MAKEFLAGS) which is passed down as an environment variable.
-config.timestamp: {- $config{build_file_template} -} $(SRCDIR)/Configure $(SRCDIR)/config
-       @echo "Detected that {- $config{build_file_template} -}, $(SRCDIR)/Configure or $(SRCDIR)/config may have changed."
+configdata.pm: {- $config{build_file_template} -} $(SRCDIR)/Configure $(SRCDIR)/config
+       @echo "Detected changed: $?"
        @echo "Reconfiguring..."
        $(SRCDIR)/Configure reconf
        @echo "**************************************************"
@@ -713,7 +716,6 @@ config.timestamp: {- $config{build_file_template} -} $(SRCDIR)/Configure $(SRCDI
        @echo "***   Please run the same make command again   ***"
        @echo "***                                            ***"
        @echo "**************************************************"
-       @touch config.timestamp
        @false
 
 {-