2022-11-03 13:08:17 +00:00
|
|
|
INCLUDE_DIRS = ../../src ../../blst/bindings
|
2022-10-01 17:03:52 +00:00
|
|
|
|
2022-11-29 20:47:44 +00:00
|
|
|
FIELD_ELEMENTS_PER_BLOB ?= 4096
|
|
|
|
|
2022-11-03 13:08:17 +00:00
|
|
|
ifeq ($(OS),Windows_NT)
|
2022-11-07 16:50:32 +00:00
|
|
|
BLST_BUILDSCRIPT=./build.bat
|
|
|
|
BLST_OBJ=blst.lib
|
2022-11-03 13:08:17 +00:00
|
|
|
TESTS_EXECUTABLE=test_ckzg.exe
|
|
|
|
CSHARP_PLATFORM?=win-x64
|
|
|
|
CLANG_PLATFROM?=x86_64-win
|
|
|
|
CLANG_FLAGS=
|
2022-11-07 16:50:32 +00:00
|
|
|
CLANG_EXECUTABLE=clang
|
|
|
|
CKZG_LIBRARY_PATH=Ckzg.Bindings\runtimes\$(CSHARP_PLATFORM)\native\ckzg.dll
|
2022-11-03 13:08:17 +00:00
|
|
|
else
|
|
|
|
BLST_BUILDSCRIPT=./build.sh
|
|
|
|
BLST_OBJ=libblst.a
|
|
|
|
TESTS_EXECUTABLE=./test_ckzg
|
|
|
|
CSHARP_PLATFORM?=linux-x64
|
|
|
|
CLANG_PLATFORM?=x86_64-linux
|
|
|
|
CLANG_FLAGS=-fPIC
|
|
|
|
CLANG_EXECUTABLE=cc
|
2022-11-07 16:50:32 +00:00
|
|
|
CKZG_LIBRARY_PATH=Ckzg.Bindings/runtimes/$(CSHARP_PLATFORM)/native/ckzg.so
|
2022-11-03 13:08:17 +00:00
|
|
|
endif
|
2022-10-01 17:03:52 +00:00
|
|
|
|
2022-11-29 20:47:44 +00:00
|
|
|
CLANG_FLAGS += -DFIELD_ELEMENTS_PER_BLOB=$(FIELD_ELEMENTS_PER_BLOB)
|
|
|
|
|
2022-11-08 14:26:26 +00:00
|
|
|
TARGETS=ckzg.c ../../src/c_kzg_4844.c ../../blst/$(BLST_OBJ)
|
|
|
|
|
2022-11-03 13:08:17 +00:00
|
|
|
.blst:
|
|
|
|
cd ../../blst &&\
|
|
|
|
git apply ../blst_sha.patch &&\
|
|
|
|
$(BLST_BUILDSCRIPT) &&\
|
|
|
|
git apply -R ../blst_sha.patch &&\
|
|
|
|
cd ../bindings/csharp
|
|
|
|
|
2022-11-29 20:47:44 +00:00
|
|
|
.ckzg:
|
2022-11-08 14:26:26 +00:00
|
|
|
$(CLANG_EXECUTABLE) -O -Wall -shared $(CLANG_FLAGS) ${addprefix -I,${INCLUDE_DIRS}} -o $(CKZG_LIBRARY_PATH) $(TARGETS)
|
2022-11-03 13:08:17 +00:00
|
|
|
|
|
|
|
# Ckzg library
|
|
|
|
ckzg:
|
|
|
|
@make .blst
|
|
|
|
@make .ckzg
|
|
|
|
|
|
|
|
# E2e tests as an executable
|
2022-11-08 14:26:26 +00:00
|
|
|
test:
|
2022-11-03 13:08:17 +00:00
|
|
|
@make .blst
|
2022-11-16 15:51:26 +00:00
|
|
|
$(CLANG_EXECUTABLE) -O -w -Wall $(CLANG_FLAGS) ${addprefix -I,${INCLUDE_DIRS}} -o $(TESTS_EXECUTABLE) kzg_tests.c $(TARGETS)
|
2022-11-03 13:08:17 +00:00
|
|
|
|
|
|
|
# E2e tests are built and run
|
|
|
|
run-test:
|
|
|
|
@make test
|
|
|
|
$(TESTS_EXECUTABLE)
|
|
|
|
|
|
|
|
# Makes a build and a nuget package just for windows or linux
|
|
|
|
# To build full package - use ckzg command on every plaform and dotnet build
|
|
|
|
ckzg-dotnet:
|
|
|
|
@make ckzg
|
2022-11-29 20:47:44 +00:00
|
|
|
dotnet build
|