Makefile automatically sets JAVA_HOME if empty

This commit is contained in:
Andrey Pangin
2018-06-13 19:20:10 +03:00
parent d8a389a579
commit 2edeaf7dbe
3 changed files with 5 additions and 1 deletions

2
.gitignore vendored
View File

@@ -1,5 +1,5 @@
/build/
/nbproject/
/.idea/
*.class
/test/*.class
.vscode

BIN
JavaHome.class Normal file

Binary file not shown.

View File

@@ -10,6 +10,10 @@ INCLUDES=-I$(JAVA_HOME)/include
JAVAC=$(JAVA_HOME)/bin/javac
JAR=$(JAVA_HOME)/bin/jar
ifeq ($(JAVA_HOME),)
JAVA_HOME:=$(shell java -cp . JavaHome)
endif
OS:=$(shell uname -s)
ifeq ($(OS), Darwin)
CPPFLAGS += -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE