Browse Source

Build: Add Makefile-based build

pull/14/head
heck 4 years ago
parent
commit
223f4ac3cd
  1. 10
      Makefile
  2. 35
      src/pEp/_pEp/Makefile
  3. 16
      src/pEp/_pEp/Makefile.conf

10
Makefile

@ -11,6 +11,9 @@ compile:
compile-inplace: compile-inplace:
python3 setup.py build_ext $(DEBUG_OPT) $(PREFIX_OPT) --inplace python3 setup.py build_ext $(DEBUG_OPT) $(PREFIX_OPT) --inplace
makefile-build:
$(MAKE) -C src/pEp/_pEp/
# Packaging # Packaging
# ========= # =========
# create wheel and egg package in dist/ # create wheel and egg package in dist/
@ -74,10 +77,10 @@ docs: compile-inplace
# Housekeeping # Housekeeping
# ============ # ============
clean-all: clean-all: clean clean-docs
rm -rf $(VENV_DIR) rm -rf $(VENV_DIR)
clean: clean: clean-makefile-build
rm -rf $(BUILD_DIR) rm -rf $(BUILD_DIR)
rm -rf $(DIST_DIR) rm -rf $(DIST_DIR)
rm -rf $(PYTHON_ARTIFACTS) rm -rf $(PYTHON_ARTIFACTS)
@ -86,3 +89,6 @@ clean:
clean-docs: clean-docs:
make clean -C docs/ make clean -C docs/
clean-makefile-build:
$(MAKE) -C src/pEp/_pEp clean

35
src/pEp/_pEp/Makefile

@ -0,0 +1,35 @@
include Makefile.conf
TARGET=$(TARGET_PEP)
# Specific Build settings
#CXXFLAGS+=-Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -g -fwrapv -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk
CXXFLAGS+=$(shell python-config --cflags)
#INCLUDES+=$(shell python-config --includes)
INCLUDES+=-I/opt/local/include
LIB_DIRS+=-L$(shell python-config --prefix)
LIB_DIRS+=-L/opt/local/lib
LIBS+=-lboost_python3-mt -lboost_locale-mt
LDFLAGS+=$(shell python-config --ldflags)
# Combine Settings
CXXFLAGS+=$(INCLUDES)
LDFLAGS+=$(LIB_DIRS)
LDFLAGS+=$(LIBS)
SRCS:=$(wildcard *.cc)
OBJS:=$(SRCS:.cc=.o)
.PHONY: clean
all: $(TARGET)
# Using implicit compile target
# And explicit link taget
$(TARGET): $(OBJS)
# $(CXX) $(LDFLAGS) -o $@ $^
clean:
rm -rf $(TARGET)
rm -rf $(OBJS)

16
src/pEp/_pEp/Makefile.conf

@ -0,0 +1,16 @@
HERE:=$(dir $(lastword $(MAKEFILE_LIST)))
-include $(HERE)../../../local.conf
TARGET_PEP=_pEp.so
# General Build settings
# CXX=g++
CXXFLAGS+=-std=c++11 -g
INCLUDES+=-I$(PREFIX)/include
# INCLUDES+=-I/opt/local/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8
LIB_DIRS=-L$(PREFIX)/lib
# LIB_DIRS+=-L/opt/local/lib
LIBS=-lpEpEngine -lpEpAdapter
# LDFLAGS+=-undefined dynamic_lookup
Loading…
Cancel
Save