Skip to content

Commit

Permalink
java build infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
knan-linpro committed Oct 12, 2009
1 parent 856e878 commit 105032c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ INSTALL := ./install-sh
DIR := $(shell /bin/pwd | sed 's/^.*\///')
INFILES := $(shell find . -name '*.in' | sed 's/\.\/\(.*\)\.in$$/build\/\1/')
INFILES_MASTER := $(shell find master -name '*.in' | sed 's/\(.*\)\.in$$/build\/\1/')
CLASSFILES := $(shell find plugins/javalib/ -name '*.java' | sed 's/\(.*\)\.java$$/build\/\1.class/')
PLUGINS := $(wildcard plugins/node.d.$(OSTYPE)/* plugins/node.d/*)
MANCENTER := "Munin Documentation"
MAN8 := master/_bin/munin-graph master/_bin/munin-update \
Expand All @@ -35,6 +36,11 @@ PODMAN5 := master/doc/munin.conf node/doc/munin-node.conf

.SECONDARY: node/Build master/Build plugins/Build

.SUFFIXES: .java .class

.java.class:
cd plugins/javalib && $(JC) $(JFLAGS) $(subst plugins/javalib/,,$*.java)

default: build

uninstall:
Expand Down Expand Up @@ -125,6 +131,7 @@ install-plugins-prime: install-plugins build $(PLUGINS) Makefile Makefile.config
fi \
done
-mv $(LIBDIR)/plugins/*.adv $(LIBDIR)
$(INSTALL) -m 0644 build/plugins/javalib/munin-plugins.jar $(LIBDIR)
$(INSTALL) -m 0644 build/plugins/plugins.history $(LIBDIR)/plugins/
$(INSTALL) -m 0644 build/plugins/plugin.sh $(LIBDIR)/plugins/

Expand Down Expand Up @@ -261,6 +268,15 @@ build-man-stamp: build Makefile Makefile.config
pod2man --section=5 --release=$(RELEASE) --center=$(MANCENTER) "$$f".pod > build/doc/`basename $$f .pod`.5; \
done

build-plugins: build/plugins/javalib/munin-plugins.jar

build/plugins/javalib/munin-plugins.jar: $(CLASSFILES)
cd build/plugins/javalib && $(JAR) cf munin-plugins.jar org/

build/%.class: %.class
mkdir -p build/`dirname $*.class`
cp $*.class build/$*.class

######################################################################
# DIST RULES

Expand Down
5 changes: 5 additions & 0 deletions Makefile.config
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,10 @@ CHOWN := chown
CHMOD := chmod
CHGRP := chgrp

# Java compiler stuff - only needed on the buildhost
JC := javac
JFLAGS := -g
JAR := jar

# Check whether setruid functionality can be used
HASSETR := $(shell perl -e 'use Config; my @vars=("d_setruid", "d_setreuid", "d_setresuid"); foreach my $$var (@vars) { if ($$Config{$$var} eq "define") { print "1\n"; exit 0; } } print "0\n"; exit 0;' )
6 changes: 6 additions & 0 deletions Makefile.config-maint
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,9 @@ CHECKGROUP := $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "
CHOWN := chown
CHMOD := chmod
CHGRP := chgrp

# Java compiler stuff - only needed on the buildhost
JC := javac
JFLAGS := -g
JAR := jar

0 comments on commit 105032c

Please sign in to comment.