summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2018-11-20 17:05:06 +0100
committerNao Pross <naopross@thearcway.org>2018-11-20 17:05:06 +0100
commit97f6b7ed1254d18676f9df8be6e0b88c02e414b1 (patch)
treef5cc4a065606b1ecc313f3812f081dbf48bc80ae /Makefile
parentMake x y members of Tile public (diff)
downloadSubconscious-java-97f6b7ed1254d18676f9df8be6e0b88c02e414b1.tar.gz
Subconscious-java-97f6b7ed1254d18676f9df8be6e0b88c02e414b1.zip
Update makefile to allow debugging with jdb
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 18 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index bdb14d3..6029251 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,27 @@
+# project classes configuration
MAINCLASS := subconscious.Subconscious
+SOURCES := $(shell find src -iname '*.java')
+# java compiler configuraton
JAVAC := javac
JAVAC_ARGS := -Xlint:all \
-classpath lib/gson-2.6.2.jar:. \
-sourcepath src
-SOURCES := $(shell find src -iname '*.java')
+# java debugger configuration
+JDB := jdb
+JDB_ARGS := -attach jdbconn
+USE_JDB := 0
+
+# java runtime configuration
+JAVA := java
+JAVA_ARGS := -Dawt.useSystemAAFontSettings=on -cp ../lib/gson-2.6.2.jar:.
+ifeq ($(USE_JDB),1)
+ JAVA_ARGS += -agentlib:jdwp=transport=dt_socket,server=y,suspend=n
+endif
+
+# recipes
.PHONY: all run pack classes dirs clean
all: classes
@@ -16,7 +31,7 @@ classes:
.ONESHELL:
run: classes
cd build
- java -Dawt.useSystemAAFontSettings=on -cp ../lib/gson-2.6.2.jar:. $(MAINCLASS)
+ $(JAVA) $(JAVA_ARGS) $(MAINCLASS)
.ONESHELL:
pack: classes
@@ -34,9 +49,8 @@ pack: classes
find . ! -name 'Subconcious.jar' -type f -exec rm -f {} +
rm -R com META-INF
-
dirs:
mkdir -p build
clean:
- rm -rd build \ No newline at end of file
+ rm -rd build