From 46eb13828e100cee250b94bac9f36784ed4bec08 Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Sun, 30 Jan 2011 17:10:13 +0000
Subject: [PATCH] - Makefiles now respect external CFLAGS and LDFLAGS. Closes
ticket #2
---
library/Makefile | 6 +++---
programs/Makefile | 4 ++--
tests/Makefile | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/library/Makefile b/library/Makefile
index 8b59114c98..58bdfdf20e 100644
--- a/library/Makefile
+++ b/library/Makefile
@@ -1,7 +1,7 @@
# Also see "include/polarssl/config.h"
-CFLAGS = -I../include -D_FILE_OFFSET_BITS=64 -Wall -W -Wdeclaration-after-statement
+CFLAGS += -I../include -D_FILE_OFFSET_BITS=64 -Wall -W -Wdeclaration-after-statement
OFLAGS = -O
# MicroBlaze specific options:
@@ -46,11 +46,11 @@ libpolarssl.a: $(OBJS)
libpolarssl.so: libpolarssl.a
echo " LD $@"
- $(CC) -shared -Wl,-soname,$@ -o $@ $(OBJS)
+ $(CC) ${LDFLAGS} -shared -Wl,-soname,$@ -o $@ $(OBJS)
libpolarssl.dylib: libpolarssl.a
echo " LD $@"
- $(CC) -dynamiclib -o $@ $(OBJS)
+ $(CC) ${LDFLAGS} -dynamiclib -o $@ $(OBJS)
.c.o:
echo " CC $<"
diff --git a/programs/Makefile b/programs/Makefile
index 025d8f5d24..9ad47ecb61 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -3,9 +3,9 @@
# To compile on MinGW: add "-lws2_32" to LDFLAGS
# To compile with PKCS11: add "-lpkcs11-helper" to LDFLAGS
-CFLAGS = -I../include -D_FILE_OFFSET_BITS=64 -Wall -W -Wdeclaration-after-statement
+CFLAGS += -I../include -D_FILE_OFFSET_BITS=64 -Wall -W -Wdeclaration-after-statement
OFLAGS = -O
-LDFLAGS = -L../library -lpolarssl
+LDFLAGS += -L../library -lpolarssl
APPS = aes/aescrypt2 aes/crypt_and_hash \
hash/hello hash/generic_sum \
diff --git a/tests/Makefile b/tests/Makefile
index af4a7c420a..8b80b3e9b9 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -3,11 +3,11 @@
# To compile on MinGW: add "-lws2_32" to LDFLAGS
# To compile with PKCS11: add "-lpkcs11-helper" to LDFLAGS
-CFLAGS = -I../include -D_FILE_OFFSET_BITS=64 -Wall -W -Wdeclaration-after-statement \
+CFLAGS += -I../include -D_FILE_OFFSET_BITS=64 -Wall -W -Wdeclaration-after-statement \
-Wno-unused-function -Wno-unused-value
OFLAGS = -O
-LDFLAGS = -L../library -lpolarssl
+LDFLAGS += -L../library -lpolarssl
APPS = test_suite_aes test_suite_arc4 \
test_suite_base64 test_suite_camellia \