Parse_File(). Remove a comment and a piece of code comming from
ancient times when the if-directive read like #if and not .if.
Correctly analyze the first character of a line.
module. The only module accessing it (the current line number) was the
condition module, so pass the current line number as a function argument.
Centralize the pushing of new input sources into one function
ParsePushInput() and rename the function handling the popping from ParseEOF()
to ParsePopInput(). Make the entire thing a little bit clearer, by holding
the current input source in the top element of the stack instead of
using extra variables for this. Use a type-safe intrusive list for the
input stack.
A Path is now a TAILQ of PathElements each of which just points to
a reference counted directory. Rename all functions dealing with Paths
from the Dir_ prefix to a Path_ prefix.
It turns out that some ports use the obscure feature of spreading
a dependency block across multiple include files. While this seems
bad style, allow it for now and call said function only at end of
all input to process the really last line of everything.
patch differs from the previous one in that it calls the function
only when a real file hits EOF. The bodies of .for loops are also
handled as files, but for these we don't want to end a dependency block
on the 'EOF' as in:
foo:
do-this
.for ...
do-something
.endfor
do-more
itself. This will ease constification (think of what 'const Ptr foo'
means if Ptr is a pointer to a struct).
Submitted by: Max Okumoto <okumoto@ucsd.edu>
that get included just where they are needed. All headers include the
headers that they need to compile (just with an empty .c file). Sort
includes alphabetically where apropriate and fix some duplicate commenting
for struct Job, struct GNode and struct Shell by removing one version and
inlining the comments into the structure declaration (the comments have been
somewhat outdated).
This patch does not contain functional changes (checked with md5).
Submitted by: Max Okumoto <okumoto@ucsd.edu>
and tabs. This is still not correct for command line variable values
ending in a backslash because this would require a larger effort.
Document this limitation in the BUGS section of the man page. The
quoting is mostly compatible with that of gmake and smake.
Tested by: Max Okumoto and Joerg Sonnenberger from DragonFly BSD
Reviewed by: ru (man page, partly)
now that their size is only two pointers. This eliminates a lot of calls
to Lst_Init and from there to malloc together with many calls to
Lst_Destroy (in places where the list is obviously empty). This also
reduces the chance to leave a list uninitilized so we can remove more
NULL pointer checks and probably eliminates a couple of memory leaks.
and the sizeof operator, missing empty lines, void casts, extra empty lines.
Checked by: diff on make *.o lst.lib/*.o
Submitted by: Max Okumoto <okumoto@soe.ucsd.edu> (partly)
to the PR failed, because the line skipping function is actually called
from two places in the code to do quite different things (this should
be two functions probably): in a false .if to skip to the next line
beginning with a dot and to collect .for loops. In the seconds case we
should not skip comments, because they are actually harder to handle than
we need for the .if case and should defer this to the main code.
PR: bin/25627
Submitted by: Seth Kingsley (original patch)
slightly different from the patch in the PR. The problem is, that
make handles .if clauses inside false .if clauses simply by
counting them - it doesn't put them onto the conditional stack, nor even
parses them so we need an extra line number stack for these ifs.
PR: bin/61257
Submitted by: Mikhail Teterin <mi@aldan.algebra.com>
Use
make -V .MAKEFILE_LIST | tr \ \\n | awk '$0==".." {l--; next} {l++; printf "%*s%s\n", l, " ", $0}'
to print a tree of all included makefiles.
Approved by: joerg
MFC after: 1 week
the .for loop:
- Replaced four global variables in parse.c with one.
- Made Parse_FromString() accept the "lineno" as an argument.
- Fixed line numbering when there are escaped newlines in the
body of the .for loop.
Adopted from: NetBSD
documentation already adequatedly existed in the description in most
cases. Where it did not, it was added. If no documentation existed
beforehand, then none was added. Some unused dummies for use in the
traversal functions were marked as __unused during the conversion.
Occasionally, local style fixes were applied to lines already being
modified or influenced.
Now make(1) should always build with WARNS=3.
renaming variables to not shadow libc functions or greater scope locals. Kinda
makes one wonder if the extern ones weren't meant in some of these places :)
The only thing I'd still like to do WRT this is possibly combine rstat and
status in compat.c -- that should be fine, as I do not think the codepaths
will want both around at once.
Sponsored by: Bright Path Solutions
in compat.c which doesn't even have preprocessor-conditional-hidden support
code, and add a debugging statement where we might end up with a nil list
somehow, but where I doubt it.
First confirmed userland kill for Flexelint.
Sponsored by: Bright Path Solutions