This repository has been archived by the owner on Nov 17, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile
77 lines (62 loc) · 2.3 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
MCVER = 1.4.5
MCJAR = ../bin/minecraft.jar
MCJARV = ../bin/minecraft-$(MCVER).jar
MODJAR = ../mcpatcher-mods/mcpatcher-builtin.jar
MCPATCHER = out/artifacts/mcpatcher/mcpatcher.jar
JIP = $(HOME)/jip-1.2/profile/profile.jar
LAUNCH4J = $(HOME)/launch4j/launch4j
LAUNCH4J_XML = launch4j.xml
CLASSPATH = lib/javassist.jar
PACKAGE = com.pclewis.mcpatcher
DOC_OUT = doc/javadoc
DOC_SRC = $(PACKAGE)
DOC_SRCPATH = shared/src:stubs/src:newcode/src:src:
TEST_OPTS = -ignoresavedmods -ignorecustommods -enableallmods -auto -loglevel 5
TEST_LOG = test.log
GOOD_LOG = good.log
TMPDIR = t.1
FILTER = ./testfilter.pl
.PHONY: default build release run test testfilter javadoc control profile clean modjar restore
default:
build: $(MCPATCHER)
ant
release: $(MCPATCHER)
cp -pf $(MCPATCHER) mcpatcher-$(shell java -jar $(MCPATCHER) -version).jar
sed -e 's/VERSION/$(shell java -jar $(MCPATCHER) -version)/g' $(LAUNCH4J_XML) > $(LAUNCH4J_XML).tmp
$(LAUNCH4J) $(shell pwd)/$(LAUNCH4J_XML).tmp
rm -f $(LAUNCH4J_XML).tmp
run: $(MCPATCHER)
java -jar $(MCPATCHER)
runexp: $(MCPATCHER)
java -jar $(MCPATCHER) -experimental
test: $(MCPATCHER)
time java -jar $(MCPATCHER) $(TEST_OPTS) > $(TEST_LOG) 2>&1
diff -c $(GOOD_LOG) $(TEST_LOG)
rm -f $(TEST_LOG)
testfilter: $(MCPATCHER)
time java -jar $(MCPATCHER) $(TEST_OPTS) > $(TEST_LOG) 2>&1
@$(FILTER) $(TEST_LOG) > $(TEST_LOG).1
@$(FILTER) $(GOOD_LOG) > $(GOOD_LOG).1
diff -c $(GOOD_LOG).1 $(TEST_LOG).1
rm -f $(TEST_LOG) $(TEST_LOG).1 $(GOOD_LOG).1
javadoc:
rm -rf $(DOC_OUT)
mkdir -p $(DOC_OUT)
javadoc -protected -splitindex -classpath $(CLASSPATH) -d $(DOC_OUT) $(DOC_SRC) -sourcepath $(DOC_SRCPATH)
control: $(TEST_LOG)
cp -f $(TEST_LOG) $(GOOD_LOG)
profile: $(MCPATCHER) $(JIP)
java -Xmx512M -javaagent:$(JIP) -Dprofile.properties=profile.properties -jar $(MCPATCHER) $(TEST_OPTS) > $(TEST_LOG) 2>&1
testclean:
rm -f $(TEST_LOG) $(TEST_LOG).1 $(GOOD_LOG).1
clean: testclean
rm -rf $(MCPATCHER) $(DOC_OUT) $(MODJAR) out $(LAUNCH4J_XML).tmp mcpatcher-*.jar mcpatcher-*.exe profile.txt profile.xml
modjar: $(MCPATCHER)
rm -rf $(TMPDIR)
mkdir -p $(TMPDIR)
cd $(TMPDIR) && jar -xf ../$(MCPATCHER)
cd $(TMPDIR) && rm -rf javassist META-INF *.class com/intellij com/pclewis/mcpatcher/*.class
cd $(TMPDIR) && jar -cf ../$(MODJAR) *
rm -rf $(TMPDIR)
restore: $(MCJARV)
cp -pf $(MCJARV) $(MCJAR)