2014-10-29 21:54:47 +00:00
|
|
|
CXXFLAGS = -g -Wall
|
|
|
|
CXXVER := $(shell $(CXX) -dumpversion)
|
2014-09-23 01:44:09 +00:00
|
|
|
|
2014-10-29 21:11:58 +00:00
|
|
|
FGREP = fgrep
|
|
|
|
IS_64 := $(shell $(CXX) -dumpmachine 2>&1 | $(FGREP) -c "64")
|
2014-10-31 17:45:58 +00:00
|
|
|
USE_AESNI := yes
|
2014-09-23 23:56:29 +00:00
|
|
|
ifeq ($(shell expr match ${CXXVER} "4\.[0-9][0-9]"),4) # >= 4.10
|
2014-10-30 01:42:06 +00:00
|
|
|
NEEDED_CXXFLAGS += -std=c++11
|
2014-09-23 23:56:29 +00:00
|
|
|
else ifeq ($(shell expr match ${CXXVER} "4\.[7-9]"),3) # >= 4.7
|
2014-10-30 01:42:06 +00:00
|
|
|
NEEDED_CXXFLAGS += -std=c++11
|
2014-09-23 23:56:29 +00:00
|
|
|
else ifeq ($(shell expr match ${CXXVER} "4\.6"),3) # = 4.6
|
2014-10-30 01:42:06 +00:00
|
|
|
NEEDED_CXXFLAGS += -std=c++0x
|
2014-10-30 01:42:55 +00:00
|
|
|
else ifeq ($(shell expr match $(CXX) 'clang'),5)
|
|
|
|
NEEDED_CXXFLAGS += -std=c++11
|
2014-09-23 23:56:29 +00:00
|
|
|
else # not supported
|
|
|
|
$(error Compiler too old)
|
2014-09-23 01:44:09 +00:00
|
|
|
endif
|
|
|
|
|
2014-11-07 14:48:49 +00:00
|
|
|
LIBDIR := /usr/lib
|
2014-09-23 23:56:29 +00:00
|
|
|
|
2014-07-17 17:12:52 +00:00
|
|
|
include filelist.mk
|
2014-08-17 05:35:09 +00:00
|
|
|
INCFLAGS =
|
2014-11-07 14:49:16 +00:00
|
|
|
ifeq ($(STATIC),yes)
|
|
|
|
LDLIBS += $(LIBDIR)/libcryptopp.a $(LIBDIR)/libboost_system.a
|
|
|
|
LDLIBS += $(LIBDIR)/libboost_date_time.a $(LIBDIR)/libboost_filesystem.a
|
|
|
|
LDLIBS += $(LIBDIR)/libboost_regex.a $(LIBDIR)/libboost_program_options.a
|
|
|
|
LDLIBS += -lpthread -static-libstdc++ -static-libgcc
|
|
|
|
USE_AESNI := no
|
|
|
|
else
|
2014-10-30 22:47:19 +00:00
|
|
|
LDLIBS = -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread
|
2014-11-07 14:49:16 +00:00
|
|
|
endif
|
2014-08-17 05:35:09 +00:00
|
|
|
LIBS =
|
2014-07-16 16:59:17 +00:00
|
|
|
|
2014-10-29 21:11:58 +00:00
|
|
|
|
2014-10-31 17:45:58 +00:00
|
|
|
ifeq ($(USE_AESNI),yes)
|
2014-10-29 21:11:58 +00:00
|
|
|
ifeq ($(IS_64),1)
|
2014-07-16 16:59:17 +00:00
|
|
|
#check if AES-NI is supported by CPU
|
2014-08-17 05:35:09 +00:00
|
|
|
ifneq ($(shell grep -c aes /proc/cpuinfo),0)
|
2014-09-13 18:36:36 +00:00
|
|
|
CPU_FLAGS = -maes -DAESNI
|
2014-07-16 16:59:17 +00:00
|
|
|
endif
|
2014-10-29 21:11:58 +00:00
|
|
|
endif
|
2014-10-31 17:45:58 +00:00
|
|
|
endif
|
2014-07-16 16:59:17 +00:00
|
|
|
|