a portable and fast pairing-based cryptography library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mcl/java/Makefile

51 lines
1.3 KiB

9 years ago
include ../common.mk
ifeq ($(UNAME_S),Darwin)
JAVA_INC=-I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers/
LIB_SUF=dylib
else
JAVA_INC=-I/usr/lib/jvm/default-java/include
#JAVA_INC=-I/usr/lib/jvm/java-7-openjdk-amd64/include
LIB_SUF=so
CFLAGS+=-z noexecstack
9 years ago
LDFLAGS+=-lrt
9 years ago
endif
CFLAGS+=$(JAVA_INC) $(JAVA_INC)/linux -I ../include -I ../../xbyak -I ../../cybozulib/include -Wno-strict-aliasing
MCL_LIB=../lib/libmcl.a
9 years ago
PACKAGE_NAME=com.herumi.mcl
PACKAGE_DIR=$(subst .,/,$(PACKAGE_NAME))
TARGET=../bin/libmcl_elgamal.$(LIB_SUF)
9 years ago
JAVA_EXE=cd ../bin && LD_LIBRARY_PATH=./:$(LD_LIBRARY_PATH) java -classpath ../java
all: $(TARGET)
elgamal_wrap.cxx: elgamal.i elgamal.hpp
$(MKDIR) $(PACKAGE_DIR)
swig -java -package $(PACKAGE_NAME) -outdir $(PACKAGE_DIR) -c++ -Wall elgamal.i
9 years ago
$(MCL_LIB):
make -C ..
$(TARGET): elgamal_wrap.cxx $(MCL_LIB)
$(PRE)$(CXX) $< -o $@ $(CFLAGS) $(LDFLAGS) $(MCL_LIB) -shared
9 years ago
%.class: %.java
javac $<
ElgamalTest.class: ElgamalTest.java $(TARGET)
9 years ago
jar:
jar cvf mcl_elgamal.jar com
test_elgamal: ElgamalTest.class $(TARGET)
$(JAVA_EXE) ElgamalTest
$(JAVA_EXE) ElgamalTest -e NIST_P192
$(JAVA_EXE) ElgamalTest -e NIST_P256 -h sha256
$(JAVA_EXE) ElgamalTest -e NIST_P384 -h sha384
$(JAVA_EXE) ElgamalTest -e NIST_P521 -h sha512
9 years ago
clean:
rm -rf *.class $(TARGET) $(PACKAGE_DIR)/*.class