Commit Graph

16588 Commits

Author SHA1 Message Date
rillig
ecc876b838 make(1): clean up ParseRawLine 2020-12-19 00:27:34 +00:00
rillig
0c5e588e71 make(1): extract ParseRawLine from ParseGetLine 2020-12-19 00:20:57 +00:00
rillig
e7a3ec57b0 make(1): clean up another local variable in ParseGetLine 2020-12-19 00:02:34 +00:00
rillig
7b504ab648 make(1): clean up UnescapeBackslash 2020-12-18 23:18:08 +00:00
rillig
419f399f4b make(1): remove unused parameter from UnescapeBackslash 2020-12-18 23:13:45 +00:00
rillig
effc4eb938 make(1): split ParseGetLine into separate functions 2020-12-18 19:02:37 +00:00
rillig
94e08101d9 make(1): separate ParseGetLine into paragraphs 2020-12-18 18:23:29 +00:00
rillig
b2ae71012b make(1): support using C99 bool for Boolean 2020-12-18 18:17:45 +00:00
rillig
6e84975ccd make(1): spell nonexistent consistently 2020-12-18 15:47:34 +00:00
rillig
d80c99b6f3 make(1): use symbolic time for 0 in Make_Recheck
This makes the test depsrc-optional independent from the current time
zone.
2020-12-18 14:46:44 +00:00
rillig
6e3f82b272 make(1): constify Targ_FmtTime 2020-12-18 14:36:46 +00:00
rillig
6357e11169 make(1): format function definitions consistently 2020-12-15 21:19:47 +00:00
rillig
a44c2b10bb make(1): indent nonints.h and util.c with tabs instead of spaces 2020-12-15 20:39:15 +00:00
rillig
b4c26ca2e4 make(1): indent make.c with tabs instead of spaces 2020-12-15 20:17:08 +00:00
rillig
cf28122d70 make(1): extract MakeChildren from MakeStartJobs 2020-12-15 19:47:02 +00:00
rillig
77e9059c21 make(1): indent job.h with tabs instead of spaces 2020-12-15 16:30:55 +00:00
rillig
6c432fc224 make(1): indent for.c using tabs instead of spaces 2020-12-15 16:24:17 +00:00
rillig
b1d7af486a make(1): clean up hash function for HashTable
Expressing a multiplication as a bit shifts and subtraction is the job
of the compiler.  For humans, a multiplication is easier to read.
2020-12-15 15:20:05 +00:00
rillig
4743be9ab6 make(1): indent hash.h and make_malloc.h with tabs instead of spaces 2020-12-15 01:23:55 +00:00
rillig
f779f26a46 make(1): document how to detect typos in .elif directives 2020-12-15 00:32:26 +00:00
rillig
623f275b16 make(1): clean up ParseReadLine
In function names, the word "get" was not used consistently to look up
or compute data, in several cases "get" was a synonym for "read", just
like in the standard C library (fgetc).

The really confusing part is that there are two functions now, called
ParseGetLine and ParseReadLine, and both were underdocumented.
2020-12-14 23:48:03 +00:00
rillig
a1af58d13b make(1): error out on .else with extraneous text 2020-12-14 22:17:11 +00:00
rillig
bb1cb5b505 make(1): error out if an '.endif' contains extraneous text 2020-12-14 21:56:17 +00:00
rillig
4d12251138 make(1): make structure of the code in Cond_EvalLine clearer 2020-12-14 21:35:21 +00:00
rillig
2f1b70eeeb make(1): add tests for parsing .if conditions 2020-12-14 21:02:25 +00:00
rillig
1eeb87db64 make(1): add more tests for parsing .endif 2020-12-14 20:57:31 +00:00
rillig
fa6ec3776b make(1): don't pretend to expand CondParser_Eval
At that point, the variable expression has already been expanded.  To
avoid the impression that the token might be relevant, pass FALSE
instead of TRUE.  No change of behavior.
2020-12-14 20:39:35 +00:00
rillig
da444aa84e make(1): add test for variable expressions after a parse error
These variable expressions don't need to be expanded, and they aren't.
2020-12-14 20:28:09 +00:00
rillig
22b3e4f8b0 make(1): add test for parsing the end of a condition 2020-12-14 20:23:49 +00:00
rillig
ed7166493f make(1): replace %zu with %u in printf calls
This is needed to compile bmake with GCC 2.8.1 on SunOS 5.9.

