Mostly a preparatory patch for future changes.
* lib/am/header-vars.mk (am.fatal): New.
* automake.in (generate_makefile): Use in instead of $(error) in the
generated make code exiting for earlier errors.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
# relevant diagnostic should have already been reported by any
# call to the function '$(am.error)', so we just print a generic
# "errors seen, stopping" message.
- $output_checks .= '$(if $(am.error.seen),' .
- '$(error Some Automake-NG error occurred))' .
+ $output_checks .= '$(if $(am.error.seen),$(call am.fatal))' .
"\n";
if ($exit_code != 0)
$(warning $1)$(eval am.error.seen := yes)
endef
+# Declare an error, and immediately terminate execution.
+define am.fatal
+$(if $1,$(call am.error,$1))$(error Some Automake-NG error occurred)
+endef
+
#
# Sometimes, in our makefiles, we want to assign a default value to a
# variable that might not have been assigned yet. One might think that