Ported relevant GNUmakefile changes to GNUmakefile-cross
parent
d5a6f4c628
commit
d40eee99c0
|
|
@ -25,9 +25,9 @@ ifeq ($(PREFIX),)
|
||||||
PREFIX = /usr
|
PREFIX = /usr
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Sadly, we can't actually use GCC_PRAGMA_AWARE because GCC appears to be broken. Its a
|
# Sadly, we can't actually use GCC_PRAGMA_AWARE because of GCC bug 53431.
|
||||||
# shame because GCC has so much to offer by the way of analysis.
|
# Its a shame because GCC has so much to offer by the way of analysis.
|
||||||
# http://stackoverflow.com/questions/31509434/gcc-does-not-honor-pragma-gcc-diagnostic-to-silence-warnings
|
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431
|
||||||
ifneq ($(CLANG_COMPILER),0)
|
ifneq ($(CLANG_COMPILER),0)
|
||||||
CXXFLAGS += -Wall
|
CXXFLAGS += -Wall
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
CXXFLAGS += -DNDEBUG -g2 -Os -fPIC -pipe
|
CXXFLAGS ?= -DNDEBUG -g2 -Os -fPIC -pipe
|
||||||
|
|
||||||
# The following options reduce code size, but breaks link or makes link very slow on some systems
|
# The following options reduce code size, but breaks link or makes link very slow on some systems
|
||||||
# CXXFLAGS += -ffunction-sections -fdata-sections
|
# CXXFLAGS += -ffunction-sections -fdata-sections
|
||||||
# LDFLAGS += -Wl,--gc-sections
|
# LDFLAGS += -Wl,--gc-sections
|
||||||
CXXFLAGS += -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable
|
CXXFLAGS += -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable
|
||||||
|
|
||||||
ARFLAGS = -cr # ar needs the dash on OpenBSD
|
ARFLAGS = -cr # ar needs the dash on OpenBSD
|
||||||
RANLIB ?= ranlib
|
RANLIB ?= ranlib
|
||||||
CP = cp
|
CP = cp
|
||||||
|
|
@ -24,12 +25,18 @@ ifeq ($(PREFIX),)
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Sadly, we can't actually use GCC_PRAGMA_AWARE because of GCC bug 53431.
|
||||||
|
# Its a shame because GCC has so much to offer by the way of analysis.
|
||||||
|
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431
|
||||||
|
ifneq ($(CLANG_COMPILER),0)
|
||||||
|
CXXFLAGS += -Wall
|
||||||
|
endif
|
||||||
|
|
||||||
# iOS cross-compile configuration. Works in conjunction with IS_CROSS_COMPILE.
|
# iOS cross-compile configuration. Works in conjunction with IS_CROSS_COMPILE.
|
||||||
# See http://www.cryptopp.com/wiki/iOS_(Command_Line).
|
# See http://www.cryptopp.com/wiki/iOS_(Command_Line).
|
||||||
ifeq ($(IS_IOS),1)
|
ifeq ($(IS_IOS),1)
|
||||||
CXX = clang++
|
CXX = clang++
|
||||||
|
|
||||||
CXXFLAGS = -DNDEBUG -g2 -Os -fPIC -pipe
|
|
||||||
CXXFLAGS += -DCRYPTOPP_DISABLE_ASM $(IOS_FLAGS)
|
CXXFLAGS += -DCRYPTOPP_DISABLE_ASM $(IOS_FLAGS)
|
||||||
CXXFLAGS += -arch $(IOS_ARCH) -isysroot $(IOS_SYSROOT)
|
CXXFLAGS += -arch $(IOS_ARCH) -isysroot $(IOS_SYSROOT)
|
||||||
CXXFLAGS += -stdlib=libc++
|
CXXFLAGS += -stdlib=libc++
|
||||||
|
|
@ -42,7 +49,6 @@ endif
|
||||||
# See http://www.cryptopp.com/wiki/Android_(Command_Line).
|
# See http://www.cryptopp.com/wiki/Android_(Command_Line).
|
||||||
ifeq ($(IS_ANDROID),1)
|
ifeq ($(IS_ANDROID),1)
|
||||||
# CPP, CXX, AR, RANLIB, LD, etc are set in 'setenv-android.sh'
|
# CPP, CXX, AR, RANLIB, LD, etc are set in 'setenv-android.sh'
|
||||||
CXXFLAGS = -DNDEBUG -g2 -Os -pipe -fPIC
|
|
||||||
CXXFLAGS += -DCRYPTOPP_DISABLE_ASM $(ANDROID_FLAGS)
|
CXXFLAGS += -DCRYPTOPP_DISABLE_ASM $(ANDROID_FLAGS)
|
||||||
CXXFLAGS += --sysroot=$(ANDROID_SYSROOT) -I$(ANDROID_STL_INC)
|
CXXFLAGS += --sysroot=$(ANDROID_SYSROOT) -I$(ANDROID_STL_INC)
|
||||||
LDLIBS += $(ANDROID_STL_LIB)
|
LDLIBS += $(ANDROID_STL_LIB)
|
||||||
|
|
@ -53,7 +59,6 @@ endif
|
||||||
# and http://www.cryptopp.com/wiki/ARM_Embedded_(Bare Metal).
|
# and http://www.cryptopp.com/wiki/ARM_Embedded_(Bare Metal).
|
||||||
ifeq ($(IS_ARM_EMBEDDED),1)
|
ifeq ($(IS_ARM_EMBEDDED),1)
|
||||||
# CPP, CXX, AR, RANLIB, LD, etc are set in 'setenv-embedded.sh'
|
# CPP, CXX, AR, RANLIB, LD, etc are set in 'setenv-embedded.sh'
|
||||||
CXXFLAGS = -DNDEBUG -g2 -Os -pipe -fPIC
|
|
||||||
CXXFLAGS += -DCRYPTOPP_DISABLE_ASM $(ARM_EMBEDDED_FLAGS)
|
CXXFLAGS += -DCRYPTOPP_DISABLE_ASM $(ARM_EMBEDDED_FLAGS)
|
||||||
CXXFLAGS += --sysroot=$(ARM_EMBEDDED_SYSROOT)
|
CXXFLAGS += --sysroot=$(ARM_EMBEDDED_SYSROOT)
|
||||||
endif
|
endif
|
||||||
|
|
@ -62,12 +67,9 @@ ifneq ($(CLANG_COMPILER),0)
|
||||||
CXXFLAGS += -Wno-tautological-compare -Wno-unused-value
|
CXXFLAGS += -Wno-tautological-compare -Wno-unused-value
|
||||||
endif
|
endif
|
||||||
|
|
||||||
SRCS = $(wildcard *.cpp)
|
SRCS = $(filter-out pch.cpp cryptlib_bds.cpp winpipes.cpp, $(wildcard *.cpp))
|
||||||
ifeq ($(SRCS),) # workaround wildcard function bug in GNU Make 3.77
|
|
||||||
SRCS = $(shell echo *.cpp)
|
|
||||||
endif
|
|
||||||
|
|
||||||
OBJS = $(SRCS:.cpp=.o)
|
OBJS = $(SRCS:.cpp=.o)
|
||||||
|
|
||||||
# test.o needs to be after bench.o for cygwin 1.1.4 (possible ld bug?)
|
# test.o needs to be after bench.o for cygwin 1.1.4 (possible ld bug?)
|
||||||
TESTOBJS = bench.o bench2.o test.o validat1.o validat2.o validat3.o adhoc.o datatest.o regtest.o fipsalgt.o dlltest.o
|
TESTOBJS = bench.o bench2.o test.o validat1.o validat2.o validat3.o adhoc.o datatest.o regtest.o fipsalgt.o dlltest.o
|
||||||
LIBOBJS = $(filter-out $(TESTOBJS),$(OBJS))
|
LIBOBJS = $(filter-out $(TESTOBJS),$(OBJS))
|
||||||
|
|
@ -86,7 +88,7 @@ test: cryptest.exe
|
||||||
./cryptest.exe v
|
./cryptest.exe v
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-$(RM) cryptest.exe libcryptopp.a libcryptopp.so $(LIBOBJS) $(DLLOBJS) $(TESTOBJS)
|
-$(RM) cryptest.exe libcryptopp.a libcryptopp.so GNUmakefile.deps $(LIBOBJS) $(DLLOBJS) $(TESTOBJS)
|
||||||
-$(RM) -r *.dSYM
|
-$(RM) -r *.dSYM
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
|
@ -121,3 +123,11 @@ endif
|
||||||
|
|
||||||
%.o : %.cpp
|
%.o : %.cpp
|
||||||
$(CXX) $(CXXFLAGS) -c $<
|
$(CXX) $(CXXFLAGS) -c $<
|
||||||
|
|
||||||
|
# Do not build dependencies when cleaning
|
||||||
|
ifneq ($(findstring clean,$(MAKECMDGOALS)),clean)
|
||||||
|
-include GNUmakefile.deps
|
||||||
|
endif
|
||||||
|
|
||||||
|
GNUmakefile.deps:
|
||||||
|
$(CXX) $(CXXFLAGS) -MM *.cpp > GNUmakefile.deps
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue