diff options
Diffstat (limited to 'makefiles/gmake/install.mk')
-rw-r--r-- | makefiles/gmake/install.mk | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/makefiles/gmake/install.mk b/makefiles/gmake/install.mk index 225c999..ac6d49d 100644 --- a/makefiles/gmake/install.mk +++ b/makefiles/gmake/install.mk @@ -6,6 +6,7 @@ # # provides: # - target: install +# - target: uninstall # default values DESTDIR= @@ -28,3 +29,36 @@ install_recursive: (set -e; $(MAKE) -C $$d install || exit 1); done) install: install_recursive local_install install_po + @test -d "$(libdir)" || mkdir -p "$(libdir)" + @test -z "$(STATIC_LIB)" || ( \ + $(INSTALL) -m 644 $(STATIC_LIB) $(libdir)/$(STATIC_LIB) ) + @test -z "$(DYNAMIC_LIB)" || ( \ + $(INSTALL) -m 755 $(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR).$(DYNAMIC_LIB_MINOR).$(DYNAMIC_LIB_PATCH) \ + $(libdir)/$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR).$(DYNAMIC_LIB_MINOR).$(DYNAMIC_LIB_PATCH) ) + @test -z "$(DYNAMIC_LIB)" || ( \ + rm -f "$(libdir)/$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR)" && \ + ln -s "$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR).$(DYNAMIC_LIB_MINOR).$(DYNAMIC_LIB_PATCH)" \ + "$(libdir)/$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR)" ) + @test -z "$(DYNAMIC_LIB)" || ( \ + rm -f "$(libdir)/$(DYNAMIC_LIB)" && \ + ln -s "$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR).$(DYNAMIC_LIB_MINOR).$(DYNAMIC_LIB_PATCH)" \ + "$(libdir)/$(DYNAMIC_LIB)" ) + +.PHONY: uninstall_recursive uninstall local_uninstall + +uninstall_recursive: + @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \ + (set -e; $(MAKE) -C $$d uninstall || exit 1); done) + +uninstall: uninstall_recursive local_uninstall uninstall_po + test -z "$(DYNAMIC_LIB)" || ( \ + test ! -f "$(libdir)/$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR).$(DYNAMIC_LIB_MINOR).$(DYNAMIC_LIB_PATCH)" || \ + rm "$(libdir)/$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR).$(DYNAMIC_LIB_MINOR).$(DYNAMIC_LIB_PATCH)" ) + test -z "$(DYNAMIC_LIB)" || ( \ + test ! -h "$(libdir)/$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR)" || \ + rm "$(libdir)/$(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR)" ) + test -z "$(DYNAMIC_LIB)" || ( \ + test ! -h "$(libdir)/$(DYNAMIC_LIB)" || \ + rm "$(libdir)/$(DYNAMIC_LIB)" ) + test -z "$(STATIC_LIB)" || ( \ + test ! -f "$(libdir)/$(STATIC_LIB)" || rm "$(libdir)/$(STATIC_LIB)" ) |