-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.py27
42 lines (36 loc) · 1.33 KB
/
makefile.py27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
VERSION =
COMPILER = g++-4.8
DEFINE = -DFOR_UNIX -DFOR_LINUX
SYMAPI=/devcartel/SymAPI/AS5_64/apinew
PYTHONLIBDIR=/usr/lib
PYTHONINCLUDEDIR=/usr/include/python2.7
PYTHON=python2.7
PYTHON_TAG=cp27
#BOOSTPYTHON=boost_python
BOOSTPYTHON=:/devcartel/boost_1_68_0/stage/lib/libboost_python27.a
ARCHTYPE=$(shell uname -m)
ifeq ($(ARCHTYPE),x86_64)
COMPILE_BITS=64
PLATFORM_TAG=manylinux1_x86_64
else
COMPILE_BITS=32
PLATFORM_TAG=manylinux1_i686
endif
CXXFLAGS = -Wall -Wno-long-long -pedantic -DLinux -D_REENTRANT -m$(COMPILE_BITS) -lnsl -lpthread -fPIC -std=c++0x
MODULEFLAGS = -shared
OUTPUTDIR=./pyflx$(VERSION)
INCLUDES = -I./ -I$(PYTHONINCLUDEDIR) -I/devcartel/boost_1_68_0 -I$(SYMAPI)/include
LIBDIRS = -L$(PYTHONLIBDIR)
LIBS = -l$(PYTHON) $(SYMAPI)/lib/LINUX/gcc4.1.2/x64/libflexapi.a
OUTPUTS = pyflx.so
SOURCES = \
pyflx.cpp
all : clean ${OUTPUTS} wheel
pyflx.so : $(SOURCES)
${COMPILER} ${MODULEFLAGS} $(SOURCES) -o $(OUTPUTDIR)/$@ ${CXXFLAGS} ${DEFINE} ${INCLUDES} ${LIBDIRS} ${LIBS} -l$(BOOSTPYTHON) -lrt
clean :
rm -f ${OUTPUTDIR}/${OUTPUTS}
wheel : ${OUTPUTDIR}/${OUTPUTS}
${PYTHON} setup.py bdist_wheel --python-tag=${PYTHON_TAG} --plat-name=${PLATFORM_TAG}
@echo To upload to Test PyPI, run \'twine upload -r testpypi --skip-existing dist/*\'
@echo To upload to PyPI, run \'twine upload -r pypi --skip-existing dist/*\'