Try removing installation directories after having uninstalled files
authorRichard Levitte <levitte@openssl.org>
Mon, 15 Feb 2016 21:12:24 +0000 (22:12 +0100)
committerRichard Levitte <levitte@openssl.org>
Fri, 19 Feb 2016 10:52:15 +0000 (11:52 +0100)
Of course, if there are remaining files in a directory, it won't be removed.

Reviewed-by: Andy Polyakov <appro@openssl.org>
Configurations/unix-Makefile.tmpl

index 24c6fdf1a2f76b808f8905768affb33d3a4775b5..a8d5cff3a83c3f05e96e4a1a77e3ba63db90c25d 100644 (file)
@@ -172,6 +172,7 @@ AR=$(CROSS_COMPILE){- $target{ar} || "ar" -} $(ARFLAGS) r
 RANLIB= {- $target{ranlib} -}
 NM= $(CROSS_COMPILE){- $target{nm} || "nm" -}
 RM= rm -f
+RMDIR= rmdir
 TAR= {- $target{tar} || "tar" -}
 TARFLAGS= {- $target{tarflags} -}
 MAKEDEPEND=$(CROSS_COMPILE){- $config{makedepprog} -}
@@ -327,6 +328,8 @@ uninstall_dev:
                echo "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
                $(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
        done
+       -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include/openssl
+       -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include
        @set -e; for l in $(LIBS); do \
                fn=`basename $$l`; \
                echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn"; \
@@ -357,6 +360,10 @@ uninstall_dev:
        @$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
        @echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc"
        @$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
+       @echo $(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
+       -@$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
+       @echo $(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)
+       -@$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)
 
 install_engines:
        @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
@@ -384,6 +391,8 @@ uninstall_engines:
                echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn"; \
                $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn; \
        done
+       @echo "$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines"
+       -@$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines
 
 install_runtime:
        @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
@@ -457,6 +466,10 @@ uninstall_runtime:
        done
        : {- output_on() unless windowsdll(); "" -};
        $(RM) $(DESTDIR)$(OPENSSLDIR)/openssl.cnf
+       @echo "$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin"
+       -@$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin
+       @echo "$(RMDIR) $(DESTDIR)$(OPENSSLDIR)/misc"
+       -@$(RMDIR) $(DESTDIR)$(OPENSSLDIR)/misc
 
 # A method to extract all names from a .pod file
 # The first sed extracts everything between "=head1 NAME" and the next =head1