summaryrefslogtreecommitdiff
path: root/release/src/router/matrixssl/src/Makefile
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2015-01-03 13:58:15 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2015-01-03 13:58:15 +0100
commit4aca87515a5083ae0e31ce3177189fd43b6d05ac (patch)
tree7b1d9a31393ca090757dc6f0d3859b4fcd93f271 /release/src/router/matrixssl/src/Makefile
parent008d0be72b2f160382c6e880765e96b64a050c65 (diff)
downloadtomato-4aca87515a5083ae0e31ce3177189fd43b6d05ac.tar.gz
tomato-4aca87515a5083ae0e31ce3177189fd43b6d05ac.tar.bz2
patch to Vanilla Tomato 1.28
Diffstat (limited to 'release/src/router/matrixssl/src/Makefile')
-rw-r--r--release/src/router/matrixssl/src/Makefile130
1 files changed, 130 insertions, 0 deletions
diff --git a/release/src/router/matrixssl/src/Makefile b/release/src/router/matrixssl/src/Makefile
new file mode 100644
index 00000000..db058d4f
--- /dev/null
+++ b/release/src/router/matrixssl/src/Makefile
@@ -0,0 +1,130 @@
+#
+# Makefile for MatrixSSL library
+# Builds optimized shared library by default.
+# See comments below for building a debug library.
+# Copyright (c) PeerSec Networks, 2002-2009. All Rights Reserved.
+#
+
+CC = $(CROSS_COMPILE)gcc
+STRIP = $(CROSS_COMPILE)strip
+AR = $(CROSS_COMPILE)ar
+RANLIB = $(CROSS_COMPILE)ranlib
+O = .o
+SO = .so
+A = .a
+E =
+
+LIBRARY = libmatrixssl$(SO)
+STATIC = libmatrixsslstatic$(A)
+
+OBJECTS = \
+ cipherSuite$(O) \
+ matrixSsl$(O) \
+ sslDecode$(O) \
+ sslEncode$(O) \
+ sslv3$(O) \
+ os/debug$(O) \
+ os/linux/linux$(O) \
+ crypto/peersec/arc4$(O) \
+ crypto/peersec/base64$(O) \
+ crypto/peersec/des3$(O) \
+ crypto/peersec/md5$(O) \
+ crypto/peersec/md2$(O) \
+ crypto/peersec/mpi$(O) \
+ crypto/peersec/rsa$(O) \
+ crypto/peersec/sha1$(O) \
+ pki/asn1$(O) \
+ pki/rsaPki$(O) \
+ pki/x509$(O)
+
+#
+# Debug flags (Define MATRIXSSL_DEBUG in shell to build debug)
+# bash: export MATRIXSSL_DEBUG=1
+# unset MATRIXSSL_DEBUG
+# tcsh: setenv MATRIXSSL_DEBUG 1
+# unsetenv MATRIXSSL_DEBUG
+#
+#MATRIXSSL_DEBUG = 1
+ifdef MATRIXSSL_DEBUG
+DFLAGS = -g -Wall -Winline -Wdisabled-optimization -Wno-pointer-sign -Wno-sign-compare -DDEBUG
+STRIP = test
+else
+#DFLAGS = -Os
+DFLAGS = -O3
+endif
+
+ifdef MATRIXSSL_PROFILE
+DFLAGS += -g -pg
+STRIP = test
+endif
+
+#
+# Override variables for compilation on x86-64 (AMD64, Nacona, etc)
+#
+# ifeq ($(shell uname -m),x86_64)
+# DFLAGS += -march=k8 -fPIC -DFP_64BIT -DTFM_X86_64 -DRDTSC
+# endif
+
+#
+# Compile options
+#
+SHARED = -shared
+CFLAGS = $(DFLAGS) -fPIC -DLINUX -I./
+# Add these for MPI2 -funroll-all-loops -fomit-frame-pointer
+LDFLAGS += -lc -lpthread
+
+#
+# Override variables for compilation on Mac OS X (Darwin)
+#
+ifeq ($(shell uname),Darwin)
+CC = cc
+SO = .dylib
+SHARED = -dynamiclib
+CFLAGS += -DOSX -isystem -I/usr/include
+#LDFLAGS += -install_name @rpath/$(LIBRARY)
+LDFLAGS += -flat_namespace -install_name @executable_path/./$(LIBRARY)
+STRIP = test
+endif
+
+#
+# Override variables for compilation on uClinux (example only)
+#
+ifdef UCLINUX
+CC = /opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
+STRIP = /opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-strip
+endif
+
+all: compile
+
+compile: $(OBJECTS) $(LIBRARY) $(STATIC)
+
+#
+# Manual dependencies
+#
+*.o: ../matrixSsl.h ../matrixCommon.h matrixInternal.h matrixConfig.h Makefile
+os/*.o: matrixInternal.h matrixConfig.h Makefile os/osLayer.h os/psMalloc.h
+os/linux/*.o: matrixInternal.h matrixConfig.h Makefile os/osLayer.h
+crypto/peersec/*.o: matrixInternal.h matrixConfig.h Makefile \
+ crypto/peersec/mpi.h \
+ crypto/cryptoLayer.h crypto/peersec/pscrypto.h
+pki/*.o: matrixInternal.h matrixConfig.h Makefile \
+ pki/matrixPki.h pki/pkiInternal.h
+#
+# Build the library
+#
+$(LIBRARY): $(OBJECTS)
+ $(CC) $(SHARED) -o $@ $^ $(LDFLAGS)
+ $(STRIP) $(LIBRARY)
+
+#
+# Build the static library
+#
+$(STATIC): $(OBJECTS)
+ $(AR) -rcuv $@ $^
+ $(RANLIB) $@
+
+#
+# Clean up all generated files
+#
+clean:
+ rm -f $(LIBRARY) $(OBJECTS) $(STATIC)