To support ancient systems like this, the whole code of usr.bin/make is
supposed to use only ISO C90 features, except for filemon, which is not
used on these systems.
2020-12-13 21:27:45 +00:00
rillig
ac4393a924 make(1): rename Vector.priv_cap to cap
There is no use case for accessing or even modifying the capacity of a
vector, therefore there is no need to hide it using the prefix "priv_".
This way, the member names are aligned between Buffer and Vector.
2020-12-13 20:57:17 +00:00
rillig
7f604d4793 make(1): add str_basename to reduce duplicate code
The function basename from POSIX has a few unfortunate properties, it is
allowed to return a pointer to static memory.  This is too unreliable,
therefore this trivial own implementation.
2020-12-13 20:14:48 +00:00
rillig
9ab63ee0aa make(1): constify progname 2020-12-13 20:09:02 +00:00
rillig
528c699500 make(1): fix .ERROR_TARGET in compat -k mode (since 2010-04-07) 2020-12-13 19:33:53 +00:00
rillig
95fe5be41c make(1): add tests for variable expansion in .ERROR handling 2020-12-13 19:08:20 +00:00
rillig
73287a0b22 make(1): document variable expansion in the .END node 2020-12-13 18:57:44 +00:00
christos
53f65f3d12 fix comment 2020-12-13 18:12:29 +00:00
rillig
6d3aa3c8ae make(1): demonstrate wrong error handling in compat mode 2020-12-13 17:44:31 +00:00
rillig
61121a11fe make(1): add comments for strange error handling in Compat_Run 2020-12-13 16:47:19 +00:00
rillig
a65a89393b make(1): extract InitSignals from Compat_Run 2020-12-13 16:32:57 +00:00
rillig
edc3918f88 make(1): extract MakeBeginNode from Compat_Run
The comment "execute the commands" had once been correct but not
anymore.  Since a few years, not only the commands of the .BEGIN and
.END nodes are executed, instead the nodes are made as usual, including
their dependencies.
2020-12-13 16:30:08 +00:00
rillig
67ff6c82cb make(1): extract UseShell from Compat_RunCommand 2020-12-13 16:14:40 +00:00
sjg
a39ab01a94 Prune job debug output that may appear out of order.
A race between child and parent means that we cannot
guarantee whether all child output is seen before we call
JobClosePipes, thus intervening debug output can appear
before or after the last child output.
2020-12-13 05:13:38 +00:00
rillig
2eebef5d2b make(1): remove dead code from GetVarnamesToUnexport
Now that the parsing of the directives is unified and strict, there is
no need anymore for the dispatched functions to check for unknown
directives.  These functions don't even get the information to decide
that since this decision is already done.
2020-12-13 02:15:49 +00:00
sjg
aefb247373 Avoid noise when csh does not exist 2020-12-13 02:09:55 +00:00
sjg
5f5af6046f Ensure we have a value for .MAKE.UID 2020-12-13 02:09:33 +00:00
rillig
e774dc5acc make(1): replace *line with line[0]
Since a line is not an iterator and since the expression *line typically
means "the current element", not "the first character", replacing *line
with line[0] more directly expresses the idea of accessing the first
character of a string.
2020-12-13 02:01:43 +00:00
rillig
40711a6e7b make(1): clean up comment for ParseDirective 2020-12-13 01:51:08 +00:00
rillig
b506ce346a make(1): clean up Var_Export 2020-12-13 01:41:12 +00:00
rillig
80fcd08175 make(1): replace bitset VarExportFlags with enum VarExportMode
The previous flags were not combined at all.
2020-12-13 01:33:17 +00:00