Browse Source

Build: pEp wide build consistency / rename local.conf to build.conf /add BUILD_CONF / support DEBUG=[debug|release]

master
heck 2 years ago
parent
commit
50e02226de
  1. 2
      .gitignore
  2. 2
      Makefile
  3. 32
      Makefile.conf
  4. 7
      build.conf.example
  5. 10
      docs/source/install.rst
  6. 11
      local.conf.example

2
.gitignore

@ -33,7 +33,7 @@ docs/build/
.tox/
=======
# Build config
local.conf
build.conf
# Python artifacts
/build/

2
Makefile

@ -42,7 +42,7 @@ install-user: compile
# Envrionment
# ===========
# Creates and activates a new venv that has the LD_LIBRARY_PATH/DYLD_LIBRARY_PATH
# already set for the prefix specified in local.conf
# already set for the prefix specified in build.conf
# Only activates venv if already existing
venv:
python3 -m venv $(VENV_DIR)

32
Makefile.conf

@ -1,4 +1,25 @@
HERE:=$(dir $(lastword $(MAKEFILE_LIST)))
# 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
PREFIX?=$(HOME)
DEBUG?=debug
# Constants
BUILD_DIR = ./build
@ -10,14 +31,7 @@ PYTHON_ARTIFACTS += ./src/pEp.egg-info
PYTHON_ARTIFACTS += ./.pytest_cache
VENV_DIR = ./_venv
# Build config Defaults
DEBUG=1
PREFIX=$(HOME)
######### Overrides #########
-include $(HERE)local.conf
ifeq ($(DEBUG),1)
ifeq ($(DEBUG),debug)
DEBUG_OPT+=--debug
endif

7
build.conf.example

@ -0,0 +1,7 @@
# This is an Example build config file (build.conf)
# The values represent the defaults.
# If the defaults dont work for you You can override them here.
# Tweak the values to your needs and rename it to build.conf
# PREFIX=$(HOME)
# DEBUG=debug # [debug|release]

10
docs/source/install.rst

@ -25,10 +25,12 @@ compiled first. So, before any use or installation, the module needs to be built
Build config
~~~~~~~~~~~~
Create a local build config by creating a 'local.conf' file. There is a 'local.conf.example' describing
all the build options. You can use this as a template.
The build configuration file is called `build.conf` or can be specified (relative to repo root) using
the env var `BUILD_CONF`.
``cp local.conf.example local.conf``
There is a 'build.conf.example' describing all the build options. You can use this as a template.
``cp build.conf.example build.conf``
If you have pEp-base installed under a custom prefix (e.g. /home/foo/local) it is important
that you specify "PREFIX".
@ -47,7 +49,7 @@ Virtualenv
----------
We recommend using a venv to work on/with the pEpPythonAdapter.
There is a convenience make target that will create and activate a venv that already has the LD_LIBRARY_PATH
or DYLD_LIBRARY_PATH set according to your ``local.conf``.
or DYLD_LIBRARY_PATH set according to your ``build.conf``.
If the venv does not exist yet it will be created and activated.
If the venv already exists it will only be activated.

11
local.conf.example

@ -1,11 +0,0 @@
# This is an Example build config file (local.conf)
# you might not need this file, but if the defaults dont work for you
# You can override them here.
# Tweak the values to your needs and rename it to local.conf
######### C++ Compiler #########
# DEBUG=1
# DEBUG=0
############# DIRS #############
# PREFIX=$(HOME)/local
Loading…
Cancel
Save