blob: 6f49c0c16912bfc6b90b79562451560defcad3c1 [file] [log] [blame] [raw]
JDK_HOME := /opt/jdk1.7.0_80
JDK_JAVAC = $(JDK_HOME)/bin/javac
JDK_JAVAC_FLAGS = -source 1.6 -target 1.6 -implicit:none -Xlint:deprecation
#JAR ?= $(JDK_HOME)/bin/jar
7Z ?= 7za
FML7_CLASS_PATH := /opt/minecraft/forge-1.7.10-10.13.2.1291-universal.jar
LAUNCHWRAPPER_CLASS_PATH := /opt/minecraft/libraries/net/minecraft/launchwrapper/1.11/launchwrapper-1.11.jar
ASM_CLASS_PATH := /opt/minecraft/libraries/org/ow2/asm/asm-all/5.0.3/asm-all-5.0.3.jar
CLASSES := \
build/rivoreo/minecraft/cauldronfix/FMLCoreMod.class \
build/rivoreo/minecraft/cauldronfix/CauldronFixTransformer.class
default: build cauldron-fix.jar
cauldron-fix.jar: $(CLASSES)
[ -d build/META-INF ] || mkdir -p build/META-INF
printf 'Manifest-Version: 1.0\nFMLCorePlugin: rivoreo.minecraft.cauldronfix.FMLCoreMod\nFMLCorePluginContainsMod: false\n' > build/META-INF/MANIFEST.MF
rm -f $@
cd build && $(7Z) a -tzip ../$@ META-INF/MANIFEST.MF $(patsubst build/%,%,$(subst $$,\$$,$^))
clean:
rm -f cauldron-fix.jar build/META-INF/MANIFEST.MF $(subst $$,\$$,$(CLASSES))
build:
mkdir $@
build/rivoreo/minecraft/cauldronfix/FML%.class: rivoreo/minecraft/cauldronfix/FML%.java
$(JDK_JAVAC) $(JDK_JAVAC_FLAGS) -classpath :$(FML7_CLASS_PATH) -d build $<
build/%.class: %.java
$(JDK_JAVAC) $(JDK_JAVAC_FLAGS) -classpath :$(ASM_CLASS_PATH):$(LAUNCHWRAPPER_CLASS_PATH) -d build $<
build/%$$*.class: %.java