recover common.mk ; update java/Makefile

dev
MITSUNARI Shigeo 9 years ago
parent 37badc3663
commit bc354e6ddb
  1. 57
      Makefile
  2. 58
      common.mk
  3. 2
      java/Makefile

@ -1,59 +1,4 @@
GCC_VER=$(shell $(PRE)$(CC) -dumpversion) include common.mk
UNAME_S=$(shell uname -s)
ifeq ($(UNAME_S),Linux)
OS=Linux
endif
ifneq ($(UNAME_S),Darwin)
LDFLAGS+=-lrt
endif
BIT?=64
ifeq ($(BIT),32)
CPU?=x86
else
ifeq ($(BIT),64)
CPU?=x86-64
endif
endif
CP=cp -f
AR=ar r
MKDIR=mkdir -p
RM=rm -rf
CFLAGS_OPT+=-fomit-frame-pointer -DNDEBUG
ifeq ($(CXX),clang++)
CFLAGS_OPT+=-O3
else
ifeq ($(shell expr $(GCC_VER) \> 4.6.0),1)
CFLAGS_OPT+=-Ofast
else
CFLAGS_OPT+=-O3
endif
endif
ifeq ($(MARCH),)
ifeq ($(shell expr $(GCC_VER) \> 4.2.1),1)
CFLAGS_OPT+=-march=native
endif
else
CFLAGS_OPT+=$(MARCH)
endif
CFLAGS_WARN=-Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wfloat-equal -Wpointer-arith
CFLAGS+= -g3
ifeq ($(BIT),0)
BIT_OPT=
else
BIT_OPT=-m$(BIT)
endif
INC_OPT=-I include -I test -I ../xbyak -I ../cybozulib/include
CFLAGS+=$(CFLAGS_WARN) $(BIT_OPT) $(INC_OPT)
DEBUG=0
ifeq ($(DEBUG),0)
CFLAGS+=$(CFLAGS_OPT)
endif
LDFLAGS+=-lgmp -lgmpxx -lcrypto $(BIT_OPT)
OBJ_DIR=obj OBJ_DIR=obj
EXE_DIR=bin EXE_DIR=bin

@ -0,0 +1,58 @@
GCC_VER=$(shell $(PRE)$(CC) -dumpversion)
UNAME_S=$(shell uname -s)
ifeq ($(UNAME_S),Linux)
OS=Linux
endif
ifneq ($(UNAME_S),Darwin)
LDFLAGS+=-lrt
endif
BIT?=64
ifeq ($(BIT),32)
CPU?=x86
else
ifeq ($(BIT),64)
CPU?=x86-64
endif
endif
CP=cp -f
AR=ar r
MKDIR=mkdir -p
RM=rm -rf
CFLAGS_OPT+=-fomit-frame-pointer -DNDEBUG
ifeq ($(CXX),clang++)
CFLAGS_OPT+=-O3
else
ifeq ($(shell expr $(GCC_VER) \> 4.6.0),1)
CFLAGS_OPT+=-Ofast
else
CFLAGS_OPT+=-O3
endif
endif
ifeq ($(MARCH),)
ifeq ($(shell expr $(GCC_VER) \> 4.2.1),1)
CFLAGS_OPT+=-march=native
endif
else
CFLAGS_OPT+=$(MARCH)
endif
CFLAGS_WARN=-Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wfloat-equal -Wpointer-arith
CFLAGS+= -g3
ifeq ($(BIT),0)
BIT_OPT=
else
BIT_OPT=-m$(BIT)
endif
INC_OPT=-I include -I test -I ../xbyak -I ../cybozulib/include
CFLAGS+=$(CFLAGS_WARN) $(BIT_OPT) $(INC_OPT)
DEBUG=0
ifeq ($(DEBUG),0)
CFLAGS+=$(CFLAGS_OPT)
endif
LDFLAGS+=-lgmp -lgmpxx -lcrypto $(BIT_OPT)
CFLAGS += -DMCL_USE_LLVM

@ -22,7 +22,7 @@ mcl_if_wrap.cxx: mcl_if.i mcl_if.hpp
swig -java -package $(PACKAGE_NAME) -outdir $(PACKAGE_DIR) -c++ -Wall mcl_if.i swig -java -package $(PACKAGE_NAME) -outdir $(PACKAGE_DIR) -c++ -Wall mcl_if.i
$(TARGET): mcl_if_wrap.cxx $(TARGET): mcl_if_wrap.cxx
$(PRE)$(CXX) $< -o $@ $(CFLAGS) $(LDFLAGS) ../src/fp.cpp ../src/x64.s $(PRE)$(CXX) $< -o $@ $(CFLAGS) $(LDFLAGS) ../src/fp.cpp ../src/$(CPU).s -I ../include -I ../../xbyak -I ../../cybozulib/include
%.class: %.java %.class: %.java

Loading…
Cancel
Save