2024-02-15 19:22:42 +00:00
|
|
|
include env.mk
|
|
|
|
|
|
|
|
SRC = src
|
2024-05-27 09:32:16 +00:00
|
|
|
|
|
|
|
JC = $(JAVA_HOME)/bin/javac
|
|
|
|
|
2024-02-15 19:22:42 +00:00
|
|
|
JCFLAGS = -target 1.1 -source 1.2 -sourcepath $(SRC) -cp $(HEADERS) -Xlint:-options -d build -g:none
|
|
|
|
|
|
|
|
SRC_DIR := src
|
|
|
|
|
|
|
|
OUT_DIR := build
|
|
|
|
|
2024-05-26 03:18:26 +00:00
|
|
|
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
|
|
|
|
|
|
|
|
SRCS := $(call rwildcard,$(SRC_DIR),*.java)
|
2024-02-15 19:22:42 +00:00
|
|
|
|
|
|
|
CLS := $(SRCS:$(SRC_DIR)/%.java=$(OUT_DIR)/%.class)
|
|
|
|
|
|
|
|
.SUFFIXES: .java
|
|
|
|
|
|
|
|
.PHONY: all clean
|
|
|
|
|
2024-02-17 13:02:12 +00:00
|
|
|
all: pack
|
2024-02-15 19:22:42 +00:00
|
|
|
|
|
|
|
$(CLS): $(OUT_DIR)/%.class: $(SRC_DIR)/%.java
|
|
|
|
mkdir -p build
|
2024-05-27 12:25:53 +00:00
|
|
|
$(JC) $(JCFLAGS) $?
|
2024-02-15 19:22:42 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf build/
|
|
|
|
rm -f result.jar
|
|
|
|
|
2024-02-17 13:02:12 +00:00
|
|
|
pack result.jar: $(CLS)
|
2024-05-27 11:05:39 +00:00
|
|
|
$(JAVA_HOME)/bin/jar -cmf META-INF/MANIFEST.MF result.jar -C build . -C res .
|
2024-02-15 19:22:42 +00:00
|
|
|
|
2024-05-27 11:18:08 +00:00
|
|
|
run: release
|
2024-02-15 19:22:42 +00:00
|
|
|
$(EMULATOR) result.jar
|