forked from munin-monitoring/munin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.javaplugin
42 lines (32 loc) · 1.31 KB
/
Makefile.javaplugin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#
# Makefile fragment to build and install the java plugin
######################################################################
# Java
ifeq ($(JCVALID),yes)
JAVA_BUILD=build-plugins-java
JAVA_INSTALL=install-plugins-java
JAVA_PLUGINS=plugins/node.d.java/*
endif
JAVA_SRCDIR := plugins/javalib
JAVA_DSTDIR := _stage/plugins/javalib
JAVA_FILES := $(wildcard plugins/javalib/org/munin/plugin/jmx/*.java)
JAVA_CLASSES := $(patsubst %.java,%.class,$(JAVA_FILES))
JC := javac
JFLAGS = -g -sourcepath $(JAVA_SRCDIR) -d $(JAVA_DSTDIR)
.PHONY: build-java
build-plugins-java: $(JAVA_DSTDIR)/munin-jmx-plugins.jar
$(JAVA_DSTDIR)/munin-jmx-plugins.jar: $(JAVA_DSTDIR)/org/munin/plugin/jmx
jar cf $@ -C $(JAVA_DSTDIR) org/munin/plugin/jmx
$(JAVA_DSTDIR)/org/munin/plugin/jmx: $(JAVA_FILES)
mkdir -p $(JAVA_DSTDIR)
$(JC) $(JFLAGS) $^
install-plugins-java: _stage/plugins/javalib/munin-jmx-plugins.jar
mkdir -p $(JAVALIBDIR)
$(INSTALL) -m 0644 _stage/plugins/javalib/munin-jmx-plugins.jar $(JAVALIBDIR)/
mkdir -p $(LIBDIR)/plugins
for p in _stage/plugins/node.d.java/*; do \
if test -f "$$p" ; then \
echo Installing $$p; \
$(INSTALL) -m 0755 $$p $(LIBDIR)/plugins/; \
fi \
done