-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (27 loc) · 982 Bytes
/
Makefile
File metadata and controls
36 lines (27 loc) · 982 Bytes
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
PYTHON = $(shell which python3 )
ifeq (, $(shell which python3 ))
$(error "PYTHON=$(PYTHON) not found in $(PATH)")
endif
PYTHON_VERSION_MIN=3.5
PYTHON_VERSION=$(shell $(PYTHON) -c 'import sys; print("%d.%d"% sys.version_info[0:2])' )
PYTHON_VERSION_OK=$(shell $(PYTHON) -c 'import sys;\
print(int(float("%d.%d"% sys.version_info[0:2]) >= $(PYTHON_VERSION_MIN)))' )
ifeq ($(PYTHON_VERSION_OK),1)
$(error "Need python $(PYTHON_VERSION) >= $(PYTHON_VERSION_MIN)")
endif
CFLAGS = \
-std=c++11 \
-O3 \
-Wall
PYTHON3-PATH:=$(PYTHON)-config --includes
PYTHON3-EXT:=$(PYTHON)-config --extension-suffix
all: generate_pybind
generate_pybind:
$(CXX) -shared $(CFLAGS) -fPIC `$(PYTHON)-config --includes` -I. -I../extern/pybind11/include `$(PYTHON) -m pybind11 --includes` \
tcDefaults.cpp tiScore.cpp r2bScore.cpp peqScore.cpp tcBind.cpp -o tc`$(PYTHON)-config --extension-suffix`
.PHONY: all clean distclean
clean:
rm -f *.so
$(RM) *.so
distclean: clean
rm -f $(EXE)