j2me_hello/Makefile

38 lines
664 B
Makefile

include env.mk
SRC = src
JC = $(JAVA_HOME)/bin/javac
JCFLAGS = -target 1.1 -source 1.2 -sourcepath $(SRC) -cp $(HEADERS) -Xlint:-options -d build -g:none
SRC_DIR := src
OUT_DIR := build
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
SRCS := $(call rwildcard,$(SRC_DIR),*.java)
CLS := $(SRCS:$(SRC_DIR)/%.java=$(OUT_DIR)/%.class)
.SUFFIXES: .java
.PHONY: all clean
all: pack
$(CLS): $(OUT_DIR)/%.class: $(SRC_DIR)/%.java
mkdir -p build
$(JC) $(JCFLAGS) $<
clean:
rm -rf build/
rm -f result.jar
pack result.jar: $(CLS)
jar -cmf META-INF/MANIFEST.MF result.jar -C build . -C res .
run:
$(EMULATOR) result.jar