2024-02-17 11:19:53 +00:00
|
|
|
include env.mk
|
|
|
|
|
|
|
|
SRC = src
|
|
|
|
|
|
|
|
SRC_DIR := src
|
|
|
|
|
|
|
|
OUT_DIR := build
|
|
|
|
|
2024-02-17 11:27:19 +00:00
|
|
|
RES_DIR := res
|
|
|
|
|
2024-02-17 11:19:53 +00:00
|
|
|
SRCS := $(wildcard $(SRC_DIR)/*/*.kt)
|
|
|
|
|
|
|
|
CLS := $(SRCS:$(SRC_DIR)/%.kt=$(OUT_DIR)/%.class)
|
|
|
|
|
|
|
|
KOTLINC = kotlinc
|
2024-02-17 11:29:33 +00:00
|
|
|
KOTLINFLAGS = -cp $(HEADERS) -d $(OUT_DIR) -jvm-target 1.8
|
2024-02-17 11:19:53 +00:00
|
|
|
|
|
|
|
.SUFFIXES: .kt
|
|
|
|
|
|
|
|
.PHONY: all clean
|
|
|
|
|
2024-02-17 11:27:19 +00:00
|
|
|
all: translate
|
2024-02-17 11:19:53 +00:00
|
|
|
|
|
|
|
$(CLS): $(OUT_DIR)/%.class: $(SRC_DIR)/%.kt
|
2024-02-17 12:57:43 +00:00
|
|
|
@mkdir -p build
|
2024-02-17 11:29:33 +00:00
|
|
|
$(KOTLINC) $(KOTLINFLAGS) $<
|
2024-02-17 11:19:53 +00:00
|
|
|
rm -rf build/META-INF/
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf build/
|
|
|
|
rm -f result.jar
|
|
|
|
rm -f a.jar
|
|
|
|
|
2024-02-17 11:27:19 +00:00
|
|
|
pack a.jar: $(wildcard $(OUT_DIR)/*.class) $(wildcard $(RES_DIR)/*) $(CLS)
|
2024-02-17 11:19:53 +00:00
|
|
|
jar -cmf META-INF/MANIFEST.MF a.jar -C build . -C res .
|
|
|
|
|
2024-02-17 11:27:19 +00:00
|
|
|
translate result.jar: a.jar
|
2024-02-17 11:19:53 +00:00
|
|
|
$(RETROTRANSLATOR) -srcjar a.jar -destjar result.jar
|
|
|
|
|
|
|
|
run:
|
|
|
|
$(EMULATOR) result.jar
|