j2me_hello_kotlin/Makefile

42 lines
712 B
Makefile

include env.mk
SRC = src
SRC_DIR := src
OUT_DIR := build
RES_DIR := res
SRCS := $(wildcard $(SRC_DIR)/*/*.kt)
CLS := $(SRCS:$(SRC_DIR)/%.kt=$(OUT_DIR)/%.class)
KOTLINC = kotlinc
KOTLINFLAGS = -cp $(HEADERS) -d $(OUT_DIR) -jvm-target 1.8
.SUFFIXES: .kt
.PHONY: all clean
all: translate
$(CLS): $(OUT_DIR)/%.class: $(SRC_DIR)/%.kt
mkdir -p build
$(KOTLINC) $(KOTLINFLAGS) $<
rm -rf build/META-INF/
clean:
rm -rf build/
rm -f result.jar
rm -f a.jar
pack a.jar: $(wildcard $(OUT_DIR)/*.class) $(wildcard $(RES_DIR)/*) $(CLS)
jar -cmf META-INF/MANIFEST.MF a.jar -C build . -C res .
translate result.jar: a.jar
$(RETROTRANSLATOR) -srcjar a.jar -destjar result.jar
run:
$(EMULATOR) result.jar