From 97f6b7ed1254d18676f9df8be6e0b88c02e414b1 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Tue, 20 Nov 2018 17:05:06 +0100 Subject: Update makefile to allow debugging with jdb --- Makefile | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'Makefile') 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 -- cgit v1.2.1