From 2c176589c24093ae93ec45e8d208dce81c27a515 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Mon, 19 Nov 2018 13:11:43 +0100 Subject: Create java package for the project --- Makefile | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3955d69..bdb14d3 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,25 @@ -MAINCLASS := Subconscious -JAVAC_ARGS := -Xlint:all +MAINCLASS := subconscious.Subconscious -.PHONY: all run pack build dirs clean -all: build +JAVAC := javac +JAVAC_ARGS := -Xlint:all \ + -classpath lib/gson-2.6.2.jar:. \ + -sourcepath src -run: build - cd bin && java -Dawt.useSystemAAFontSettings=on -cp ../lib/gson-2.6.2.jar:. $(MAINCLASS) +SOURCES := $(shell find src -iname '*.java') + +.PHONY: all run pack classes dirs clean +all: classes + +classes: + $(JAVAC) $(JAVAC_ARGS) -d build $(SOURCES) .ONESHELL: -pack: build +run: classes + cd build + java -Dawt.useSystemAAFontSettings=on -cp ../lib/gson-2.6.2.jar:. $(MAINCLASS) + +.ONESHELL: +pack: classes echo "Main-Class: $(MAINCLASS)" > jar/manifest.txt jar cvfm jar/$(MAINCLASS).jar jar/manifest.txt -C bin/ . rm jar/manifest.txt @@ -22,13 +33,10 @@ pack: build 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 + mkdir -p build clean: - rm -R jar/* - rm bin/* + rm -rd build \ No newline at end of file -- cgit v1.2.1