diff options
Diffstat (limited to 'GNUmakefile')
-rw-r--r-- | GNUmakefile | 19 |
1 files changed, 18 insertions, 1 deletions
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) $@ |