-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
50 lines (34 loc) · 1.06 KB
/
Makefile
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
# source directory
SOURCE_DIR = src/
# branch directories
DIRS := zoogas zoogas/gui zoogas/network zoogas/core zoogas/core/rules zoogas/core/topology
# output dir
CLASSES_DIR = classes/
# program name
ZOOGAS = zoogas/ZooGas
# loader and world server
LOADER = zoogas/Loader
# set heap to 512MB
JAVA = java -Xmx512m -classpath $(CLASSES_DIR)
# max compiler warnings, use SOURCE_DIR as source directory and output classes to CLASSES_DIR
JAVAC = javac -Xlint:unchecked -sourcepath $(SOURCE_DIR) -d $(CLASSES_DIR)
MAINCLASSFILES := $(CLASSES_DIR)$(ZOOGAS).class
# targets
all zoogas: $(MAINCLASSFILES)
$(JAVA) $(ZOOGAS)
testserver: $(MAINCLASSFILES)
$(JAVA) $(ZOOGAS) -s
testclient: $(MAINCLASSFILES)
$(JAVA) $(ZOOGAS) -p 4445 -c localhost
loader: $(MAINCLASSFILES)
$(JAVA) $(LOADER)
jar: $(MAINCLASSFILES)
jar -c -v -m META-INF/MANIFEST.MF -f ZooGas.jar -C classes/ .
clean:
find . -name "*.class" -print0 | xargs -0 -r rm
$(MAINCLASSFILES): $(CLASSES_DIR)
$(JAVAC) $(SOURCE_DIR)$(ZOOGAS).java
$(CLASSES_DIR):
mkdir classes
# keep everything when done
.SECONDARY: