aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-09-05 20:48:13 +0200
committerMattias Andrée <maandree@operamail.com>2014-09-05 20:48:13 +0200
commit9f45fb87c5156b6b6f613211764977ee29afb762 (patch)
treee8abc48231a2abcc687678ebf7d3c0d5afd77ae2
parentadd test and fix some small errors (diff)
downloadjlibgamma-9f45fb87c5156b6b6f613211764977ee29afb762.tar.gz
jlibgamma-9f45fb87c5156b6b6f613211764977ee29afb762.tar.bz2
jlibgamma-9f45fb87c5156b6b6f613211764977ee29afb762.tar.xz
add install and uninstall rules
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--Makefile54
1 files changed, 54 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index c02e619..d5d0a8b 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,8 @@ DATA ?= /share
LIBDIR ?= $(PREFIX)$(LIB)
# The resource path including prefix
DATADIR ?= $(PREFIX)$(DATA)
+# Java module path including prefix
+JAVADIR ?= $(DATADIR)/java
# The generic documentation path including prefix
DOCDIR ?= $(DATADIR)/doc
# The info manual documentation path including prefix
@@ -165,11 +167,63 @@ bin/Test.class: src/Test.java bin/jlibgamma.jar $(SO_FILES)
$(JAVAC) $(JAVAC_FLAGS) -cp 'src:bin/jlibgamma.jar' -s src -d bin $<
+
+.PHONY: install
+install: install-base
+
+.PHONY: install
+install-all: install-base
+
+.PHONY: install-base
+install-base: install-lib install-jar install-copyright
+
+
+.PHONY: install-lib
+install-lib:
+ install -dm755 -- "$(DESTDIR)$(LIBDIR)"
+ install -m755 bin/libgamma-java.$(SO).$(LIB_VERSION) -- "$(DESTDIR)$(LIBDIR)/libgamma-java.$(SO).$(LIB_VERSION)"
+ ln -sf libgamma-java.$(SO).$(LIB_VERSION) -- "$(DESTDIR)$(LIBDIR)/libgamma-java.$(SO).$(LIB_MAJOR)"
+ ln -sf libgamma-java.$(SO).$(LIB_VERSION) -- "$(DESTDIR)$(LIBDIR)/libgamma-java.$(SO)"
+
+.PHONY: install-jar
+install-jar:
+ install -dm755 -- "$(DESTDIR)$(JAVADIR)"
+ install -m644 bin/jlibgamma.jar -- "$(DESTDIR)$(JAVADIR)/jlibgamma.jar"
+
+
+.PHONY: install-copyright
+install-copyright: install-copying install-license
+
+.PHONY: install-copying
+install-copying:
+ install -dm755 -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
+ install -m644 COPYING -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/COPYING"
+
+.PHONY: install-license
+install-license:
+ install -dm755 -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
+ install -m644 LICENSE -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE"
+
+
+
+.PHONY: uninstall
+uninstall:
+ -rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE"
+ -rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/COPYING"
+ -rmdir -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
+ -rm -- "$(DESTDIR)$(JAVADIR)/jlibgamma.jar"
+ -rm -- "$(DESTDIR)$(LIBDIR)/libgamma-java.$(SO).$(LIB_VERSION)"
+ -rm -- "$(DESTDIR)$(LIBDIR)/libgamma-java.$(SO).$(LIB_MAJRO)"
+ -rm -- "$(DESTDIR)$(LIBDIR)/libgamma-java.$(SO)"
+
+
+
.PHONY: clean
clean:
-rm -r obj bin
+
.PHONY: run-test
run-test: bin/Test.class
@env LD_LIBRARY_PATH=bin java -cp bin:bin/jlibgamma.jar Test