j2me_hello_kotlin/Makefile

40 lines
918 B
Makefile
Raw Permalink 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
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
SRCS := $(call rwildcard,$(SRC_DIR),*.kt)
2024-02-17 11:19:53 +00:00
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
2024-05-27 12:26:09 +00:00
$(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
2024-05-27 11:08:50 +00:00
$(PROGUARD) -include proguard.conf -libraryjars $(HEADERS) -libraryjars $(JAVA_HOME)/jre/lib/rt.jar -keepclassmembers class $(CLASSNAME) { public \<methods\> ';' } -keep public class $(CLASSNAME)
2024-02-17 11:19:53 +00:00
2024-02-17 15:01:40 +00:00
release jars/release.jar: jars/result.jar
-$(RETROTRANSLATOR) -srcjar jars/result.jar -destjar jars/release.jar
2024-05-27 11:04:58 +00:00
$(JAVA_HOME)/bin/jar -umf META-INF/MANIFEST.MF jars/release.jar -C res .
2024-02-17 11:19:53 +00:00
run: release
$(EMULATOR) jars/release.jar