diff --git a/Makefile b/Makefile index 9e10092..ceba9b9 100644 --- a/Makefile +++ b/Makefile @@ -11,9 +11,6 @@ compile: compile-inplace: python3 setup.py build_ext $(DEBUG_OPT) $(PREFIX_OPT) --inplace -make-compile: - $(MAKE) -C src/pEp/_pEp - # Packaging # ========= # create wheel and egg package in dist/ @@ -92,5 +89,13 @@ clean: clean-docs clean-docs: make clean -C docs/ -make-clean: + +# Makefile based build of C++ parts only +# ====================================== +makefile-build: + $(MAKE) -C src/pEp/_pEp + $(MAKE) -C src/pEp/_pybind + +makefile-clean: $(MAKE) -C src/pEp/_pEp clean + $(MAKE) -C src/pEp/_pybind clean diff --git a/src/pEp/Makefile.conf b/src/pEp/Makefile.conf new file mode 100644 index 0000000..9461ade --- /dev/null +++ b/src/pEp/Makefile.conf @@ -0,0 +1,16 @@ +HERE:=$(dir $(lastword $(MAKEFILE_LIST))) +-include $(HERE)../../local.conf + +TARGET_PEP=_pEp.so +TARGET_PYBIND=_pybind.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 + diff --git a/src/pEp/_pEp/Makefile b/src/pEp/_pEp/Makefile index e26e970..732e6f3 100644 --- a/src/pEp/_pEp/Makefile +++ b/src/pEp/_pEp/Makefile @@ -1,30 +1,29 @@ -TARGET=_pEp.so -CXX=g++ +include ../Makefile.conf +TARGET=$(TARGET_PEP) -# Include dirs -INCLUDES=-I/Users/heck/local-default/include -INCLUDES+=-I/opt/local/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 +# 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 +INCLUDES+= +LIB_DIRS+= +LIBS+=-lboost_python38-mt -lboost_locale-mt +LDFLAGS+= -# Libs -LIB_DIRS=-L/opt/local/lib -L/Users/heck/local-default/lib -LIBS=-lpEpEngine -lpEpAdapter -lboost_python38-mt -lboost_locale-mt -# Compile -CXXFLAGS+=-std=c++11 -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -CXXFLAGS+=$(INCLUDES) -# Link -LDFLAGS+= -undefined dynamic_lookup +# Combine Settings +CXXFLAGS+=$(INCLUDES) LDFLAGS+=$(LIB_DIRS) LDFLAGS+=$(LIBS) -SRCS := $(wildcard *.cc) -OBJS := $(SRCS:.cc=.o) +SRCS:=$(wildcard *.cc) +OBJS:=$(SRCS:.cc=.o) .PHONY: clean all: $(TARGET) +# Using implicit compile target +# And explicit link taget $(TARGET): $(OBJS) $(CXX) $(LDFLAGS) -o $@ $^ diff --git a/src/pEp/_pybind/Makefile b/src/pEp/_pybind/Makefile new file mode 100644 index 0000000..e28eded --- /dev/null +++ b/src/pEp/_pybind/Makefile @@ -0,0 +1,32 @@ +include ../Makefile.conf +TARGET=$(TARGET_PYBIND) + +# Specific Build settings +CXXFLAGS+= +INCLUDES+= +LIB_DIRS+= +LIBS+= +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)