From ba2900b2cdccffba3ec9e3bef205366bdf720f38 Mon Sep 17 00:00:00 2001 From: David Rotermund <54365609+davrot@users.noreply.github.com> Date: Wed, 3 Jan 2024 01:35:04 +0100 Subject: [PATCH] Update README.md Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com> --- PyBind11/basics/README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/PyBind11/basics/README.md b/PyBind11/basics/README.md index 48048a7..aca2836 100644 --- a/PyBind11/basics/README.md +++ b/PyBind11/basics/README.md @@ -11,5 +11,30 @@ Questions to [David Rotermund](mailto:davrot@uni-bremen.de) -```python +```Makefile +PYBIN=~/P3.9/bin/ +COMPILER=clang + +PYBIND11INCLUDE=`$(PYBIN)python3 -m pybind11 --includes` + +PARAMETERS= -O3 -std=c++14 -fPIC $(PYBIND11INCLUDE) -Wall + +THEMODULENAME=themodule`$(PYBIN)python3-config --extension-suffix` + +all: themodule + +MyModule.o: MyModule.h MyModule.cpp + $(COMPILER) $(PARAMETERS) -c MyModule.cpp -o MyModule.o + +themodule.o: MyModule.h themodule.cpp + $(COMPILER) $(PARAMETERS) -c themodule.cpp -o themodule.o + +themodule: MyModule.o themodule.o + $(COMPILER) -shared -o themodule MyModule.o themodule.o -lm -lstdc++ -Wall + cp themodule $(THEMODULENAME) + +clean: + rm -f $(THEMODULENAME) + rm -f themodule + rm -f *.o ```