j2me_hello/Makefile

36 lines
679 B
Makefile
Raw Permalink Normal View History

2024-02-15 19:22:42 +00:00
include env.mk
2024-05-27 09:32:16 +00:00
JC = $(JAVA_HOME)/bin/javac
JCFLAGS = -target 1.1 -source 1.2 -sourcepath $(SRC_DIR) -cp $(HEADERS) -Xlint:-options -d build -g:none
2024-02-15 19:22:42 +00:00
SRC_DIR := src
OUT_DIR := build
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
run: pack
2024-02-15 19:22:42 +00:00
$(EMULATOR) result.jar