-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
executable file
·63 lines (47 loc) · 1.34 KB
/
GNUmakefile
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Default: all
TOP=..
ifeq (x, x$(JAVA_HOME))
$(error "Please set the JAVA_HOME environment variable.")
endif
ifeq (Windows, $(findstring Windows,$(OS)))
CLN=;
else
CLN=:
endif
NULL:=
SPACE:=$(NULL) # end of the line
SHELL=/bin/sh
JAVA=$(JAVA_HOME)/bin/java
JAVAC=$(JAVA_HOME)/bin/javac
JAR=$(JAVA_HOME)/bin/jar
JAVACFLAGS=-Xlint:unchecked -deprecation
CLASSLIB=$(JAVA_HOME)/jre/lib/rt.jar
RSRC=rsrc
LIBDIR=$(RSRC)/lib
LIB=$(subst $(SPACE),$(CLN),$(filter %.jar %.zip, $(wildcard $(LIBDIR)/*)))
BUILD=build
SRC=src
DOCS=docs
CLASSPATH="$(CLASSLIB)$(CLN)$(LIB)$(CLN)$(SRC)"
CWD=$(shell pwd)
include classes.mk
CLASS_FILES:=$(foreach class, $(CLASSES), $(BUILD)/$(subst .,/,$(class)).class)
PACKAGES=$(sort $(basename $(CLASSES)))
PACKAGEDIRS=$(subst .,/,$(PACKAGES))
all: tar.jar
tar.jar: classes
$(JAR) cvf $@ -C $(BUILD)/ .
javadocs:
mkdir -p $(DOCS)
$(JAVA_HOME)/bin/javadoc -d $(DOCS) -classpath $(CLASSPATH) $(PACKAGES)
clean:
rm -f tar.jar
rm -rf $(BUILD)
install: tar.jar
cp $< $(TOP)/jOVAL-Commercial/components/provider/offline/rsrc/lib
classes: classdirs $(CLASS_FILES)
classdirs: $(foreach pkg, $(PACKAGEDIRS), $(BUILD)/$(pkg)/)
$(BUILD)/%.class: $(SRC)/%.java
$(JAVAC) $(JAVACFLAGS) -d $(BUILD) -classpath $(CLASSPATH) $<
$(BUILD)/%/:
mkdir -p $(subst PKG,,$@)