info: java: add install/uninstall targets
authorFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 17 May 2019 15:56:57 +0000 (17:56 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 17 Jun 2019 21:04:49 +0000 (23:04 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Makefile
lib/info.java/Makefile

index 7b60ca0..cb17278 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -357,6 +357,12 @@ info_java:
 info_java_clean:
                $(MAKECMDPREFIX)$(MAKECMD) -C lib/info.java DESTDIR=$(DESTDIR) clean
 
+info_java_install:
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/info.java DESTDIR=$(DESTDIR) install
+
+info_java_uninstall:
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/info.java DESTDIR=$(DESTDIR) uninstall
+
 jsoninfo: info
                $(MAKECMDPREFIX)$(MAKECMD) -C lib/jsoninfo
 
index bd0f81d..54f7844 100644 (file)
 # the copyright holders.
 #
 
-OLSRD_PLUGIN = false
-PLUGIN_NAME =  olsrdinfo
-PLUGIN_VER =   0.0
+OLSRD_PLUGIN = false
+PLUGIN_NAME = olsrdinfo
+PLUGIN_VER = 0.0
 
 TOPDIR =       ../..
 include $(TOPDIR)/Makefile.inc
 
+DESTDIR ?=
+USRDIR ?= $(DESTDIR)/usr
+LIBDIR ?= $(USRDIR)/lib
+SHAREDIR ?= $(USRDIR)/share
+SHAREJAVADIR ?= $(SHAREDIR)/java/$(EXENAME)
+
+
+.PHONY: all default_target java install uninstall clean
+
 default_target: java
 
 all: java
@@ -65,3 +74,23 @@ clean:
       -PCI -Djsse.enableSNIExtension=false \
       clean
 
+
+install: all
+       mkdir -p "$(SHAREJAVADIR)/javadoc/info.java/api" \
+         "$(SHAREJAVADIR)/javadoc/info.java/all"
+       cp -t "$(SHAREJAVADIR)" \
+    org.olsr.v1.info.api/generated/org.olsr.v1.info.api.jar \
+    org.olsr.v1.info.proxy.api/generated/org.olsr.v1.info.proxy.api.jar \
+    org.olsr.v1.info.proxy/generated/org.olsr.v1.info.proxy.jar
+       cp -a -t "$(SHAREJAVADIR)/javadoc/info.java/api" javadoc-api/generated/javadoc/*
+       cp -a -t "$(SHAREJAVADIR)/javadoc/info.java/all" javadoc-all/generated/javadoc/*
+
+
+uninstall:
+       rm -f "$(SHAREJAVADIR)/org.olsr.v1.info.api.jar" \
+    "$(SHAREJAVADIR)/org.olsr.v1.info.proxy.api.jar" \
+    "$(SHAREJAVADIR)/org.olsr.v1.info.proxy.jar"
+       rm -fr "$(SHAREJAVADIR)/javadoc/info.java/api" \
+    "$(SHAREJAVADIR)/javadoc/info.java/all"
+       rmdir -p --ignore-fail-on-non-empty "$(SHAREJAVADIR)/javadoc/info.java"
+