New example local.conf file

Replaced ENGINE_LIB,ENGINE_INC,AD_LIB,AD_INC.
local.conf migration might be necessary, but see local.conf.example
JAVA_HOME now guessed on linux
make clean now cleans .so and .dylib always (now you can share the workspace between linux and mac)
JNI-98
heck 3 years ago
parent 76b9602138
commit cf5471a617

@ -3,17 +3,13 @@
# This file may be used under the terms of the GNU General Public License version 3
# see LICENSE.txt
######### Header #########
HERE:=$(dir $(lastword $(MAKEFILE_LIST)))
PLATFORM:=$(shell uname | tr A-Z a-z)
######### General #########
BUILD_FOR:=$(shell uname)
######### Java #########
#JAVA_HOME=
# Guessing JAVA_HOME
ifeq ($(PLATFORM),linux)
JAVA_HOME=$(subst /bin,,$(dir $(realpath /usr/bin/javac)))
endif
######### C and C++ #########
CXXFLAGS+=-g -O0 -std=c++11
@ -21,45 +17,33 @@ LDFLAGS+=-shared $(ENGINE_LIB) $(AD_LIB)
LDLIBS=-lstdc++ -lpEpEngine -lpEpAdapter
CXXFLAGS+=-fpermissive -fPIC -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/$(shell uname | tr A-Z a-z) $(AD_INC) $(ENGINE_INC)
CXXFLAGS+=-fpermissive -fPIC -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/$(PLATFORM) $(AD_INC) $(ENGINE_INC)
ifneq (,$(findstring g++,$(CXX)))
CXXFLAGS+=-fdiagnostics-color=always
else ifneq (,$(findstring clang,$(CXX)))
CXXFLAGS+=-fcolor-diagnostics
endif
# DEV ENV PATHS & CFG
# The dev environment paths and configs are set to a default value which can be overridden by ./local.conf and overridden again by <subdir>/local.conf
######### YML2 #########
######### Default paths for dependencies #########
YML2_PATH=$(HOME)/yml2
YML2_PROC=$(YML2_PATH)/yml2proc $(YML2_OPTS)
YML2_OPTS=--encoding=utf8
######### Engine #########
ENGINE_LIB_PATH=$(HOME)/lib
ENGINE_INC_PATH=$(HOME)/include
######### libAdapter #########
AD_LIB_PATH=$(HOME)/lib
AD_INC_PATH=$(HOME)/include
######### Overrides #########
######### Overrides from the config file(s) #########
-include $(HERE)/local.conf
-include $(HERE)/src/local.conf
# Add Prefixes to paths, if not already explicitly set in local.conf(s)
ifndef ENGINE_LIB
ENGINE_LIB=-L$(ENGINE_LIB_PATH)
endif
ifndef ENGINE_INC
ENGINE_INC=-I$(ENGINE_INC_PATH)
endif
ifndef AD_LIB
AD_LIB=-L$(AD_LIB_PATH)
endif
ifndef AD_INC
AD_INC=-I$(AD_INC_PATH)
endif
ENGINE_LIB=-L$(ENGINE_LIB_PATH)
ENGINE_INC=-I$(ENGINE_INC_PATH)
AD_LIB=-L$(AD_LIB_PATH)
AD_INC=-I$(AD_INC_PATH)
ifdef BUILD_CONFIG
include $(BUILD_CONFIG)

@ -20,12 +20,12 @@ endif
LIBRARY=libpEpJNI.a
JAR=pEp.jar
ifeq ($(BUILD_FOR),Linux)
ifeq ($(PLATFORM),linux)
SHARED=libpEpJNI.so
else ifeq ($(BUILD_FOR),Darwin)
else ifeq ($(PLATFORM),darwin)
SHARED=libpEpJNI.dylib
else
$(error I dont know how to build for $(BUILD_FOR).)
$(error I dont know how to build for $(PLATFORM).)
endif
JAVA_SOURCES=foundation/pEp/jniadapter/AbstractEngine.java \
@ -108,6 +108,8 @@ basic_api.o: basic_api.cc jniutils.hh throw_pEp_exception.hh
.PHONY: clean
clean:
rm -f $(JAR) $(LIBRARY) $(SHARED)
rm -f *.so
rm -f *.dylib
rm -f *.o
rm -f *.class
rm -f *.xml *.xsl

@ -4,6 +4,7 @@ all: compile
run: compile
$(MAKE) -C basic run
$(MAKE) -C regression run
#BROKEN $(MAKE) -C jni85 run
$(MAKE) -C jni88 run
$(MAKE) -C jni91 run
@ -12,6 +13,7 @@ run: compile
compile:
$(MAKE) -C basic compile
$(MAKE) -C regression compile
#BROKEN $(MAKE) -C jni85 compile
$(MAKE) -C jni88 compile
$(MAKE) -C jni91 compile
@ -20,6 +22,7 @@ compile:
clean:
$(MAKE) -C basic clean
$(MAKE) -C regression clean
$(MAKE) -C jni85 clean
$(MAKE) -C jni88 clean
$(MAKE) -C jni91 clean

@ -10,13 +10,12 @@ CLASSPATH=.:$(REPOROOT)/src
JAVA=java -Xcheck:jni -cp $(CLASSPATH) -Djava.library.path=$(CLASSPATH)
$(info If on Mac, make sure to disable SIP, or copy the libpEpEngine.dylib into here)
ifdef ENGINE_LIB_PATH
ifeq ($(BUILD_FOR),Linux)
ifeq ($(PLATFORM),linux)
ifndef LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$(ENGINE_LIB_PATH)
endif
else ifeq ($(BUILD_FOR),Darwin)
else ifeq ($(PLATFORM),darwin)
ifndef DYLD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$(ENGINE_LIB_PATH)
endif

Loading…
Cancel
Save