Suffix swig stuff and update gitignore

This commit is contained in:
Ramana Kumar 2022-10-01 21:39:15 +01:00
parent e3499ff145
commit 38acde184a
No known key found for this signature in database
GPG Key ID: ED471C788B900433
5 changed files with 13 additions and 8 deletions

5
.gitignore vendored
View File

@ -16,6 +16,11 @@ inc/blst_aux.h*
*.json
.clang-format
*bindings/*/_*.so
*bindings/*/lib*.so
*bindings/python/ckzg_swig.py
*bindings/python/ckzg.py
*bindings/C#/ckzg_swig.cs
*bindings/python/*_wrap.c
*bindings/C#/*_wrap.c
*bindings/C#/*.exe
__pycache__

View File

@ -1,11 +1,11 @@
INCLUDE_DIRS = .. ../../min-src ../../inc
test: tests.cs libckzg.so ckzg.cs
mcs -langversion:5 -optimize+ tests.cs ckzg.cs -r:System.Numerics.dll
test: tests.cs libckzg.so ckzg_swig.cs
mcs -langversion:5 -optimize+ tests.cs ckzg_swig.cs -r:System.Numerics.dll
mono tests.exe
libckzg.so: c_kzg_4844_wrap.c ../../min-src/c_kzg_4844.o ../../lib/libblst.a
clang -O -Wall -shared -fPIC -Wl,-Bsymbolic -I${INCLUDE_PY} ${addprefix -I,${INCLUDE_DIRS}} -o $@ $^
c_kzg_4844_wrap.c ckzg.cs: ../c_kzg_4844.swg
swig -DSWIGWORDSIZE64 -O -Wall -csharp -outcurrentdir -namespace ckzg -outfile ckzg.cs $<
c_kzg_4844_wrap.c ckzg_swig.cs: ../c_kzg_4844.swg
swig -DSWIGWORDSIZE64 -O -Wall -csharp -outcurrentdir -namespace ckzg -outfile ckzg_swig.cs $<

View File

@ -1,4 +1,4 @@
%module ckzg
%module ckzg_swig
%{
#include "c_kzg_4844.h"
%}

View File

@ -1,11 +1,11 @@
INCLUDE_DIRS = .. ../../min-src ../../inc
INCLUDE_PY = $(shell python -c 'import sysconfig; print(sysconfig.get_config_var("INCLUDEPY"))')
test: tests.py _ckzg.so
test_swig: tests_swig.py _ckzg_swig.so
python $<
_ckzg.so: c_kzg_4844_wrap.c ../../min-src/c_kzg_4844.o ../../lib/libblst.a
_ckzg_swig.so: c_kzg_4844_wrap.c ../../min-src/c_kzg_4844.o ../../lib/libblst.a
clang -O -Wall -shared -fPIC -Wl,-Bsymbolic -I${INCLUDE_PY} ${addprefix -I,${INCLUDE_DIRS}} -o $@ $^
c_kzg_4844_wrap.c ckzg.py: ../c_kzg_4844.swg
c_kzg_4844_wrap.c ckzg_swig.py: ../c_kzg_4844.swg
swig -DSWIGWORDSIZE64 -O -Wall -python -outcurrentdir $<