36 lines
679 B
Makefile
36 lines
679 B
Makefile
include env.mk
|
|
|
|
JC = $(JAVA_HOME)/bin/javac
|
|
|
|
JCFLAGS = -target 1.1 -source 1.2 -sourcepath $(SRC_DIR) -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)
|
|
$(JAVA_HOME)/bin/jar -cmf META-INF/MANIFEST.MF result.jar -C build . -C res .
|
|
|
|
run: pack
|
|
$(EMULATOR) result.jar
|