j2me_hello_kotlin/Makefile

38 lines
707 B
Makefile
Raw Normal View History

2024-02-17 11:19:53 +00:00
include env.mk
SRC = src
SRC_DIR := src
2024-02-17 11:27:19 +00:00
RES_DIR := res
2024-02-17 11:19:53 +00:00
SRCS := $(wildcard $(SRC_DIR)/*/*.kt)
2024-02-17 15:01:40 +00:00
CLASSNAME := com.Hello
2024-02-17 11:19:53 +00:00
KOTLINC = kotlinc
2024-02-17 15:01:40 +00:00
KOTLINFLAGS = -cp $(HEADERS) -d jars/classes.jar -jvm-target 1.8 -include-runtime
2024-02-17 11:19:53 +00:00
.SUFFIXES: .kt
.PHONY: all clean
2024-05-25 23:16:04 +00:00
all: release
2024-02-17 11:19:53 +00:00
2024-02-17 15:01:40 +00:00
jars/classes.jar: $(SRCS)
@mkdir -p jars
$(KOTLINC) $(KOTLINFLAGS) $<
2024-02-17 11:19:53 +00:00
clean:
2024-02-17 15:01:40 +00:00
rm -rf jars/
2024-02-17 11:19:53 +00:00
2024-02-17 15:01:40 +00:00
jars/result.jar: jars/classes.jar
-$(RETROTRANSLATOR) -srcjar jars/classes.jar -destjar jars/result.jar
jar -umf META-INF/MANIFEST.MF jars/result.jar -C res .
2024-02-17 11:19:53 +00:00
2024-02-17 15:01:40 +00:00
release jars/release.jar: jars/result.jar
proguard -include proguard.conf -keepclassmembers class $(CLASSNAME) { public \<methods\> ';' }
2024-02-17 11:19:53 +00:00
run:
2024-02-17 15:01:40 +00:00
$(EMULATOR) jars/result.jar