From 77ccc2c00e8353013f82506c3c9f647a4b5b75a7 Mon Sep 17 00:00:00 2001
From: Alexis Durgnat <alexis.durgnat@hesge.ch>
Date: Mon, 1 Nov 2021 12:40:35 +0100
Subject: [PATCH] Remove root makefile from gitignore

---
 .gitignore |  2 +-
 Makefile   | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 Makefile

diff --git a/.gitignore b/.gitignore
index 6e59d02..e6cf7a9 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 0000000..f4e6d80
--- /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
-- 
GitLab