From 292a22950e7189c9fd1d4d6faa5772ae70389d7c Mon Sep 17 00:00:00 2001 From: heck Date: Mon, 28 Aug 2023 19:59:01 +0200 Subject: [PATCH] Build: increase consistency and quality across pEp --- .gitignore | 1 + Makefile | 20 ++++++++++++++++++-- build.conf.example | 4 ++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index e5ec7e7..e6c869b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ pEpEngineSequoiaBackendProject.vcxproj.user x64 /_build +/build.conf diff --git a/Makefile b/Makefile index f968083..81212a9 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,24 @@ # This file may be used under the terms of the GNU General Public License version 3 # see COPYING -BUILD_CONF?=./build.conf --include $(BUILD_CONF) +# BUILD_CONF must be specified relative to the repo root or must be an absolute path +# BUILD_CONF defaults to ./build.conf +REPO_ROOT_REL:=$(dir $(lastword $(MAKEFILE_LIST))) +ifndef BUILD_CONF + BUILD_CONF=$(REPO_ROOT_REL)/build.conf + -include $(BUILD_CONF) +else + BUILD_CONF_EFF=$(BUILD_CONF) + ifeq ($(dir $(BUILD_CONF)),./) + BUILD_CONF_EFF=$(REPO_ROOT_REL)/$(BUILD_CONF) + endif + ifeq ($(wildcard $(BUILD_CONF_EFF)),) + $(info BUILD_CONF must be specified relative to the repo root or must be an absolute path) + $(error file specified using BUILD_CONF ($(BUILD_CONF)) not found) + endif + include $(BUILD_CONF_EFF) +endif + # Build config defaults DEBUG?=debug diff --git a/build.conf.example b/build.conf.example index f255f17..0b1ab05 100644 --- a/build.conf.example +++ b/build.conf.example @@ -1,7 +1,7 @@ -# This is an Example build config (local.conf) +# This is an Example build config (build.conf) # The values here reflect the defaults. # If needed, copy this file into a file called -# `local.conf` and adjust the values +# `build.conf` and adjust the values # The dir where the build artifacts get installed into # PREFIX=/usr/local -- GitLab