From e9f2b449bd0b16004b12d6dfc305b6fa50b538a8 Mon Sep 17 00:00:00 2001 From: heck Date: Thu, 12 Dec 2019 02:23:50 +0100 Subject: [PATCH] Build config, added foo_PATH vars, for more flexible reuse of paths Backwards compatible with "old" local.conf --- Makefile.conf | 22 ++++++++++++++++++---- README.md | 10 ++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Makefile.conf b/Makefile.conf index c5a71e6..2a43844 100644 --- a/Makefile.conf +++ b/Makefile.conf @@ -43,17 +43,31 @@ YML2_PROC=$(YML2_PATH)/yml2proc $(YML2_OPTS) YML2_OPTS=--encoding=utf8 ######### Engine ######### -ENGINE_LIB=-L$(HOME)/lib -ENGINE_INC=-I$(HOME)/include +ENGINE_LIB_PATH=$(HOME)/lib +ENGINE_INC_PATH=$(HOME)/include ######### libAdapter ######### -AD_LIB=-L$(HOME)/lib -AD_INC=-I$(HOME)/include +AD_LIB_PATH=$(HOME)/lib +AD_INC_PATH=$(HOME)/include ######### Overrides ######### -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 + ifdef BUILD_CONFIG include $(BUILD_CONFIG) endif diff --git a/README.md b/README.md index ff17ee9..04197e9 100644 --- a/README.md +++ b/README.md @@ -39,13 +39,15 @@ JAVA_HOME=/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home YML2_PATH=$(HOME)/code/yml2 -ENGINE_INC=-I$(HOME)/code/engine/build/include -ENGINE_LIB=-L$(HOME)/code/engine/build/lib +ENGINE_INC_PATH=$(HOME)/code/engine/build/include +ENGINE_LIB_PATH=$(HOME)/code/engine/build/lib -AD_INC=-L$(HOME)/code/libad/build/include -AD_LIB=-L$(HOME)/code/libad/build/lib +AD_INC_PATH=$(HOME)/code/libad/build/include +AD_LIB_PATH=$(HOME)/code/libad/build/lib ~~~ +The the foo_PATH variables will be turned into compiler directives (-I / -L), which can be directly set by just omitting "\_PATH" (e.g. ENGINE_INC). They will take priority. + Depending on what is already set in your environment, or can be found in your default include/library paths, setting any of these variables may be optional on your platform. Now, build the Adapter with