Makefile more compatible with WINDOWS environment
diff --git a/library/Makefile b/library/Makefile
index 6337313..7b932b3 100644
--- a/library/Makefile
+++ b/library/Makefile
@@ -1,6 +1,9 @@
# Also see "include/polarssl/config.h"
+# To compile on MinGW: add "-lws2_32" to LDFLAGS or define WINDOWS in your
+# environment
+#
CFLAGS += -I../include -D_FILE_OFFSET_BITS=64 -Wall -W -Wdeclaration-after-statement
OFLAGS = -O
@@ -26,6 +29,7 @@
# Windows shared library extension:
ifdef WINDOWS
DLEXT=dll
+LDFLAGS += -lws2_32
endif
OBJS= aes.o arc4.o asn1parse.o \
@@ -75,5 +79,9 @@
$(CC) $(CFLAGS) $(OFLAGS) -c $<
clean:
+ifndef WINDOWS
rm -f *.o libpolarssl.*
-
+endif
+ifdef WINDOWS
+ del /Q /F *.o libpolarssl.*
+endif