From 5d86f97dcafb7fcca67ee445ab9c997b44394222 Mon Sep 17 00:00:00 2001 From: Damiano Boppart Date: Wed, 12 Dec 2018 14:05:04 +0100 Subject: [PATCH] Group java-related vars together in make --- src/Makefile | 20 ++++++++------------ src/Makefile.conf | 4 +++- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/Makefile b/src/Makefile index 03f2692..b933a0d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -21,6 +21,14 @@ ifndef JAVA_HOME $(error JAVA_HOME is not set!) endif +JP=$(JAVA_HOME)/bin + +# Old versions of a Java distribution have a `javah` binary, new versions do not. This checks whether or not `javah` can be found in the Java distribution found in the directory `$JAVA_HOME`. +NOT_USED:=$(shell type $(JAVA_HOME)/bin/javah) +ifeq ($(.SHELLSTATUS),0) + OLD_JAVA=placeholder +endif + LIBRARY=libpEpJNI.a JAR=jniadapter.jar @@ -32,10 +40,6 @@ else $(error I don't know how to build for $(BUILD_FOR).) endif -LDFLAGS=-shared $(ENGINE_LIB) $(AD_LIB) - -LDLIBS=-lstdc++ -lpEpEngine - JAVA_SOURCES=org/pEp/jniadapter/pEpException.java \ org/pEp/jniadapter/AbstractEngine.java \ org/pEp/jniadapter/Message.java \ @@ -54,14 +58,6 @@ C_SOURCES=org_pEp_jniadapter_Engine.cc \ throw_pEp_exception.hh \ org_pEp_jniadapter_AbstractEngine.h -# Old versions of a Java distribution have a `javah` binary, new versions do not. This checks whether or not `javah` can be found in the Java distribution found in the directory `$JAVA_HOME`. -NOT_USED:=$(shell type $(JAVA_HOME)/bin/javah) -ifeq ($(.SHELLSTATUS),0) - OLD_JAVA=placeholder -endif - -JP=$(JAVA_HOME)/bin - .PHONY: all all: $(JAR) $(SHARED) diff --git a/src/Makefile.conf b/src/Makefile.conf index f609ceb..af7cb80 100644 --- a/src/Makefile.conf +++ b/src/Makefile.conf @@ -16,7 +16,9 @@ BUILD_FOR:=$(shell uname) ######### C and C++ ######### -LDFLAGS=$(AD_INC) $(ENGINE_INC) +LDFLAGS=-shared $(ENGINE_LIB) $(AD_LIB) + +LDLIBS=-lstdc++ -lpEpEngine ######### C++ #########