automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] [PATCH 5/7] [ng] diag: new make function $(am.fatal)


From: Stefano Lattarini
Subject: [Automake-NG] [PATCH 5/7] [ng] diag: new make function $(am.fatal)
Date: Sun, 12 Aug 2012 23:20:10 +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 <address@hidden>
---
 automake.in           | 3 +--
 lib/am/header-vars.mk | 5 +++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/automake.in b/automake.in
index 12f2a99..3a11b53 100644
--- a/automake.in
+++ b/automake.in
@@ -6767,8 +6767,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 50519a1..27699ba 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
-- 
1.7.12.rc0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]