-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (24 loc) · 989 Bytes
/
Makefile
File metadata and controls
33 lines (24 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#JDK8 = Z:/JDK8/bin/
#JMELIBS = Z:/JMELIBS/
JDK8 := "C:/Program Files"/Java/jdk1.8.0_45/bin/
JMELIBS := C:/Users/USER/Documents/NetBeansProjects/melibs/
JC := $(JDK8)javac
JAR := $(JDK8)jar
SRC := ./src
BUILD := ./build
DIST := ./dist
LIBS := ../UtilsFps/dist/UtilsFps.jar
PROJECT_NAME := $(notdir $(CURDIR))
CLASSPATHLIBS := $(if $(LIBS),$(if $(JMELIBS),;,$(null))$(subst $(space),;,$(LIBS)),$(null))
JFLAGS := -Xlint:-options -classpath "$(JMELIBS)$(CLASSPATHLIBS)" -source 1.3 -target 1.3 -sourcepath $(SRC) -d $(BUILD)
rwildcard = $(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
sources := $(call rwildcard, $(SRC), *.java)
classes := $(addsuffix .class, $(basename $(patsubst %, $(BUILD)/%, $(sources:$(SRC)/%=%))))
default: compile
#compile and build jar
compile:
$(JC) $(JFLAGS) $(sources)
$(JAR) -cf $(DIST)/$(PROJECT_NAME).jar -C $(BUILD) $(classes:$(BUILD)/%=%)
clean:
$(RM) $(BUILD)/*.class
$(RM) $(DIST)/$(PROJECT_NAME).jar