summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorChristian Seiler <christian@iwakd.de>2015-05-28 18:33:21 +0200
committerMike Christie <michaelc@cs.wisc.edu>2015-06-05 14:06:55 -0500
commitda2473dc01bd5d6c4909e61d3b00284e5535f2ca (patch)
treea3bdccfda13f1ae645d34af325766771eadf66b7 /Makefile
parent4a4498b3379599c25d5276dee84b328840ce969e (diff)
downloadopen-iscsi-da2473dc01bd5d6c4909e61d3b00284e5535f2ca.tar.gz
buildsys: respect CFLAGS and LDFLAGS from the outside
Make the build systsem respect CFLAGS and LDFLAGS set from the outside. Previously, OPTFLAGS could be set to alter CFLAGS (which were overridden completely), but that is non-standard, so also check for user-set CFLAGS. This will make life easier when packaging this for distributions. If OPTFLAGS is set, prefer that to CFLAGS to retain the old behavior in that case (and not break current builds). Additionally, also use LDFLAGS for linking the binaries, which was not respected at all previously.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 12 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 188e3bd..1ef9273 100644
--- a/Makefile
+++ b/Makefile
@@ -20,6 +20,17 @@ INSTALL = install
ETCFILES = etc/iscsid.conf
IFACEFILES = etc/iface.example
+# Compatibility: parse old OPTFLAGS argument
+ifdef OPTFLAGS
+CFLAGS = $(OPTFLAGS)
+endif
+
+# Export it so configure of iscsiuio & open-isns will
+# pick it up.
+ifneq (,$(CFLAGS))
+export CFLAGS
+endif
+
# Random comments:
# using '$(MAKE)' instead of just 'make' allows make to run in parallel
# over multiple makefile.
@@ -44,7 +55,7 @@ user: utils/open-isns/Makefile iscsiuio/Makefile
@echo "Read README file for detailed information."
utils/open-isns/Makefile: utils/open-isns/configure utils/open-isns/Makefile.in
- cd utils/open-isns; ./configure CFLAGS="$(OPTFLAGS)" --with-security=no
+ cd utils/open-isns; ./configure --with-security=no
iscsiuio/Makefile: iscsiuio/configure iscsiuio/Makefile.in
cd iscsiuio; ./configure