j2me_hello_kotlin/Makefile

40 lines
918 B
Makefile

include env.mk
SRC = src
SRC_DIR := src
RES_DIR := res
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
SRCS := $(call rwildcard,$(SRC_DIR),*.kt)
CLASSNAME := com.Hello
KOTLINC = kotlinc
KOTLINFLAGS = -cp $(HEADERS) -d jars/classes.jar -jvm-target 1.8 -include-runtime
.SUFFIXES: .kt
.PHONY: all clean
all: release
jars/classes.jar: $(SRCS)
@mkdir -p jars
$(KOTLINC) $(KOTLINFLAGS) $?
clean:
rm -rf jars/
jars/result.jar: jars/classes.jar
$(PROGUARD) -include proguard.conf -libraryjars $(HEADERS) -libraryjars $(JAVA_HOME)/jre/lib/rt.jar -keepclassmembers class $(CLASSNAME) { public \<methods\> ';' } -keep public class $(CLASSNAME)
release jars/release.jar: jars/result.jar
-$(RETROTRANSLATOR) -srcjar jars/result.jar -destjar jars/release.jar
$(JAVA_HOME)/bin/jar -umf META-INF/MANIFEST.MF jars/release.jar -C res .
run: release
$(EMULATOR) jars/release.jar