Browse Source

Build: Add Makefile-based build

master
heck 9 months ago
parent
commit
223f4ac3cd
3 changed files with 59 additions and 2 deletions
  1. +8
    -2
      Makefile
  2. +35
    -0
      src/pEp/_pEp/Makefile
  3. +16
    -0
      src/pEp/_pEp/Makefile.conf

+ 8
- 2
Makefile View File

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

+ 35
- 0
src/pEp/_pEp/Makefile View File

@ -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
- 0
src/pEp/_pEp/Makefile.conf View File

@ -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