42 lines
708 B
Makefile
42 lines
708 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
|
|
KOTLINOPT = -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) $(KOTLINOPT) $<
|
|
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
|