Skip to content

Commit

Permalink
Add an EXTRA_CFLAGS make variable
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Alejandro Colomar <[email protected]>
Signed-off-by: Andrew Clayton <[email protected]>
  • Loading branch information
ac000 committed Mar 9, 2024
1 parent f55fa70 commit a171b39
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion auto/make
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit a171b39

Please sign in to comment.