Subject: Re: (b)make enhancement
To: None <tech-toolchain@netbsd.org, Harlan.Stenn@pfcs.com>
From: Harlan Stenn <Harlan.Stenn@pfcs.com>
List: tech-toolchain
Date: 01/17/2003 14:57:53
Basically, I added:
.error message
and
.warn message
along side .include and .undef .
Here's a more detailed explanation:
--- make.1.orig Thu Jan 16 20:33:26 2003
+++ make.1 Thu Jan 16 20:56:26 2003
@@ -806,18 +806,20 @@
.Ar cmd
to the variable.
.El
-.Sh INCLUDE STATEMENTS, CONDITIONALS AND FOR LOOPS
-Makefile inclusion, conditional structures and for loops reminiscent
+.Sh DIRECTIVE, CONDITIONALS AND FOR LOOPS
+Directives, conditional structures and for loops reminiscent
of the C programming language are provided in
.Nm "" .
All such structures are identified by a line beginning with a single
dot
.Pq Ql \&.
character.
-Files are included with either
-.Cm \&.include Aq Ar file
-or
-.Cm \&.include Pf \*q Ar file Ns \*q .
+.Pp
+The following directives are supported:
+.Bl -tag -width Ds
+.It Ic .include Aq Ar file
+.It Ic .include Pf \*q Ar file Ns \*q .
+Include the specified file.
Variables between the angle brackets or double quotes are expanded
to form the file name.
If angle brackets are used, the included makefile is expected to be in
@@ -836,14 +838,26 @@
or as
.Cm .sinclude
then errors locating and/or opening include files are ignored.
+.It Ic .undef Ar variable
+Un-define the specified global variable.
+Only global variables may be un-defined.
+.It Ic .error Ar message
+Terminate the processing of the makefile immediately.
+The filename of the makefile, the line on which the error was encountered
+and the specified message are printed to standard output and
+.Nm
+terminates with exit code 1.
+Variables in the message are expanded.
+.It Ic .warn Ar message
+The filename of the makefile, the line on which the warning was encountered
+and the specified message are printed to standard output.
+Variables in the message are expanded.
+.El
.Pp
Conditional expressions are also preceded by a single dot as the first
character of a line.
The possible conditionals are as follows:
.Bl -tag -width Ds
-.It Ic .undef Ar variable
-Un-define the specified global variable.
-Only global variables may be un-defined.
.It Xo
.Ic \&.if
.Oo \&! Oc Ns Ar expression