15 lines
705 B
Makefile
15 lines
705 B
Makefile
# Standard compile options for the C++ executable
|
|
FLAGS = -fPIC -O3 -march=native -Wall -Werror -flto=auto -fopenmp -fopenmp-simd
|
|
|
|
# The Python interface through SWIG
|
|
PYTHON_VERSION = $(shell python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}");')
|
|
PYTHONI = -I/usr/include/python$(PYTHON_VERSION)/
|
|
PYTHONL = -Xlinker -export-dynamic
|
|
|
|
# Default super-target
|
|
all:
|
|
cd ../rpt/ && g++ $(FLAGS) -std=c++2a -isystem /usr/include/opencv4/ -c *.cpp ; cd ../swig/
|
|
swig -c++ -python -keyword -o rpt_wrap.cxx rpt.i
|
|
g++ $(FLAGS) $(PYTHONI) -c rpt_wrap.cxx -o rpt_wrap.o
|
|
g++ $(FLAGS) $(PYTHONL) -shared ../rpt/*.o rpt_wrap.o -lopencv_core -lopencv_imgproc -lopencv_calib3d -o _rpt.so
|