summaryrefslogtreecommitdiff
path: root/GNUmakefile
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2002-10-04 17:31:41 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2002-10-04 17:31:41 +0000
commitb21162cf8e06f40baa1f58be6a8c17435cebc34d (patch)
tree8b045309c238226c32a563b1df6b9c30a2f0e0b3 /GNUmakefile
downloadcryptopp-b21162cf8e06f40baa1f58be6a8c17435cebc34d.tar.gz
Initial revision
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@2 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile58
1 files changed, 58 insertions, 0 deletions
diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644
index 0000000..32226e2
--- /dev/null
+++ b/GNUmakefile
@@ -0,0 +1,58 @@
+# can't use -fno-rtti yet because it causes problems with exception handling in GCC 2.95.2
+CXXFLAGS = -g
+# uncomment the next two lines to do a release build
+# CXXFLAGS = -O2 -DNDEBUG -ffunction-sections -fdata-sections
+# LDFLAGS = -Wl,--gc-sections
+ARFLAGS = -cr # ar needs the dash on OpenBSD
+RANLIB = ranlib
+UNAME = $(shell uname)
+
+ifeq ($(UNAME),) # for DJGPP, where uname doesn't exist
+CXXFLAGS += -mbnu210
+else
+CXXFLAGS += -pipe
+endif
+
+ifeq ($(UNAME),Darwin) # -fpic conflicts with inline asm in integer.cpp on i386
+CXX = c++
+CXXFLAGS += -fno-pic
+endif
+
+ifeq ($(UNAME),SunOS)
+LDLIBS = -lnsl -lsocket
+endif
+
+ifeq ($(CXX),gcc) # for some reason CXX is gcc on cygwin 1.1.4
+CXX = g++
+endif
+
+SRCS = $(wildcard *.cpp)
+
+ifeq ($(SRCS),) # workaround wildcard function bug in GNU Make 3.77
+SRCS = $(shell ls *.cpp)
+endif
+
+OBJS = $(SRCS:.cpp=.o)
+# test.o needs to be after bench.o for cygwin 1.1.4 (possible ld bug?)
+TESTOBJS = bench.o test.o validat1.o validat2.o validat3.o
+LIBOBJS = $(filter-out $(TESTOBJS),$(OBJS))
+
+all: cryptest.exe
+
+clean:
+ $(RM) cryptest.exe libcryptopp.a $(LIBOBJS) $(TESTOBJS)
+
+libcryptopp.a: $(LIBOBJS)
+ $(AR) $(ARFLAGS) $@ $(LIBOBJS)
+ $(RANLIB) $@
+
+cryptest.exe: libcryptopp.a $(TESTOBJS)
+ $(CXX) -o $@ $(CXXFLAGS) $(TESTOBJS) -L. -lcryptopp $(LDFLAGS) $(LDLIBS)
+
+nolib: $(OBJS) # makes it faster to test changes
+ $(CXX) -o ct $(CXXFLAGS) $(OBJS) $(LDFLAGS) $(LDLIBS)
+
+.SUFFIXES: .cpp
+
+.cpp.o:
+ $(CXX) $(CXXFLAGS) -c $<