Parameterize clang executable and the blst build script

This commit is contained in:
Stefan Bratanov 2022-11-28 18:38:24 +00:00
parent 1a30272d14
commit b9777a6f67
2 changed files with 6 additions and 3 deletions

View File

@ -2,7 +2,7 @@
## Prerequisites
* Follow the instructions in the [README.md](../../README.md) to install blst and build the C-KZG library.
* Follow the instructions in the [README.md](../../README.md) to build blst and the C-KZG library.
* `JAVA_HOME` environment variable is set to a JDK with an `include` folder containing a `jni.h` file.
## Build

View File

@ -6,17 +6,20 @@ else
CFLAGS += -O2 -fPIC
endif
CLANG_EXECUTABLE=clang
BLST_BUILD_SCRIPT=./build.sh
all: c_kzg_4844.o lib
c_kzg_4844.o: c_kzg_4844.c Makefile
clang -Wall -I$(INCLUDE_DIRS) $(CFLAGS) -c $<
${CLANG_EXECUTABLE} -Wall -I$(INCLUDE_DIRS) $(CFLAGS) -c $<
# Will fail with "patch does not apply" if it has already been patched.
# Safe to ignore.
blst:
cd ../blst; \
git apply < ../blst_sha.patch; \
./build.sh && \
${BLST_BUILD_SCRIPT} && \
cp libblst.a ../lib && \
cp bindings/*.h ../inc