blob: 10d56b1e0898148860fa48e60d50fad5a7ba7b8b [file] [log] [blame] [raw]
JDK7_HOME := /opt/jdk1.7.0_80
JDK7_JAVAC = $(JDK7_HOME)/bin/javac
JDK7_JAVAC_FLAGS = -source 1.6 -target 1.6
#JDK8_HOME := /opt/jdk1.8.0_65
#JDK8_JAVAC = $(JDK8_HOME)/bin/javac
#JAR = $(JDK7_HOME)/bin/jar
7Z ?= 7za
#SPONGE_CLASS_PATH = /opt/minecraft/sponge/spongeapi-7.1.0-shaded.jar
BUKKIT_CLASS_PATH = /opt/minecraft/forge-cauldron-1.7.10-1.1206.01.170-server.jar
CLASS_PATH = ../java-config/config.jar
BUKKIT_PLUGIN_CLASSES := \
build/org/rivoreo/net/Inet4AddressBlock.class \
build/org/rivoreo/minecraft/tsauth/BukkitPlugin.class
default: build tsauth-bukkit.jar
tsauth-bukkit.jar: build/META-INF/MANIFEST.MF build/COPYING $(BUKKIT_PLUGIN_CLASSES) build/config.yml build/plugin.yml
rm -f $@
cd build && $(7Z) a -tzip ../$@ $(patsubst build/%,%,$(subst $$,\$$,$^))
clean:
rm -f tsauth-bukkit.jar build/META-INF/MANIFEST.MF build/COPYING $(BUKKIT_PLUGIN_CLASSES) build/config.yml build/plugin.yml
build:
mkdir $@
build/org/rivoreo/minecraft/tsauth/Bukkit%.class: org/rivoreo/minecraft/tsauth/Bukkit%.java
$(JDK7_JAVAC) $(JDK_JAVAC_FLAGS) -classpath $(BUKKIT_CLASS_PATH):$(CLASS_PATH): -d build $<
build/%.class: %.java
$(JDK7_JAVAC) $(JDK_JAVAC_FLAGS) -classpath $(CLASS_PATH): -d build $<
build/%$$*.class: %.java
build/%.yml: %.yml
cp -p $< $@
build/META-INF/MANIFEST.MF:
[ -d build/META-INF ] || mkdir -p build/META-INF
echo "Class-Path: libs/rivoreo.config.jar" > $@
build/COPYING: COPYING
cp -p $< $@