diff --git a/.gitignore b/.gitignore index 6e59d02750d19b8938dc1eef1214458095c0f29d..e6cf7a9eafcb7a7a0ad65e74949cfa0132e8b895 100644 --- a/.gitignore +++ b/.gitignore @@ -36,7 +36,7 @@ CMakeCache.txt CMakeFiles CMakeScripts Testing -Makefile +*/Makefile cmake_install.cmake install_manifest.txt compile_commands.json diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..f4e6d8018e368aabbbd9798ffefdd7125e39dca2 --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +PYBIND_CMAKE=`pip show pybind11 | grep Location: | cut -d" " -f2`/pybind11/share/cmake/pybind11 + +default: build + +build: sandbox_wrapper.so + python3 -m build + +sandbox_wrapper.so: sandbox_wrapper.cpp + cd build && make && cp -f *.so ../src/ar_sandbox/wrapper/ + +sandbox_wrapper.cpp: + cd build && cmake .. -DPYTHON_EXECUTABLE=/usr/bin/python3 -Dpybind11_DIR=${PYBIND_CMAKE} + +clean: clean-cpp clean-pydist clean-pysrc + +clean-pysrc: + rm -rf ./src/*.egg-info ./src/ar_sandbox/*.so + +clean-pydist: + rm -f ./dist/* + +clean-cpp: + cd build && make clean + rm -rf ./build/* \ No newline at end of file