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
|
|
|
|
$(JC) $(JCFLAGS) $<
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf build/
|
|
|
|
rm -f result.jar
|
|
|
|
|
2024-02-17 13:02:12 +00:00
|
|
|
pack result.jar: $(CLS)
|
2024-02-15 19:22:42 +00:00
|
|
|
jar -cmf META-INF/MANIFEST.MF result.jar -C build . -C res .
|
|
|
|
|
|
|
|
run:
|
|
|
|
$(EMULATOR) result.jar
|