]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] diag: new make function $(am.fatal)
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 12 Aug 2012 18:42:02 +0000 (20:42 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 13 Aug 2012 15:32:03 +0000 (17:32 +0200)
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>
automake.in
lib/am/header-vars.mk

index 6005424fa4d117e597a7be857c29c02dea276261..3117f725ef461871fb8136f0087a36826d63ab63 100644 (file)
@@ -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)
index 50519a1183ab0e1152bd915f84a0cef11c78a9e7..27699ba4167e47f0d4dbf00a36a5a1592ee0fb5f 100644 (file)
@@ -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