From b84112eb4cb5e06b79fafd28f208af0417184f5e Mon Sep 17 00:00:00 2001 From: weidai Date: Sat, 9 Dec 2006 17:09:01 +0000 Subject: add -pthread and allow make install git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@242 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- GNUmakefile | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index 569b32f..7e7358d 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -6,13 +6,20 @@ CXXFLAGS = -g # after turning on -O2. The GCC optimizer may have bugs that cause it to generate incorrect code. # Try removing -fdata-sections if you get "undefined external reference" errors. # CXXFLAGS = -O2 -DNDEBUG -ffunction-sections -fdata-sections -# LDFLAGS = -Wl,--gc-sections +# LDFLAGS += -Wl,--gc-sections ARFLAGS = -cr # ar needs the dash on OpenBSD RANLIB = ranlib +CP = cp +MKDIR = mkdir UNAME = $(shell uname) ISX86 = $(shell uname -m | grep -c "i.86\|x86_64") ISMINGW = $(shell uname | grep -c "MINGW32") +# Default prefix for make install +ifeq ($(PREFIX),) +PREFIX = /usr +endif + ifeq ($(CXX),gcc) # for some reason CXX is gcc on cygwin 1.1.4 CXX = g++ endif @@ -42,6 +49,10 @@ else CXXFLAGS += -pipe endif +ifeq ($(UNAME),Linux) +LDFLAGS += -pthread +endif + ifeq ($(UNAME),Darwin) AR = libtool ARFLAGS = -static -o @@ -80,6 +91,12 @@ all: cryptest.exe clean: $(RM) cryptest.exe libcryptopp.a $(LIBOBJS) $(TESTOBJS) cryptopp.dll libcryptopp.dll.a libcryptopp.import.a cryptest.import.exe dlltest.exe $(DLLOBJS) $(LIBIMPORTOBJS) $(TESTIMPORTOBJS) $(DLLTESTOBJS) +install: + $(MKDIR) -p $(PREFIX)/include/cryptopp $(PREFIX)/lib $(PREFIX)/bin + $(CP) *.h $(PREFIX)/include/cryptopp + $(CP) *.a $(PREFIX)/lib + $(CP) *.exe $(PREFIX)/bin + libcryptopp.a: $(LIBOBJS) $(AR) $(ARFLAGS) $@ $(LIBOBJS) $(RANLIB) $@ -- cgit v1.2.1