forked from haproxy/haproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUILD: makefile: make ERR apply to build options as well
Once in a while we find some makefiles ignoring some outdated arguments and just emit a warning. What's annoying is that if users (say, distro packagers), have purposely added ERR=1 to their build scripts to make sure to fail on any warning, these ones will be ignored and the build can continue with invalid or missing options. William rightfully suggested that ERR=1 should also catch make's warnings so this patch implements this, by creating a new "complain" variable that points either to "error" or "warning" depending on $(ERR), and that is used to send the messages using $(call $(complain),...). This does the job right at little effort (tested from GNU make 3.82 to 4.3). Note that for this purpose the ERR declaration was upped in the makefile so that it appears before the new errors.mk file is included.
- Loading branch information
Showing
3 changed files
with
19 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# error handling: define a "complain" function that maps either to "warning" or | ||
# "error" depending on the "ERR" variable. The callers must use: | ||
# $(call $(complain),<msg>) | ||
|
||
ifneq ($(ERR:0=),) | ||
complain = error | ||
else | ||
complain = warning | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters