- Introduced windows DLL build and SYS_LDFLAGS
diff --git a/library/Makefile b/library/Makefile
index b1b8e2d..042c12c 100644
--- a/library/Makefile
+++ b/library/Makefile
@@ -17,6 +17,9 @@
# OSX shared library extension:
# DLEXT=dylib
+# Windows shared library extension:
+# DLEXT=dll
+
OBJS= aes.o arc4.o base64.o \
bignum.o camellia.o certs.o \
cipher.o cipher_wrap.o debug.o \
@@ -33,7 +36,7 @@
.SILENT:
-all: static
+all: static shared
static: libpolarssl.a
@@ -41,9 +44,9 @@
libpolarssl.a: $(OBJS)
echo " AR $@"
- ar r $@ $(OBJS)
+ $(AR) r $@ $(OBJS)
echo " RL $@"
- ranlib $@
+ $(AR) s $@
libpolarssl.so: libpolarssl.a
echo " LD $@"
@@ -53,6 +56,10 @@
echo " LD $@"
$(CC) ${LDFLAGS} -dynamiclib -o $@ $(OBJS)
+libpolarssl.dll: libpolarssl.a
+ echo " LD $@"
+ $(CC) -shared -Wl,-soname,$@ -o $@ $(OBJS) -lws2_32 -lwinmm -lgdi32
+
.c.o:
echo " CC $<"
$(CC) $(CFLAGS) $(OFLAGS) -c $<