c-kzg-4844/bindings/java/Makefile

32 lines
855 B
Makefile
Raw Normal View History

2022-11-24 17:16:15 +00:00
INCLUDE_DIRS = ../../src ../../blst/bindings
ifeq ($(OS),Windows_NT)
CLANG_EXECUTABLE=gcc
2022-11-24 18:05:12 +00:00
CLANG_FLAGS=-shared
2022-11-24 17:16:15 +00:00
JNI_INCLUDE_FOLDER=win32
LIBRARY_RESOURCE=ckzg4844jni.dll
GRADLE_COMMAND=gradlew
else
CLANG_EXECUTABLE=clang
2022-11-24 18:05:12 +00:00
GRADLE_COMMAND=./gradlew
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
CLANG_FLAGS=-fPIC -shared
JNI_INCLUDE_FOLDER=linux
LIBRARY_RESOURCE=libckzg4844jni.so
endif
ifeq ($(UNAME_S),Darwin)
CLANG_FLAGS=-dynamiclib
JNI_INCLUDE_FOLDER=darwin
LIBRARY_RESOURCE=libckzg4844jni.dylib
endif
2022-11-24 17:16:15 +00:00
endif
c_kzg_4844_jni:
2022-11-24 18:05:12 +00:00
${CLANG_EXECUTABLE} ${CLANG_FLAGS} -O -Wall ${addprefix -I,${INCLUDE_DIRS}} -I"${JAVA_HOME}/include" -I"${JAVA_HOME}/include/${JNI_INCLUDE_FOLDER}" -o src/main/resources/lib/${LIBRARY_RESOURCE} c_kzg_4844_jni.c c_kzg_4844.o ../../lib/libblst.a
2022-11-24 17:16:15 +00:00
test:
${GRADLE_COMMAND} clean test