blob: 89ca303ef062d295f699d6dbac4bf3ce69d221dc [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
#JAR ?= $(JDK_HOME)/bin/jar
7Z ?= 7za
FML7_CLASS_PATH := /opt/minecraft/forge-1.7.10-10.13.2.1291-universal.jar
FML8_CLASS_PATH := /opt/minecraft/forge-1.8.9-11.15.1.1722-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
FML7_CLASSES := \
build/rivoreo/minecraft/monospacefont/FML7CoreMod.class \
build/rivoreo/minecraft/monospacefont/MonospaceFontTransformer.class
FML8_CLASSES := \
build/rivoreo/minecraft/monospacefont/FML8CoreMod.class \
build/rivoreo/minecraft/monospacefont/MonospaceFontTransformer.class
default: build monospace-font-fml7.jar monospace-font-fml8.jar
monospace-font-fml7.jar: $(FML7_CLASSES)
[ -d build/META-INF ] || mkdir -p build/META-INF
printf 'Manifest-Version: 1.0\nFMLCorePlugin: rivoreo.minecraft.monospacefont.FML7CoreMod\nFMLCorePluginContainsMod: false\n' > build/META-INF/MANIFEST.MF
rm -f $@
cd build && $(7Z) a -tzip ../$@ META-INF/MANIFEST.MF $(patsubst build/%,%,$(subst $$,\$$,$^))
monospace-font-fml8.jar: $(FML8_CLASSES)
[ -d build/META-INF ] || mkdir -p build/META-INF
printf 'Manifest-Version: 1.0\nFMLCorePlugin: rivoreo.minecraft.monospacefont.FML8CoreMod\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 monospace-font.jar build/META-INF/MANIFEST.MF $(subst $$,\$$,$(FML7_CLASSES) $(FML8_CLASSES))
build:
mkdir $@
build/rivoreo/minecraft/monospacefont/FML7%.class: rivoreo/minecraft/monospacefont/FML7%.java
$(JDK_JAVAC) $(JDK_JAVAC_FLAGS) -classpath :$(FML7_CLASS_PATH) -d build $<
build/rivoreo/minecraft/monospacefont/FML8%.class: rivoreo/minecraft/monospacefont/FML8%.java
$(JDK_JAVAC) $(JDK_JAVAC_FLAGS) -classpath :$(FML8_CLASS_PATH) -d build $<
build/%.class: %.java
$(JDK_JAVAC) $(JDK_JAVAC_FLAGS) -classpath :$(ASM_CLASS_PATH):$(LAUNCHWRAPPER_CLASS_PATH) -d build $<
build/%$$*.class: %.java