From: Stefano Lattarini Date: Sun, 12 Aug 2012 18:42:02 +0000 (+0200) Subject: [ng] diag: new make function $(am.fatal) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3408fea2205b82df473c8655e3c37e8c43333e2;p=thirdparty%2Fautomake.git [ng] diag: new make function $(am.fatal) 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 --- diff --git a/automake.in b/automake.in index 6005424fa..3117f725e 100644 --- a/automake.in +++ b/automake.in @@ -6765,8 +6765,7 @@ sub generate_makefile ($$) # 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) diff --git a/lib/am/header-vars.mk b/lib/am/header-vars.mk index 50519a118..27699ba41 100644 --- a/lib/am/header-vars.mk +++ b/lib/am/header-vars.mk @@ -45,6 +45,11 @@ define am.error $(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