Browse Source

Makefile based build for C++ parts only

REWORK
heck 5 years ago
parent
commit
c56b3b40f3
  1. 13
      Makefile
  2. 16
      src/pEp/Makefile.conf
  3. 29
      src/pEp/_pEp/Makefile
  4. 32
      src/pEp/_pybind/Makefile

13
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

16
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

29
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 $@ $^

32
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)
Loading…
Cancel
Save