Commit Graph

368 Commits

Author SHA1 Message Date
sjg 90280d3b93 make.1: note that %s should only be used with :localtime 2023-08-20 19:58:15 +00:00
rillig acb8ae43d7 make.1: clean up wording, clarify scope of '!' in conditions 2023-06-28 06:15:07 +00:00
sjg 699fcfcdaa Make :mtime operate on each word in variable value.
Reviewed by: rillig
2023-05-10 18:22:33 +00:00
sjg dbf16036c3 make: :mtime=error throw error on stat(2) failure
Sometimes we want fatal error if stat fails on the
presumed pathname.
2023-05-09 20:53:23 +00:00
sjg ff8067fc6f make: add :mtime to provide mtime of file
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.
2023-05-09 20:14:27 +00:00
sjg 9c8e40c4fa make.1: lose the trailing blank lines 2023-05-07 16:43:50 +00:00
sjg 5a93219217 make: fix description of .PREFIX
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.
2023-05-07 16:32:47 +00:00
sjg 29a673fa23 Document unexplained *** Error code 6 2023-03-23 03:29:28 +00:00
sjg e2f523b9a6 make: some variables should be read-only
Make variables like .newline and .MAKE.{GID,PID,PPID,UID} read-only.

Reviewed by: rillig
2023-01-26 20:48:17 +00:00
sjg 8e4b5cfef0 make: .SYSPATH: to add dirs to sysIncPath
.SYSPATH: with no sources will clear sysIncPath
otherwise sources are added

Reviewed by: rillig
2023-01-24 00:24:02 +00:00
sjg ca0cc05370 make: .[NO]READONLY for control of read-only variables
Reviewed by: rillig
2023-01-23 23:01:52 +00:00
rillig 45ace73b72 make.1: bump date 2023-01-01 21:02:09 +00:00
rillig 8e09af3040 make.1: fix markup 2023-01-01 19:55:25 +00:00
rillig 502439098e make.1: sync list of built-in variables with reality
Fixes PR 57029.
2023-01-01 19:10:58 +00:00
rillig cea4af7ad3 make.1: sort list of built-in variables 2023-01-01 17:27:40 +00:00
rillig b0a5fb511c make.1: use consistent markup for boolean flags 2023-01-01 17:17:09 +00:00
rillig 11dbf5aaaf make.1: move description of .MAKE.MODE below the .MAKE.META block 2023-01-01 17:15:07 +00:00
rillig 193f1f6ffd make.1: reduce indentation of the long list of variable names 2023-01-01 16:49:27 +00:00
rillig f5a044d5d6 make.1: clarify in which case an expression may omit braces 2022-11-29 23:56:05 +00:00
rillig 2b7b086f37 make.1: make horizontal and vertical spacing more consistent 2022-11-15 07:58:00 +00:00
rillig 9c582520c3 make.1: clean up style, typography, accuracy
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.
2022-10-02 23:36:41 +00:00
uwe 7f73633888 make(1): fix and simplify optional negation on conditional 2022-09-15 14:49:36 +00:00
uwe eda6bbda16 make(1): use .Dl for one-line literal display 2022-09-15 14:39:33 +00:00
rillig f3842871fb make.1: make typography more consistent 2022-09-14 20:39:23 +00:00
rillig 641e59034d make.1: fix typography, especially spacing 2022-09-14 20:18:24 +00:00
rillig 231bb012d3 make.1: fix style of ellipsis
In most places, '...' is not intended to be entered verbatim, instead it
is a placeholder, so don't use a fixed-width font for it.
2022-09-12 07:21:10 +00:00
rillig 48b12f17b3 make.1: remove extraneous .El, update date 2022-09-12 07:13:02 +00:00
rillig 340ff79b9a make.1: split section on directives into several subsections
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.
2022-09-12 07:10:59 +00:00
uwe 10a3e782b5 make(1): add space before the punctuation argument 2022-09-09 10:57:39 +00:00
rillig 6836e7ba01 make.1: clean up and make the description more accurate
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".
2022-09-09 06:23:36 +00:00
rillig c5a155a374 make.1: only use .Pa for actual pathnames 2022-09-09 05:27:32 +00:00
rillig fc8c6bcdfc make.1: rewrite many details in a more precise way 2022-09-08 20:22:55 +00:00
rillig ec40413dc3 make.1: clean up style, grammar, punctuation, improve clarity 2022-09-07 23:34:56 +00:00
rillig 0ba6f9d9a6 make.1: remove redundant 'then' from conditional sentences. 2022-09-07 22:57:43 +00:00
rillig f69e668dd2 make.1: use present tense in conditional sentences
These sentences are about general, timeless rules, rather than about
predictions about the future.
2022-09-07 22:36:48 +00:00
rillig 33a45076d3 make.1: clarify interpretation of conditionals
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.
2022-09-05 17:13:36 +00:00
rillig 863fcc7b0b make: clean up handling of .break in .for loops
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.
2022-09-03 00:50:07 +00:00
sjg 5cc8492191 make: add .break to terminate .for loop early
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
2022-09-02 16:24:31 +00:00
uwe 5787f4b7f0 make(1): mark up the variable expansion example 2022-08-14 22:11:20 +00:00
uwe e92ea9877b make(1): use .Dl for .MAKE.JOB.PREFIX examples 2022-08-14 21:57:26 +00:00
uwe 633d46b244 make(1): prettify .for index variable example 2022-08-14 21:53:58 +00:00
uwe b130886ead make(1): more .Va fixes 2022-08-14 21:48:05 +00:00
uwe 60fc1c8536 make(1): mark up FRC in BUGS 2022-08-14 20:19:27 +00:00
uwe a67042efb2 make(1): Use .Dq instead of literal ASCII quotes 2022-08-14 20:07:18 +00:00
uwe db6d3d6b54 make(1): Be consistent about using .Va for make variables 2022-08-14 20:04:07 +00:00
rillig 0288f8100f make.1: fix accidental removal of the directive 'export' 2022-08-14 19:26:39 +00:00
uwe eb54120ac9 make(1): more .Ar fixes 2022-08-14 10:14:58 +00:00
uwe ad2bf568ed make(1): ".../" in -m option description is literal ".../" 2022-08-14 09:47:29 +00:00
uwe 04f8e27bbc make(1): Consistent formatting for -i and -s descriptions. 2022-08-14 09:11:33 +00:00
uwe 059d027760 make(1): Fix markup of the -d[flags] section.
The debug flags are literals, not syntactic variables (.Ar).
While here use .Dq for quoted words in the text.
2022-08-14 09:08:29 +00:00