summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 935fb32b0fbf226e5abda4b0e66ee9a81cebb2f2 (plain)
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
MAINCLASS := Sub
JAVAC_ARGS := -Xlint:all

.PHONY: all run pack build dirs clean
all: build

run: build
	cd bin && java -Dawt.useSystemAAFontSettings=on -cp ../lib/gson-2.6.2.jar:. $(MAINCLASS)

.ONESHELL:
pack: build
	echo "Main-Class: $(MAINCLASS)" > jar/manifest.txt
	jar cvfm jar/$(MAINCLASS).jar jar/manifest.txt -C bin/ .
	rm jar/manifest.txt
	cp lib/gson-2.6.2.jar jar/
	cd jar
	jar xf gson-2.6.2.jar
	rm META-INF -R
	jar xf Sub.jar
	rm gson-2.6.2.jar
	rm Sub.jar
	zip -r Subconcious.jar ./*
	find . ! -name 'Subconcious.jar' -type f -exec rm -f {} +
	rm -R com META-INF

build: dirs
	javac $(JAVAC_ARGS) -cp lib/gson-2.6.2.jar:. -d bin/ src/*.java

dirs:
	mkdir -p src bin jar

clean:
	rm -R jar/*
	rm bin/*