diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2017-08-12 17:12:29 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2017-08-12 17:12:29 +0800 |
commit | aa867dd6770e7956ff08bff55639a4f4d1d74910 (patch) | |
tree | 68c1a0ecc93b9235a4e57eae30b5e665ff799b7d /Makefile | |
parent | 14eef5d9971e76c177a339f94de553a0501a1b71 (diff) | |
download | dexon-bls-aa867dd6770e7956ff08bff55639a4f4d1d74910.tar dexon-bls-aa867dd6770e7956ff08bff55639a4f4d1d74910.tar.gz dexon-bls-aa867dd6770e7956ff08bff55639a4f4d1d74910.tar.bz2 dexon-bls-aa867dd6770e7956ff08bff55639a4f4d1d74910.tar.lz dexon-bls-aa867dd6770e7956ff08bff55639a4f4d1d74910.tar.xz dexon-bls-aa867dd6770e7956ff08bff55639a4f4d1d74910.tar.zst dexon-bls-aa867dd6770e7956ff08bff55639a4f4d1d74910.zip |
test_go runs on Linux/OSX
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -43,14 +43,18 @@ $(MCL_LIB): ################################################################## BLS384_LIB=$(LIB_DIR)/libbls384.a -BLS384_SLIB=$(LIB_DIR)/libbls384$(SHARE_BASENAME_SUF).$(LIB_SUF) +BLS384_SNAME=bls384$(SHARE_BASENAME_SUF) +BLS384_SLIB=$(LIB_DIR)/lib$(BLS384_SNAME).$(LIB_SUF) lib: $(BLS_LIB) $(BLS384_SLIB) $(BLS384_LIB): $(LIB_OBJ) $(OBJ_DIR)/bls_c384.o $(AR) $@ $(LIB_OBJ) $(OBJ_DIR)/bls_c384.o +ifeq ($(OS),mac) + MAC_LDFLAGS+=-lgmpxx -lgmp -lcrypto -lstdc++ +endif $(BLS384_SLIB): $(OBJ_DIR)/bls_c384.o $(MCL_LIB) - $(PRE)$(CXX) -shared -o $@ $(OBJ_DIR)/bls_c384.o $(MCL_LIB) + $(PRE)$(CXX) -shared -o $@ $(OBJ_DIR)/bls_c384.o $(MCL_LIB) $(MAC_LDFLAGS) VPATH=test sample src @@ -74,9 +78,11 @@ test: $(TEST_EXE) @sh -ec 'for i in $(TEST_EXE); do $$i|grep "ctest:name"; done' > result.txt @grep -v "ng=0, exception=0" result.txt; if [ $$? -eq 1 ]; then echo "all unit tests succeed"; else exit 1; fi +ifeq ($(OS),mac) + MAC_GO_LDFLAGS="-ldflags=-s" +endif test_go: go/bls/bls.go go/bls/bls_test.go $(BLS384_SLIB) - cd go/bls && env CGO_CFLAGS="-I../../include -I../../../mcl/include" CGO_LDFLAGS="-L../../lib -L../../../mcl/lib" LD_LIBRARY_PATH=../../lib go test . -# cd go/bls && go test -tags $(GO_TAG) -v . + cd go/bls && ln -sf ../../lib . && env LD_RUN_PATH="../../lib" CGO_CFLAGS="-I../../include -I../../../mcl/include" CGO_LDFLAGS="-L../../lib -L../../../mcl/lib" go test $(MAC_GO_LDFLAGS) . clean: $(RM) $(BLS_LIB) $(OBJ_DIR)/*.d $(OBJ_DIR)/*.o $(EXE_DIR)/*.exe $(GEN_EXE) $(ASM_SRC) $(ASM_OBJ) $(LIB_OBJ) $(LLVM_SRC) $(BLS384_SLIB) |