makefile to support cygwin/mingw

dev
MITSUNARI Shigeo 6 years ago
parent 1b913a60e6
commit 9b8a4bbd99
  1. 14
      Makefile
  2. 9
      common.mk
  3. 2
      include/mcl/fp.hpp
  4. 2
      src/fp.cpp
  5. 2
      src/fp_generator.hpp
  6. 2
      src/low_func.hpp

@ -74,10 +74,18 @@ SHE256_OBJ=$(OBJ_DIR)/she_c256.o
SHE384_OBJ=$(OBJ_DIR)/she_c384.o
ECDSA_OBJ=$(OBJ_DIR)/ecdsa_c.o
FUNC_LIST=src/func.list
MCL_USE_LLVM?=1
ifeq ($(findstring $(OS),mingw64/cygwin),)
MCL_USE_LLVM?=1
else
MCL_USE_LLVM=0
endif
ifeq ($(MCL_USE_LLVM),1)
CFLAGS+=-DMCL_USE_LLVM=1
LIB_OBJ+=$(ASM_OBJ)
# special case for intel with bmi2
ifeq ($(INTEL),1)
LIB_OBJ+=$(OBJ_DIR)/$(CPU).bmi2.o
endif
endif
LLVM_SRC=src/base$(BIT).ll
@ -95,10 +103,6 @@ ifeq ($(USE_LOW_ASM),1)
LOW_ASM_OBJ=$(LOW_ASM_SRC:.asm=.o)
LIB_OBJ+=$(LOW_ASM_OBJ)
endif
# special case for intel with bmi2
ifeq ($(INTEL),1)
LIB_OBJ+=$(OBJ_DIR)/$(CPU).bmi2.o
endif
ifeq ($(UPDATE_ASM),1)
ASM_SRC_DEP=$(LLVM_SRC)

@ -3,6 +3,13 @@ UNAME_S=$(shell uname -s)
ifeq ($(UNAME_S),Linux)
OS=Linux
endif
ifeq ($(findstring MINGW64,$(UNAME_S)),MINGW64)
OS=mingw64
CFLAGS+=-D__USE_MINGW_ANSI_STDIO=1
endif
ifeq ($(findstring CYGWIN,$(UNAME_S)),CYGWIN)
OS=cygwin
endif
ifeq ($(UNAME_S),Darwin)
OS=mac
ARCH=x86_64
@ -44,7 +51,7 @@ ifeq ($(ARCH),aarch64)
CPU=aarch64
BIT=64
endif
ifneq ($(UNAME_S),Darwin)
ifeq ($(findstring $(OS),Darwin/mingw64),)
LDFLAGS+=-lrt
endif

@ -590,6 +590,6 @@ struct hash<mcl::FpT<tag, maxBitSize> > {
CYBOZU_NAMESPACE_TR1_END } // std::tr1
#endif
#ifdef _WIN32
#ifdef _MSC_VER
#pragma warning(pop)
#endif

@ -648,7 +648,7 @@ int64_t getInt64(bool *pb, fp::Block& b, const fp::Op& op)
return 0;
}
#ifdef _WIN32
#ifdef _MSC_VER
#pragma warning(pop)
#endif

@ -2894,7 +2894,7 @@ private:
} } // mcl::fp
#ifdef _WIN32
#ifdef _MSC_VER
#pragma warning(pop)
#endif

@ -701,6 +701,6 @@ const void4u Fp2MulNF<N, Tag>::f = Fp2MulNF<N, Tag>::func;
} } // mcl::fp
#ifdef _WIN32
#ifdef _MSC_VER
#pragma warning(pop)
#endif

Loading…
Cancel
Save