summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2024-03-08 15:05:35 +0000
committerAndrew Clayton <a.clayton@nginx.com>2024-03-09 01:40:24 +0000
commita171b399220b69d4b526769481a089a117265902 (patch)
tree733779d05d1a8d3b17ad44cb3a111872818a0b93
parentf55fa70c6935f0fa0ab5964830de83ae44006edb (diff)
downloadunit-a171b399220b69d4b526769481a089a117265902.tar.gz
unit-a171b399220b69d4b526769481a089a117265902.tar.bz2
Add an EXTRA_CFLAGS make variable
This variable is _appended_ to the main CFLAGS variable and allows setting extra compiler options at make time. E.g $ make EXTRA_CFLAGS="..." ... Useful for quickly testing various extra warning flags. Suggested-by: Alejandro Colomar <alx@kernel.org> Reviewed-by: Alejandro Colomar <alx@kernel.org> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
-rw-r--r--auto/make5
1 files changed, 4 insertions, 1 deletions
diff --git a/auto/make b/auto/make
index 28f8bec5..2788b9f5 100644
--- a/auto/make
+++ b/auto/make
@@ -20,7 +20,8 @@ PP_SED := @echo ' SED '
CC = $CC
AR = $AR
-CFLAGS = $NXT_CFLAGS $NXT_CC_OPT $CFLAGS
+EXTRA_CFLAGS =
+CFLAGS = $NXT_CFLAGS $NXT_CC_OPT $CFLAGS \$(EXTRA_CFLAGS)
NXT_EXEC_LINK = $NXT_EXEC_LINK $NXT_LD_OPT
NXT_SHARED_LOCAL_LINK = $NXT_SHARED_LOCAL_LINK $NXT_LD_OPT
@@ -548,6 +549,8 @@ help:
@echo " make D=1 ... - Enables debug builds (-O0)"
@echo " make E=0 ... - Disables -Werror"
@echo
+ @echo " make EXTRA_CFLAGS= ... - Add extra compiler options"
+ @echo
@echo " Variables can be combined."
END