An explicit syntax for exporting all global variables is much safer
than allowing .export with no argument to do the same.
Add .export-all and have .export with no argument throw a warning saying
to use .export-all
Reviewed by: rillig
When make complains about an unwritable .OBJDIR
it is not always obvious how we derrived that value.
If MAKE_DEBUG_OBJDIR_CHECK_WRITABLE is enabled call PrintOnError
so we can examine variables that are likely relevant.
Fix description of MAKE_OBJDIR_CHECK_WRITABLE in make.1
SetErrorVars can now set .ERROR_EXIT which allows
a .ERROR target to ignore the case of .ERROR_EXIT == 6
which means failure happened elsewhere.
Reviewed by:
Since .SHELL is potentially used in compat mode as well,
the man page description should not imply it is only used in jobs mode.
Remove path="sh" from shell-sh unit-test - and it would have detected
this bug.
Reviewed by: rillig
If _SC_NPROCESSORS_ONLN is supported; and -j arg is a floating point
number or ends in 'C' compute .MAKE.JOBS as a multiple of _SC_NPROCESSORS_ONLN
Based on a suggestion from des at freebsd.org
Discussed with: rillig, christos
The value of the variable is passed to stat(2)
and st_mtime is new value.
An optional arg can be used if stat(2) fails, otherwise
the current time is used.
See varmod-mtime.mk for usage examples.
For at least 20 years, the setting of .PREFIX in make
has not matched the documentation.
Since the documented behavior does not match reality or
POSIX make, fix the documentation.
In FindDepsRegularPath str_basename is applied to .PREFIX
this is wrong, but I was unable to verify fixing it
was benign in NetBSD build - my NetBSD box (7.2)
was unable to build known-good src with or without any patches.
For now just document the behavior more accurately.
In a code example, replace the deprecated `pwd` with the preferred form
$$(pwd).
Shorten the paragraph about escaping a dollar in modifiers, as the
various escaping mechanisms are described in the section 'Expansion of
variables'.
Summarize the previously many cases of the ':from=to' modifier to be
simpler to understand, actually mention what the pattern matching
character '%' can match.
Describe the syntax of function call expressions in conditionals.
Previously, only the function names had been documented.
Directives such as .error or .undef are not conditionals. Having these
directives mixed in a single list made it more difficult to see how the
directives relate.
Most changes are editorial. Notable exceptions are:
The ':Q' in MAKE_PRINT_VAR_ON_ERROR was wrongly added in the previous
commit. As that variable does not produce a shell command, there is no
point in quoting the characters.
Since 2012.10.07.19.17.31, make doesn't complain anymore if a shell
command in compat mode expands to an empty string, which removes the
need to "keep make happy".
String literals in quotes are never interpreted as numbers.
The operators '<', '<=', '>', '>=' are only allowed in numeric
comparisons.
Avoid the term 'C relational operators' since in C, the relational
operators exclude '==' and '!=', which are called equality operators
instead.
Move For_Break further up, as the functions in that file are sorted from
small to big. The cast from size_t to unsigned int is required by lint.
In parse.c, move the code into a separate function to keep
ParseDirective small. Its only job is to parse the directive and then
delegate to another function doing the actual work.
In the manual page, remove empty lines.
In the test, ensure that .break stops processing of the .for loop
immediately; anything after the .break is not processed anymore.
Replace ':=' with '=', as there is no need to evaluate '$i' early.
Check the expected value in the .mk file instead of the .exp file, to
keep the reading scope as small as possible.
When .break is encountered within a .for loop
it causes immediate termination.
Outside of a .for loop .break causes a parse error.
Reviewed by: christos