c-kzg-4844/bindings/java/Makefile

34 lines
863 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 19:18:24 +00:00
GRADLE_COMMAND=gradlew
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
else
CLANG_EXECUTABLE=clang
2022-11-24 18:05:12 +00:00
GRADLE_COMMAND=./gradlew
UNAME_S := $(shell uname -s)
2022-11-24 20:38:38 +00:00
ifeq ($(UNAME_S),Linux)
CLANG_FLAGS=-fPIC -shared
JNI_INCLUDE_FOLDER=linux
LIBRARY_RESOURCE=libckzg4844jni.so
endif
2022-11-24 18:05:12 +00:00
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
2022-11-24 19:46:47 +00:00
all: build test
build:
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