The NetBSD Project

CVS log for src/usr.bin/make/for.c

[BACK] Up to [cvs.NetBSD.org] / src / usr.bin / make

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.178 / (download) - annotate - [select for diffs], Sun Jan 21 15:02:17 2024 UTC (8 weeks, 1 day ago) by rillig
Branch: MAIN
CVS Tags: triaxx-drm, HEAD
Changes since 1.177: +3 -3 lines
Diff to previous 1.177 (colored) to selected 1.48 (colored)

make: clean up redundant 'const' from automatic variables

No binary change.

Revision 1.177 / (download) - annotate - [select for diffs], Sun Nov 19 22:50:11 2023 UTC (3 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.176: +7 -7 lines
Diff to previous 1.176 (colored) to selected 1.48 (colored)

make: replace 'variable expression' with 'expression' in comments

No binary change.

Revision 1.176 / (download) - annotate - [select for diffs], Thu Jun 1 09:02:14 2023 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.175: +8 -3 lines
Diff to previous 1.175 (colored) to selected 1.48 (colored)

make: add more details to debug logging of .for loops

Revision 1.175 / (download) - annotate - [select for diffs], Thu Jun 1 07:44:10 2023 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.174: +17 -16 lines
Diff to previous 1.174 (colored) to selected 1.48 (colored)

make: shorten function names, clean up comments

No functional change.

Revision 1.174 / (download) - annotate - [select for diffs], Tue May 9 19:43:12 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.173: +10 -12 lines
Diff to previous 1.173 (colored) to selected 1.48 (colored)

make: skip syntactically wrong .for loops

When a .for loop cannot be interpreted correctly, for example when there
are no iteration variables or the number of words doesn't match the
iteration variables, skip the body of the .for loop instead of
interpreting it once.

Revision 1.173 / (download) - annotate - [select for diffs], Mon May 8 10:24:07 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.172: +18 -8 lines
Diff to previous 1.172 (colored) to selected 1.48 (colored)

make: disallow characters like '$' in variable names in .for loops

Fixes PR 53146.

Revision 1.172 / (download) - annotate - [select for diffs], Mon May 8 09:01:20 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.171: +20 -4 lines
Diff to previous 1.171 (colored) to selected 1.48 (colored)

make: fix parsing of unusual line continuations in .for loops

Revision 1.171 / (download) - annotate - [select for diffs], Tue Feb 14 21:38:31 2023 UTC (13 months ago) by rillig
Branch: MAIN
Changes since 1.170: +5 -3 lines
Diff to previous 1.170 (colored) to selected 1.48 (colored)

make: clean up calls to Var_Subst

None of the calls to Var_Subst used the return value, and the return
value was always VPR_OK.

No functional change.

Revision 1.170 / (download) - annotate - [select for diffs], Sat Sep 3 00:50:07 2022 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10
Changes since 1.169: +9 -10 lines
Diff to previous 1.169 (colored) to selected 1.48 (colored)

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.

Revision 1.169 / (download) - annotate - [select for diffs], Fri Sep 2 16:24:31 2022 UTC (18 months, 2 weeks ago) by sjg
Branch: MAIN
Changes since 1.168: +10 -2 lines
Diff to previous 1.168 (colored) to selected 1.48 (colored)

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

Revision 1.168 / (download) - annotate - [select for diffs], Sun Jun 12 16:09:21 2022 UTC (21 months ago) by rillig
Branch: MAIN
Changes since 1.167: +10 -3 lines
Diff to previous 1.167 (colored) to selected 1.48 (colored)

make: document ExprLen, which is part of a .for loop

No binary change

Revision 1.167 / (download) - annotate - [select for diffs], Fri Feb 4 23:22:19 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.166: +3 -3 lines
Diff to previous 1.166 (colored) to selected 1.48 (colored)

make: use unsigned int for line numbers everywhere

Previously, some line numbers were stored as signed int while others
were stored as size_t.  Since line numbers are never negative, use an
unsigned type.  Since the maximum file size for makefiles is 1 GB (see
loadfile), unsigned int is large enough even on 64-bit platforms.

Using a single data types reduces the number of type conversions.  Using
unsigned int improves compatibility with C90 (printf %u instead of %zu),
which is needed by bmake, which is derived from usr.bin/make.

No functional change.

Revision 1.166 / (download) - annotate - [select for diffs], Thu Jan 27 11:16:44 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.165: +7 -11 lines
Diff to previous 1.165 (colored) to selected 1.48 (colored)

make: clean up AddEscape for building the body of a .for loop

Adding 1 + len bytes but only incrementing the pointer by len bytes
looked suspicious, so use the same expression in both places.

No functional change.

Revision 1.165 / (download) - annotate - [select for diffs], Sun Jan 9 18:59:27 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.164: +3 -6 lines
Diff to previous 1.164 (colored) to selected 1.48 (colored)

make: extract low-level character operations into utility function

Suggested by nia.
https://mail-index.netbsd.org/source-changes-d/2022/01/09/msg013564.html

No functional change.

Revision 1.164 / (download) - annotate - [select for diffs], Sun Jan 9 14:06:00 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.163: +14 -12 lines
Diff to previous 1.163 (colored) to selected 1.48 (colored)

make: fix crash for newline in .for value in -dp mode (since yesterday)

Revision 1.163 / (download) - annotate - [select for diffs], Sun Jan 9 12:43:52 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.162: +12 -10 lines
Diff to previous 1.162 (colored) to selected 1.48 (colored)

make: fix use-after-free in -dp mode (since yesterday)

In a .for loop that contains an unclosed .if directive,
Cond_restore_depth generates an error message.  If stack traces are
enabled using the option '-dp', the details of the .for loop are added
to the stack trace, but at that point, the ForLoop had already been
freed.  To reproduce:

make-2022.01.09.00.33.57 -r -f unit-tests/directive-for.mk -dp

Revision 1.162 / (download) - annotate - [select for diffs], Sun Jan 9 00:33:57 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.161: +5 -5 lines
Diff to previous 1.161 (colored) to selected 1.48 (colored)

make: remove redundant parameter from ForLoop_SubstVarLong

The buffer of a .for loop is always either empty or ends with '\n'.  A
variable name consists of arbitrary non-whitespace characters.
Therefore a variable name can never reach the end of the buffer.

No functional change.

Revision 1.161 / (download) - annotate - [select for diffs], Sat Jan 8 23:52:26 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.160: +21 -2 lines
Diff to previous 1.160 (colored) to selected 1.48 (colored)

make: add details about .for loop variables to stack traces

The stack traces are enabled with the debug logging option '-dp'.

Revision 1.160 / (download) - annotate - [select for diffs], Sat Jan 8 20:21:34 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.159: +4 -4 lines
Diff to previous 1.159 (colored) to selected 1.48 (colored)

make: fix reported line numbers of continuation lines (since 2002)

Previously, multi-line directives like '.info' or '.error' reported the
line number of their last line instead of their first line, which is
more usual.  This also affected the debug log from '-dp'.

Revision 1.159 / (download) - annotate - [select for diffs], Sat Jan 8 17:25:19 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.158: +3 -3 lines
Diff to previous 1.158 (colored) to selected 1.48 (colored)

make: inline Buf_Clear

No functional change.

Revision 1.158 / (download) - annotate - [select for diffs], Fri Jan 7 23:13:50 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.157: +17 -22 lines
Diff to previous 1.157 (colored) to selected 1.48 (colored)

make: clean up structure of For_Eval

Put related decisions on the same indentation level, remove unnecessary
negation, keep the code for the '.for' directive together.

No functional change.

Revision 1.157 / (download) - annotate - [select for diffs], Fri Jan 7 20:15:10 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.156: +13 -17 lines
Diff to previous 1.156 (colored) to selected 1.48 (colored)

make: clean up handling of .for loops

Sort ForLoop members in natural reading order.

Remove redundant condition in ForLoop_ParseItems; at that point, the
number of variables is non-zero.

Rename Buf_AddEscaped since that function is not part of the Buffer API,
it is specific to .for loops.

No functional change.

Revision 1.156 / (download) - annotate - [select for diffs], Fri Jan 7 20:09:58 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.155: +7 -9 lines
Diff to previous 1.155 (colored) to selected 1.48 (colored)

make: eliminate file-scope variable forLevel

No functional change.

Revision 1.155 / (download) - annotate - [select for diffs], Fri Jan 7 20:04:49 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.154: +18 -36 lines
Diff to previous 1.154 (colored) to selected 1.48 (colored)

make: use simpler code for handling .for loops

Since the body of a .for loop is scanned from start to end, there is no
need to remember the length of a variable name.

Using memcmp for comparing the variable name was probably overkill since
the variable names are usually very short, so rather compare them byte
by byte.

No functional change.

Revision 1.154 / (download) - annotate - [select for diffs], Sun Jan 2 01:54:43 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.153: +13 -24 lines
Diff to previous 1.153 (colored) to selected 1.48 (colored)

make: clean up handling of .for loops and .include directives

No functional change.

Revision 1.153 / (download) - annotate - [select for diffs], Sun Jan 2 00:12:47 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.152: +24 -24 lines
Diff to previous 1.152 (colored) to selected 1.48 (colored)

make: in .for loops, pass the body to be filled as parameter

This is a preparation for cleaning up the code for loading and parsing
files, especially the part for including other files and for .for loops.

No functional change.

Revision 1.152 / (download) - annotate - [select for diffs], Sat Jan 1 21:50:29 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.151: +3 -3 lines
Diff to previous 1.151 (colored) to selected 1.48 (colored)

make: remove unused parameter from Parse_PushInput

The parameter readMore was never NULL.

No functional change.

Revision 1.151 / (download) - annotate - [select for diffs], Wed Dec 15 12:58:01 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.150: +7 -5 lines
Diff to previous 1.150 (colored) to selected 1.48 (colored)

make: format comments according to /usr/share/misc/style

Assisted by indent(1), with manual corrections due to its many remaining
bugs.

No functional change.

Revision 1.150 / (download) - annotate - [select for diffs], Sun Dec 12 15:44:41 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.149: +3 -3 lines
Diff to previous 1.149 (colored) to selected 1.48 (colored)

make: rename Parse_SetInput to Parse_PushInput

The word 'set' sounded too much like it would replace the current file,
but instead the file is pushed to the stack, and the previous file is
continued later.

No functional change.

Revision 1.149 / (download) - annotate - [select for diffs], Sun Dec 12 14:27:48 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.148: +11 -11 lines
Diff to previous 1.148 (colored) to selected 1.48 (colored)

make: rename ForLoop.sub_next to nextItem

This matches the naming style of the other ForLoop members.

No functional change.

Revision 1.148 / (download) - annotate - [select for diffs], Sun Dec 5 11:40:03 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.147: +27 -27 lines
Diff to previous 1.147 (colored) to selected 1.48 (colored)

make: inline Str_Words into .for loop handling

This saves one memory allocation and a bit of copying, per .for loop.

No functional change.

Revision 1.147 / (download) - annotate - [select for diffs], Thu Sep 2 07:02:07 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.146: +24 -18 lines
Diff to previous 1.146 (colored) to selected 1.48 (colored)

make: rename for_var_len to ExprLen

The text ${VAR} is not a variable, it's a variable expression.

No functional change.

Revision 1.146 / (download) - annotate - [select for diffs], Thu Sep 2 06:29:56 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.145: +8 -8 lines
Diff to previous 1.145 (colored) to selected 1.48 (colored)

make: inline strchr call, make ForLoop_SubstBody clearer

In ForLoop_SubstBody, GCC already merged the common subexpressions p[1]
and p[-1], but that was difficult to see for humans as well.

No functional change.

Revision 1.145 / (download) - annotate - [select for diffs], Wed Sep 1 23:07:41 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.144: +3 -10 lines
Diff to previous 1.144 (colored) to selected 1.48 (colored)

make: remove optimization for single-letter .for variables

Most .for loops have a single iteration variable.  For these loops, the
difference between the optimized and the unoptimized versions of the
code is negligible.

Remove the optimization since the comment for explaining it was almost
larger than the code itself.

Revision 1.144 / (download) - annotate - [select for diffs], Fri Jun 25 16:10:07 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.143: +8 -3 lines
Diff to previous 1.143 (colored) to selected 1.48 (colored)

make: prevent newline injection in .for loops

When a value of a .for loop contained a literal newline, such as from
the expression ${.newline}, that newline was passed verbatim to the
"expanded current body" of the .for loop.  There it was interpreted as a
literal newline, which ended the current line and started a new one.
This resulted in several syntax errors.

In cases like these, print a more precise error message.

Revision 1.143 / (download) - annotate - [select for diffs], Thu Jun 24 23:19:52 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.142: +9 -9 lines
Diff to previous 1.142 (colored) to selected 1.48 (colored)

make: sprinkle const

Revision 1.142 / (download) - annotate - [select for diffs], Sat Apr 3 11:08:40 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
CVS Tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.141: +23 -23 lines
Diff to previous 1.141 (colored) to selected 1.48 (colored)

make: use C99 bool type instead of defining its own

No functional change.

Revision 1.141 / (download) - annotate - [select for diffs], Thu Feb 4 21:33:13 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.140: +3 -3 lines
Diff to previous 1.140 (colored) to selected 1.48 (colored)

make: rename some VAR constants to SCOPE

The word "context" does not fit perfectly to the variables that are
associate with a GNode, as the context is usually something from the
outside and the variables are more like properties inherent to the
GNode.

The term "global context" fits even less.  Since the thing where
variables are looked up is commonly named a scope, use that term
instead.

This commit only renames the global variables VAR_GLOBAL, VAR_INTERNAL
and VAR_CMDLINE, plus a few very closely related comments.  These are:

	GNode.vars (because of line breaks)
	GNode_Free (dito)
	varname-make_print_var_on_error.mk
	varname-make_print_var_on_error-jobs.mk

The debug message in Var_Stats is left as-is since there is no unit test
for it yet.

The other renamings (variable names "context", "ctxt", as well as
further comments) will be done in a follow-up commit.

Revision 1.140 / (download) - annotate - [select for diffs], Mon Feb 1 17:26:03 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.139: +12 -12 lines
Diff to previous 1.139 (colored) to selected 1.48 (colored)

make(1): clean up variable names and comments in .for loop code

Revision 1.139 / (download) - annotate - [select for diffs], Sat Jan 30 20:53:29 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.138: +4 -4 lines
Diff to previous 1.138 (colored) to selected 1.48 (colored)

make(1): split Buf_Destroy into Buf_Done and Buf_DoneData

In all cases except one, the boolean argument to Buf_Destroy was
constant.  Removing that argument by splitting the function into two
separate functions makes the intention clearer on the call site.  It
also removes the possibility for using the return value of Buf_Done,
which would have made no sense.

The function Buf_Done now pairs with Buf_Init, just as in HashTable and
Lst.

Even though Buf_Done is essentially a no-op, it is kept as a function,
both for symmetry with Buf_Init and for clearing the Buffer members
after use (this will be done only in CLEANUP mode, in a follow-up
commit).

Revision 1.138 / (download) - annotate - [select for diffs], Mon Jan 25 19:39:34 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.137: +76 -71 lines
Diff to previous 1.137 (colored) to selected 1.48 (colored)

make(1): split For_Eval into separate functions

Revision 1.137 / (download) - annotate - [select for diffs], Mon Jan 25 19:10:57 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.136: +27 -16 lines
Diff to previous 1.136 (colored) to selected 1.48 (colored)

make(1): extract ForLoop_New to separate function

Revision 1.136 / (download) - annotate - [select for diffs], Mon Jan 25 19:05:39 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.135: +24 -27 lines
Diff to previous 1.135 (colored) to selected 1.48 (colored)

make(1): rename struct For to struct ForLoop

This removes the ambiguity whether For_Free is meant to be a
module-exported function or a local function associate with that struct.
Rename the affected functions as well.

Revision 1.135 / (download) - annotate - [select for diffs], Tue Jan 19 20:51:46 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.134: +3 -3 lines
Diff to previous 1.134 (colored) to selected 1.48 (colored)

make(1): remove do-not-format markers from comments

These markers had been used inconsistently.  Furthermore the source code
had not been formatted automatically before 2020 at all, otherwise there
wouldn't have been any trailing whitespace left.

Revision 1.134 / (download) - annotate - [select for diffs], Sun Jan 10 21:20:46 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.133: +3 -3 lines
Diff to previous 1.133 (colored) to selected 1.48 (colored)

make(1): consistently use boolean expressions in conditions

Most of the make code already followed the style of explicitly writing
(ptr != NULL) instead of the shorter (ptr) in conditions.

The remaining 50 instances have been found by an experimental,
unpublished check in lint(1) that treats bool expressions as
incompatible to any other scalar type, just as in Java, C#, Pascal and
several other languages.

The only unsafe operation on Boolean that is left over is (flags &
FLAG), for an enum implementing a bit set.  If Boolean is an ordinary
integer type (the default), some high bits may get lost.  But if Boolean
is the same as _Bool (by compiling with -DUSE_C99_BOOLEAN), C99 6.3.1.2
defines that a conversion from any scalar to the type _Bool acts as a
comparison to 0, which cannot lose any bits.

Revision 1.133 / (download) - annotate - [select for diffs], Sat Jan 9 16:06:09 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.132: +3 -3 lines
Diff to previous 1.132 (colored) to selected 1.48 (colored)

make(1): fix lint warnings

Revision 1.132 / (download) - annotate - [select for diffs], Thu Dec 31 14:10:04 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.131: +11 -7 lines
Diff to previous 1.131 (colored) to selected 1.48 (colored)

make(1): fix undefined behavior in SubstVarLong

A memcmp implementation that would check the start and end pointers
first would have detected this possible out-of-bounds memory read.

Revision 1.131 / (download) - annotate - [select for diffs], Thu Dec 31 13:56:56 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.130: +9 -7 lines
Diff to previous 1.130 (colored) to selected 1.48 (colored)

make(1): make control flow in SubstVarLong of .for loops more obvious

Revision 1.130 / (download) - annotate - [select for diffs], Thu Dec 31 13:37:33 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.129: +21 -28 lines
Diff to previous 1.129 (colored) to selected 1.48 (colored)

make(1): clean up SubstVarShort in .for loops

This function does not need to advance the parsing position, which
removes duplicate code.

Revision 1.129 / (download) - annotate - [select for diffs], Thu Dec 31 04:38:55 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.128: +13 -13 lines
Diff to previous 1.128 (colored) to selected 1.48 (colored)

make(1): move detailed comment to ForSubstBody

Revision 1.128 / (download) - annotate - [select for diffs], Thu Dec 31 04:31:36 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.127: +33 -28 lines
Diff to previous 1.127 (colored) to selected 1.48 (colored)

make(1): extract ForSubstBody from ForReadMore

This leaves ForReadMore with the single responsibility of interfacing
with ReadMoreProc in Parse_SetInput.

Revision 1.127 / (download) - annotate - [select for diffs], Thu Dec 31 03:49:36 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.126: +9 -9 lines
Diff to previous 1.126 (colored) to selected 1.48 (colored)

make(1): rename ech to endc

Focusing on the "end" is more important than on the data type "ch".

Revision 1.126 / (download) - annotate - [select for diffs], Thu Dec 31 03:33:10 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.125: +5 -6 lines
Diff to previous 1.125 (colored) to selected 1.48 (colored)

make(1): inline variable in ForReadMore

This variable was intended to help the compilers produce efficient code
by avoiding a duplicate memory read.  As it turned out, GCC 5.5 doesn't
need this help, and probably newer compilers don't need it either.  Well
done, GCC, keeping track of the memory locations even if the pointer to
it changes in the middle.

Revision 1.125 / (download) - annotate - [select for diffs], Thu Dec 31 03:19:00 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.124: +6 -8 lines
Diff to previous 1.124 (colored) to selected 1.48 (colored)

make(1): clean up ForReadMore

After the previous clean up in for.c 1.123 from 2020-12-30, GCC 5.5 did
not inline the function SubstVarLong anymore since it was now called
from 2 places.  GCC didn't notice that the function call was essentially
the same since in differed only in the end character.

By combining the cases for ${V} and $(V), the code becomes even shorter
than before, while still being understandable.

Revision 1.124 / (download) - annotate - [select for diffs], Thu Dec 31 03:10:29 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.123: +3 -3 lines
Diff to previous 1.123 (colored) to selected 1.48 (colored)

make(1): simplify termination condition for .for loop

At this point, the number of iteration items is always a multiple of the
number of iteration variables, which makes any addition more complicated
than absolutely necessary.

Revision 1.123 / (download) - annotate - [select for diffs], Wed Dec 30 14:28:32 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.122: +39 -39 lines
Diff to previous 1.122 (colored) to selected 1.48 (colored)

make(1): improve .for loop documentation, clean up ForReadMore

The comma expression in ForReadMore may be a nice trick, but it's not as
easy to read as a simple if-then-else chain.  Test for '{' before '('
since BSD makefiles use braces by convention.

Revision 1.122 / (download) - annotate - [select for diffs], Wed Dec 30 10:03:16 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.121: +20 -11 lines
Diff to previous 1.121 (colored) to selected 1.48 (colored)

make(1): format multi-line comments

Revision 1.121 / (download) - annotate - [select for diffs], Sun Dec 27 10:04:32 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.120: +9 -4 lines
Diff to previous 1.120 (colored) to selected 1.48 (colored)

make(1): add error handling for .for loop items

Right now, Var_Subst always returns VPR_OK, even if there had been parse
errors or evaluation errors.  If that is no longer true, the errors will
be reported properly.

Revision 1.120 / (download) - annotate - [select for diffs], Sat Dec 19 13:31:37 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.119: +6 -5 lines
Diff to previous 1.119 (colored) to selected 1.48 (colored)

make(1): improve comments for .for loops

Revision 1.119 / (download) - annotate - [select for diffs], Sat Dec 19 13:20:17 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.118: +4 -4 lines
Diff to previous 1.118 (colored) to selected 1.48 (colored)

make(1): rename ForIterate to ForReadMore

Revision 1.118 / (download) - annotate - [select for diffs], Tue Dec 15 16:24:17 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.117: +285 -277 lines
Diff to previous 1.117 (colored) to selected 1.48 (colored)

make(1): indent for.c using tabs instead of spaces

Revision 1.117 / (download) - annotate - [select for diffs], Sun Dec 13 21:27:45 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.116: +5 -4 lines
Diff to previous 1.116 (colored) to selected 1.48 (colored)

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.

Revision 1.116 / (download) - annotate - [select for diffs], Sat Dec 12 00:33:25 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.115: +3 -3 lines
Diff to previous 1.115 (colored) to selected 1.48 (colored)

make(1): remove const from function parameters

These have been left-overs from refactoring, when these pieces were
extracted to separate functions.

Revision 1.115 / (download) - annotate - [select for diffs], Sat Nov 7 21:04:43 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.114: +20 -40 lines
Diff to previous 1.114 (colored) to selected 1.48 (colored)

make(1): clean up Buf_AddEscaped in .for loops

All this dance of determining the needed escape characters before
iterating, saving them upfront, evaluating them later using complicated
boolean expressions was not necessary at all.  All that is needed is a
simple NeedsEscapes, called at just the right time.

Revision 1.114 / (download) - annotate - [select for diffs], Sat Nov 7 14:11:58 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.113: +4 -4 lines
Diff to previous 1.113 (colored) to selected 1.48 (colored)

make(1): make API of Buf_Init simpler

In most cases, the caller doesn't want to specify the exact number of
preallocated bytes.

Revision 1.113 / (download) - annotate - [select for diffs], Sat Nov 7 10:16:18 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.112: +4 -4 lines
Diff to previous 1.112 (colored) to selected 1.48 (colored)

make(1): clean up code stylistically

* Replace character literal 0 with '\0'.
* Replace pointer literal 0 with NULL.
* Remove redundant parentheses.
* Parentheses in multi-line conditions are not redundant at the
  beginning of a line.
* Replace a few !ptr with ptr == NULL.
* Replace a few ptr with ptr != NULL.
* Replace (expr & mask) == 0 with !(expr & mask).
* Remove redundant braces for blocks in cases where the generated code
  stays the same.  (Assertions further down in the code would get
  different line numbers.)
* Rename parameters in CondParser_String to reflect the data flow.
* Replace #ifdef notdef with #if 0.

The generated code stays exactly the same, at least with GCC 5.5.0 on
NetBSD 8.0 amd64 using the default configuration.

Revision 1.112 / (download) - annotate - [select for diffs], Sat Oct 31 18:41:07 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.111: +3 -3 lines
Diff to previous 1.111 (colored) to selected 1.48 (colored)

make(1): format #include directives consistently

Revision 1.111 / (download) - annotate - [select for diffs], Mon Oct 26 07:37:52 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.110: +3 -3 lines
Diff to previous 1.110 (colored) to selected 1.48 (colored)

make(1): remove stray closing brace from comment

Revision 1.110 / (download) - annotate - [select for diffs], Mon Oct 26 07:33:48 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.109: +36 -38 lines
Diff to previous 1.109 (colored) to selected 1.48 (colored)

make(1): clean up variable substitution in .for loops

The variable name cmd_cp was not really helpful for understanding the
code.

Revision 1.109 / (download) - annotate - [select for diffs], Mon Oct 26 07:03:47 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.108: +68 -72 lines
Diff to previous 1.108 (colored) to selected 1.48 (colored)

make(1): use consistent variable names in for.c

Revision 1.108 / (download) - annotate - [select for diffs], Sun Oct 25 16:18:02 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.107: +3 -8 lines
Diff to previous 1.107 (colored) to selected 1.48 (colored)

make(1): clean up comments in .for handling

Revision 1.107 / (download) - annotate - [select for diffs], Sun Oct 25 16:15:48 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.106: +3 -3 lines
Diff to previous 1.106 (colored) to selected 1.48 (colored)

make(1): use complete words in error message for .for loop

Revision 1.106 / (download) - annotate - [select for diffs], Sun Oct 25 16:14:08 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.105: +22 -15 lines
Diff to previous 1.105 (colored) to selected 1.48 (colored)

make(1): extract code to see if a directive is a .for or .endfor

Revision 1.105 / (download) - annotate - [select for diffs], Sun Oct 25 15:58:04 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.104: +17 -18 lines
Diff to previous 1.104 (colored) to selected 1.48 (colored)

make(1): rename local variable in For_Eval

Revision 1.104 / (download) - annotate - [select for diffs], Sun Oct 25 15:49:03 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.103: +4 -2 lines
Diff to previous 1.103 (colored) to selected 1.48 (colored)

make(1): test funny character in .for variable names

Revision 1.103 / (download) - annotate - [select for diffs], Sun Oct 25 15:41:31 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.102: +28 -32 lines
Diff to previous 1.102 (colored) to selected 1.48 (colored)

make(1): reduce memory allocation in .for loops

It was not necessary to allocate a new buffer for each iteration of the
.for loop.

Revision 1.102 / (download) - annotate - [select for diffs], Sun Oct 25 15:26:18 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.101: +12 -48 lines
Diff to previous 1.101 (colored) to selected 1.48 (colored)

make(1): use Words instead of Vector for the .for items

This makes memory management a bit simpler and also more efficient.

Revision 1.101 / (download) - annotate - [select for diffs], Sun Oct 25 15:15:45 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.100: +19 -18 lines
Diff to previous 1.100 (colored) to selected 1.48 (colored)

make(1): remove unnecessary type ForVar

Now that the escaping information is computed just-in-time, the item of
a .for loops is a simple string with no additional information.
Therefore, unwrap the struct.

Revision 1.100 / (download) - annotate - [select for diffs], Sun Oct 25 14:58:23 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.99: +6 -10 lines
Diff to previous 1.99 (colored) to selected 1.48 (colored)

make(1): compute escaping flags for .for values when needed

Before, they were computed when parsing the .for line, which was
unnecessarily early.

Revision 1.99 / (download) - annotate - [select for diffs], Sun Oct 25 14:29:13 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.98: +34 -25 lines
Diff to previous 1.98 (colored) to selected 1.48 (colored)

make(1): extract GetEscapes from For_Eval

Revision 1.98 / (download) - annotate - [select for diffs], Sun Oct 25 13:51:56 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.97: +37 -21 lines
Diff to previous 1.97 (colored) to selected 1.48 (colored)

make(1): extract SubstVarShort from ForIterate

Revision 1.97 / (download) - annotate - [select for diffs], Sun Oct 25 13:45:33 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.96: +37 -18 lines
Diff to previous 1.96 (colored) to selected 1.48 (colored)

make(1): extract SubstVarLong from ForIterate

Revision 1.96 / (download) - annotate - [select for diffs], Sun Oct 25 13:20:11 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.95: +76 -33 lines
Diff to previous 1.95 (colored) to selected 1.48 (colored)

make(1): use Vector instead of strlist_t for expanding .for loops

strlist_t combines a string with an unsigned int.  This unsigned int had
been the string length for variables and the escaping flags for values.
This is another case of using generic types where specific types would
give more guidance to the reader.

Defining the types ForVar and ForItem expresses the involved concepts
more directly.

This is the last use of strlist_t, which will be removed in a follow-up
commit.

Revision 1.95 / (download) - annotate - [select for diffs], Sun Oct 25 12:01:33 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.94: +23 -24 lines
Diff to previous 1.94 (colored) to selected 1.48 (colored)

make(1): clean up code for handling .for loops

Revision 1.94 / (download) - annotate - [select for diffs], Sun Oct 18 17:19:54 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.93: +3 -3 lines
Diff to previous 1.93 (colored) to selected 1.48 (colored)

make(1): add tags to enum types

This allows IDEs to offer better type information than "anonymous enum".

Revision 1.93 / (download) - annotate - [select for diffs], Mon Oct 5 20:21:30 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.92: +9 -8 lines
Diff to previous 1.92 (colored) to selected 1.48 (colored)

make(1): make dir.c, for.c and hash.c ready for WARNS=6

Some types have changed from int to unsigned int, size_t or time_t.

The variable i in hash.c has been kept as int since it counts down to
-1, which generates efficient machine code, at least on x86_64.

Revision 1.92 / (download) - annotate - [select for diffs], Mon Oct 5 19:27:47 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.91: +8 -11 lines
Diff to previous 1.91 (colored) to selected 1.48 (colored)

make(1): revert previous commit

It had accidentally reverted all the work from the past few days.

Revision 1.91 / (download) - annotate - [select for diffs], Mon Oct 5 19:24:29 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.90: +9 -6 lines
Diff to previous 1.90 (colored) to selected 1.48 (colored)

make(1): fix double-free bug in -DCLEANUP mode (since 2020-10-02)

The bug had been introduced with dir.c 1.155 on 2020-10-02 22:20:25.  In
that commit, openDirectories was replaced with a combination of a list
with a hash table, for more efficient lookup by name.

Upon cleanup, OpenDirs_Done is called, which in turn called
Dir_ClearPath.  Dir_ClearPath takes full ownership of the given list and
empties it.  This was no problem before since afterwards the list was
empty and calling Lst_Free just frees the remaining list pointer.

With OpenDirs, this list was combined with a hash table, and the hash
table contains the list nodes, assuming that the OpenDirs functions have
full ownership of both the list and the hash table.  This assumption was
generally correct, except for the one moment during cleanup where full
ownership of the list was passed to Dir_ClearPath, while the hash table
still contained pointers to the (now freed) list nodes.  This by itself
was not a problem since the hash table would be freed afterwards.  But
as part of Dir_ClearPath, OpenDirs_Remove was called, which looked up
the freed directory by name and now found the freed list node, trying to
free it again.  Boom.

Fixed by replacing the call to Dir_ClearPath with code that only frees
the directories, without giving up control over the list.

Revision 1.90 / (download) - annotate - [select for diffs], Sat Oct 3 21:19:54 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.89: +8 -11 lines
Diff to previous 1.89 (colored) to selected 1.48 (colored)

make(1): use consistent pattern for parsing whitespace

The pp and cpp in the function names stand for "parsing position" and
"const parsing position".

Revision 1.89 / (download) - annotate - [select for diffs], Mon Sep 28 20:46:11 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.88: +5 -8 lines
Diff to previous 1.88 (colored) to selected 1.48 (colored)

make(1): make debugging code shorter

Revision 1.88 / (download) - annotate - [select for diffs], Sun Sep 27 21:35:16 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.87: +4 -3 lines
Diff to previous 1.87 (colored) to selected 1.48 (colored)

make(1): normalize whitespace in source code

There is no more space tab.  Either only tabs or only spaces or tabs
followed by spaces, but not spaces followed by tabs.

Revision 1.87 / (download) - annotate - [select for diffs], Sun Sep 27 16:52:22 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.86: +3 -3 lines
Diff to previous 1.86 (colored) to selected 1.48 (colored)

make(1): rename Buf_Size to Buf_Len

The new name better matches the field name Buffer.len as well as the
variables around the calls to this function.

Revision 1.86 / (download) - annotate - [select for diffs], Fri Sep 25 15:54:50 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.85: +3 -3 lines
Diff to previous 1.85 (colored) to selected 1.48 (colored)

make(1): add tags to some of the unnamed structs

The tags prevent the structs from accidentally becoming compatible
types.

While here, remove a few typedefs for structs that are single-purpose,
since there is no point in abstracting from the actual representation of
these types.

Revision 1.85 / (download) - annotate - [select for diffs], Tue Sep 22 20:19:46 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.84: +5 -3 lines
Diff to previous 1.84 (colored) to selected 1.48 (colored)

make(1): prepare Var_Subst for proper error handling

Returning a VarParseResult instead of a string makes it possible to let
the error bubble up, until it reaches the main expression.

Revision 1.84 / (download) - annotate - [select for diffs], Mon Sep 14 20:43:44 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.83: +3 -3 lines
Diff to previous 1.83 (colored) to selected 1.48 (colored)

make(1): inline character constants in var.c

This removes a level of indirection, and the macro names were quite
similar in appearance as well.  The macros may have been used by people
whose editors don't recognize C string and character literals when
navigating to the corresponding brace or parenthesis.  These editors had
already been confused before this commit since there are also string
literals with unbalanced parentheses, and there are far fewer
compensating comments such as /*{*/ or /*)*/ in the code.  In fact, the
only such comment that is left over was in for.c.

This way, there is now a single consistent way of writing these
character literals, which is without macros or comments, since that is
the simplest form.

Revision 1.83 / (download) - annotate - [select for diffs], Sun Sep 13 15:15:51 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.82: +4 -14 lines
Diff to previous 1.82 (colored) to selected 1.48 (colored)

make(1): clean up RCSID blocks

These blocks mostly consisted of redundant structure, following the same
#ifndef pattern over and over, with only minimal variation.

It's easier to maintain if the common structure is only written once and
encapsulated in a macro.

To avoid "defined but unused" warnings from GCC in the case where
MAKE_NATIVE is not defined, I had to add volatile.  Adding
MAKE_ATTR_UNUSED alone would not preserve the rcsid variable in the
resulting binary.

Revision 1.82 / (download) - annotate - [select for diffs], Sat Sep 12 14:41:00 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.81: +4 -4 lines
Diff to previous 1.81 (colored) to selected 1.48 (colored)

make(1): fix inconsistent code indentation

Revision 1.81 / (download) - annotate - [select for diffs], Sat Sep 12 10:14:16 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.80: +7 -7 lines
Diff to previous 1.80 (colored) to selected 1.48 (colored)

make(1): use proper return type for For_Accum

Revision 1.80 / (download) - annotate - [select for diffs], Sat Sep 12 10:12:09 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.79: +23 -25 lines
Diff to previous 1.79 (colored) to selected 1.48 (colored)

make(1): update the comment about .for loops to match the code

Revision 1.79 / (download) - annotate - [select for diffs], Fri Sep 11 17:32:36 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.78: +11 -13 lines
Diff to previous 1.78 (colored) to selected 1.48 (colored)

make(1): add wrappers around ctype.h functions

This avoids casting the argument to unsigned char, and to cast the
result of toupper/tolower back to char.

Revision 1.78 / (download) - annotate - [select for diffs], Mon Sep 7 06:28:22 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.77: +4 -4 lines
Diff to previous 1.77 (colored) to selected 1.48 (colored)

make(1): save a strlen call in ForIterate

Revision 1.77 / (download) - annotate - [select for diffs], Mon Sep 7 06:27:29 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.76: +6 -6 lines
Diff to previous 1.76 (colored) to selected 1.48 (colored)

make(1): constify local variables in ForIterate

Revision 1.76 / (download) - annotate - [select for diffs], Mon Sep 7 06:26:18 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.75: +9 -8 lines
Diff to previous 1.75 (colored) to selected 1.48 (colored)

make(1): split local variable in ForIterate

Revision 1.75 / (download) - annotate - [select for diffs], Mon Sep 7 06:01:11 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.74: +10 -8 lines
Diff to previous 1.74 (colored) to selected 1.48 (colored)

make(1): convert ForEscapes from #define to enum

Revision 1.74 / (download) - annotate - [select for diffs], Mon Sep 7 05:58:08 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.73: +9 -8 lines
Diff to previous 1.73 (colored) to selected 1.48 (colored)

make(1): add local variable for escapes to for_substitute

Just for debugging.  No change in code size.

Revision 1.73 / (download) - annotate - [select for diffs], Sun Sep 6 19:30:53 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.72: +6 -6 lines
Diff to previous 1.72 (colored) to selected 1.48 (colored)

make(1): add const to For_Eval and For_Accum

Revision 1.72 / (download) - annotate - [select for diffs], Sun Sep 6 19:28:49 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.71: +28 -23 lines
Diff to previous 1.71 (colored) to selected 1.48 (colored)

make(1): clean up For_Eval

* Reduce scope of local variables.
* Remove unnecessary null character test before positive isspace call.

Revision 1.71 / (download) - annotate - [select for diffs], Sun Sep 6 19:24:12 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.70: +9 -5 lines
Diff to previous 1.70 (colored) to selected 1.48 (colored)

make(1): properly initialize For structure in For_Eval

Initializing a Buffer or a strlist_t with zero-valued bytes only works
by conincidence, but because it would be the correct way.  In the code
path "missing `in' in for", that zero-filled Buffer is freed using
Buf_Destroy, which could have invoked undefined behavior.

Revision 1.70 / (download) - annotate - [select for diffs], Sun Sep 6 19:19:49 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.69: +9 -18 lines
Diff to previous 1.69 (colored) to selected 1.48 (colored)

make(1): improve documentation in For_Eval

Revision 1.69 / (download) - annotate - [select for diffs], Sun Sep 6 19:18:16 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.68: +9 -5 lines
Diff to previous 1.68 (colored) to selected 1.48 (colored)

make(1): fix type of For.short_var

Revision 1.68 / (download) - annotate - [select for diffs], Fri Sep 4 17:35:00 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.67: +5 -5 lines
Diff to previous 1.67 (colored) to selected 1.48 (colored)

make(1): unexport For_Iterate

By convention, exported functions have an underscore, and static
functions don't.

Revision 1.67 / (download) - annotate - [select for diffs], Sun Aug 30 19:56:02 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.66: +11 -12 lines
Diff to previous 1.66 (colored) to selected 1.48 (colored)

make(1): replace brk_string with Str_Words

The API is much simpler, and there is less detail that is exposed by
default and fewer punctuation to type on the caller's side.  To see that
there is some memory to be freed, one would have to look into the
struct.  Having part of the return value as the actual return value and
the rest in output parameters was unnecessarily asymmetrical.

Revision 1.66 / (download) - annotate - [select for diffs], Sat Aug 29 10:32:00 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.65: +4 -15 lines
Diff to previous 1.65 (colored) to selected 1.48 (colored)

make(1): remove duplicate code for allocation a substring

Revision 1.65 / (download) - annotate - [select for diffs], Sun Aug 23 18:26:35 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.64: +10 -8 lines
Diff to previous 1.64 (colored) to selected 1.48 (colored)

make(1): make brk_string return size_t for the number of words

Revision 1.64 / (download) - annotate - [select for diffs], Sat Aug 22 21:42:38 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.63: +3 -9 lines
Diff to previous 1.63 (colored) to selected 1.48 (colored)

make(1): clean up headers

Remove redundant headers that are already included by "make.h".
Make <assert.h> available to all compilation units that use "make.h".

Revision 1.63 / (download) - annotate - [select for diffs], Sun Aug 9 19:51:02 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.62: +26 -28 lines
Diff to previous 1.62 (colored) to selected 1.48 (colored)

make(1): format the source code consistently, at least per file

Some files use 4 spaces per indentation level, others use 8.  At least
for the few files from this commit, they use a consistent style
throughout each file now.

In Cond_Eval, the #define has changed into an enum since the identifiers
need not be visible to the C preprocessor.

Revision 1.62 / (download) - annotate - [select for diffs], Sat Aug 8 18:54:04 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.61: +7 -7 lines
Diff to previous 1.61 (colored) to selected 1.48 (colored)

make(1): remove trailing Z from buffer functions

This Z had been useful during the migration from int to size_t.  This
migration is finished, at least for the Buffer type, so the Z is no
longer necessary.

Revision 1.61 / (download) - annotate - [select for diffs], Mon Aug 3 20:26:09 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.60: +9 -7 lines
Diff to previous 1.60 (colored) to selected 1.48 (colored)

make(1): no declaration-after-statement anymore

NetBSD make is intended to be maximally portable, therefore it uses only
C89.  This was not declared in the Makefile before.

There are still a few places in parse.c and metachar.c that use
end-of-line comments.  These will be fixed in a follow-up commit.

Revision 1.60 / (download) - annotate - [select for diffs], Sun Aug 2 08:10:36 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.59: +4 -16 lines
Diff to previous 1.59 (colored) to selected 1.48 (colored)

make(1): move and condense comment for For_Run

It was simply wrong that calling For_Run had "Side Effects: None".

Revision 1.59 / (download) - annotate - [select for diffs], Sat Aug 1 21:40:49 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.58: +27 -28 lines
Diff to previous 1.58 (colored) to selected 1.48 (colored)

make(1): switch Buffer size from int to size_t

This change helps to make the various integer types compatible and is a
preparational step for setting WARNS=6 in the Makefile.

The documentation of buf.c has been cleaned up and condensed since it
was mostly redundant, and some statements were even slightly wrong.

All code changes are covered by the existing unit tests, except for the
few lines in for.c around for_var_len.  These changes have been reviewed
thoroughly and manually, like all the others in this commit.

Those buffer functions that deal with sizes have been renamed by
appending a Z, to make sure that no function call was accidentally
forgotten.  They will be renamed back in a follow-up commit.

As usual, the scope of a few affected variables has been reduced, and
some variables had to be split since they had been incorrectly merged
before.

The order of the arguments to Buf_AddBytes has changed from (mem_len,
mem) to (mem, mem_len), in order to make it consistent with the
functions from the C standard library, such as snprintf.

Revision 1.58 / (download) - annotate - [select for diffs], Sat Aug 1 14:47:49 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.57: +6 -6 lines
Diff to previous 1.57 (colored) to selected 1.48 (colored)

make(1): use consistent indentation in source code

Tabs for multiples of 8, then spaces.

The usage string has been kept as-is since the spaces there are
indentional and do influence the output.

Revision 1.57 / (download) - annotate - [select for diffs], Tue Jul 28 16:45:56 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.56: +4 -4 lines
Diff to previous 1.56 (colored) to selected 1.48 (colored)

make(1): remove unnecessary struct tag

Identifiers starting with an underscore and an uppercase letter are
reserved for the C implementation.

Revision 1.56 / (download) - annotate - [select for diffs], Tue Jul 28 16:42:22 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.55: +4 -4 lines
Diff to previous 1.55 (colored) to selected 1.48 (colored)

make(1): remove dead code from Var_Subst

The first parameter from Var_Subst had been a literal NULL in all cases.
These have been fixed using this command:

sed -i 's|Var_Subst(NULL, |Var_Subst(|' *.c

The one remaining case was not found because the "NULL," was followed by
a line break instead of a space.

The removed code probably wouldn't have worked as expected anyway.
Expanding a single variable to a literal string would have led to
unexpected behavior for cases like ${VAR:M${pattern}}, in case pattern
would contain an unescaped ':' itself.

Revision 1.55 / (download) - annotate - [select for diffs], Sun Jul 19 12:26:17 2020 UTC (3 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.54: +4 -4 lines
Diff to previous 1.54 (colored) to selected 1.48 (colored)

make(1): rename Varf_Flags to VarEvalFlags

In var.c there are lots of different flag types.  To make any accidental
mixture obvious, each flag group gets its own prefix.

The only flag group that is visible outside of var.c is concerned with
evaluating variables, therefore the "e", which replaces the former "f"
that probably just meant "flag".

Revision 1.54 / (download) - annotate - [select for diffs], Fri Jul 3 08:13:23 2020 UTC (3 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.53: +7 -7 lines
Diff to previous 1.53 (colored) to selected 1.48 (colored)

make(1): remove trailing whitespace

Revision 1.53 / (download) - annotate - [select for diffs], Sun Apr 16 21:04:44 2017 UTC (6 years, 11 months ago) by riastradh
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-localcount-20170426, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, is-mlppp-base, is-mlppp, bouyer-socketcan-base1
Changes since 1.52: +4 -4 lines
Diff to previous 1.52 (colored) to selected 1.48 (colored)

Clarify that assignment is for effect, not truth of value.

CID 977502

Revision 1.52 / (download) - annotate - [select for diffs], Thu Feb 18 18:29:14 2016 UTC (8 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, localcount-20160914, bouyer-socketcan-base
Branch point for: pgoyette-localcount, bouyer-socketcan
Changes since 1.51: +4 -4 lines
Diff to previous 1.51 (colored) to selected 1.48 (colored)

Collapse the 3 boolean parameter to 1 flags parameter. No functional change.

Revision 1.51 / (download) - annotate - [select for diffs], Sat Jan 9 00:55:17 2016 UTC (8 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.50: +4 -4 lines
Diff to previous 1.50 (colored) to selected 1.48 (colored)

Preserve $$ in := assignments..

FOO=\$$CRAP
BAR:=${FOO}

all:
	echo ${FOO}
	echo ${BAR}

Revision 1.50 / (download) - annotate - [select for diffs], Sun Oct 11 04:51:24 2015 UTC (8 years, 5 months ago) by sjg
Branch: MAIN
Changes since 1.49: +4 -4 lines
Diff to previous 1.49 (colored) to selected 1.48 (colored)

Add Boolean wantit to Var_Parse and Var_Subst

wantit will be FALSE when we are just consuming to discard
in which case we skip "expensive" things like Cmd_Exec.

Reviewed by: christos

Revision 1.49 / (download) - annotate - [select for diffs], Sun Jun 3 04:29:40 2012 UTC (11 years, 9 months ago) by sjg
Branch: MAIN
CVS Tags: yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, tls-maxphys-base, tls-maxphys, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, dholland-make-base, agc-symver-base, agc-symver
Changes since 1.48: +52 -29 lines
Diff to previous 1.48 (colored)

Handle "quoted strings" as items in a .for list

Revision 1.48 / (download) - annotate - [selected], Sat Dec 25 04:57:07 2010 UTC (13 years, 2 months ago) by dholland
Branch: MAIN
CVS Tags: yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, matt-mips64-premerge-20101231, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: yamt-pagecache
Changes since 1.47: +5 -4 lines
Diff to previous 1.47 (colored)

Begin cleanup of the make parser: separate out the logic for reading files
from the parsing goo. This will now use mmap for reading if it works and
fall back to read only for pipes and such. Step 1 of a cleanup program
proposed without objection on tech-toolchain.

Revision 1.47 / (download) - annotate - [select for diffs], Sat Feb 6 20:37:13 2010 UTC (14 years, 1 month ago) by dholland
Branch: MAIN
Changes since 1.46: +5 -4 lines
Diff to previous 1.46 (colored) to selected 1.48 (colored)

Improve the error message that results when you have a multi-variable .for
and the substitution list doesn't divide evenly.

Revision 1.46 / (download) - annotate - [select for diffs], Sat Jan 17 13:29:37 2009 UTC (15 years, 2 months ago) by dsl
Branch: MAIN
CVS Tags: matt-premerge-20091211, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend
Changes since 1.45: +19 -20 lines
Diff to previous 1.45 (colored) to selected 1.48 (colored)

Change 'Buffer' so that it is the actual struct, not a pointer to it.
Saves having to malloc/free a fixed size structure.
Buf_Init() now takes ptr to Buffer to initialiase.
Change Buf_Destroy() to return ptr to string when not freed.
Remove large number of casts to (Byte) and (Byte *) - 'Byte' is 'char' here.
Buf_AddByte[s] guarantees that the data is 0 termininated, so never add '\0'.
Keep 'count' not 'left' and 'inPtr', code is simplier with only one update.
Fix fallou, no functional change.

Revision 1.45 / (download) - annotate - [select for diffs], Wed Jan 14 22:54:10 2009 UTC (15 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.44: +46 -6 lines
Diff to previous 1.44 (colored) to selected 1.48 (colored)

Contrary to my previous thoughts, .for loop variable values do contain
variable references - eg ${.TARGET} since that can't be expanded earlier.
Also the variable gets re-expanded before modifiers are applied.
All this means that we do need to let :U expand variables and must not
just escape $.

Revision 1.44 / (download) - annotate - [select for diffs], Tue Jan 13 18:30:00 2009 UTC (15 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.43: +12 -35 lines
Diff to previous 1.43 (colored) to selected 1.48 (colored)

When substituting .for control variables (as ${:U...}) escape '$' and '\'
as well as ':' and '}' or ')'.
The parameters have just been expanded (and will be expanded again) later
so don't need expanding as part of the :U process.
Seems to fix pkgsrc breakage at line 34 of bsd.pkginstall.mk doing:
.for i in ${PKG_USERS}
_PKG_VARS.pkginstall+=  PKG_UID.${u} PKG_GECOS.${u} PKG_HOME.${u} PKG_SHELL.${u}
.endfor
when PKG_USERS = ${AVAHI_USER}:${AVAHI_GROUP}::Avahi\ user:/nonexistent
(set at line 41 of the ahavi Makefile)
I really dont think the above has the desired effect!

Revision 1.43 / (download) - annotate - [select for diffs], Sun Jan 11 15:50:06 2009 UTC (15 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.42: +116 -94 lines
Diff to previous 1.42 (colored) to selected 1.48 (colored)

Instead of stashing the body of every iteration of a .for loop, pass
Parse_SetInput() the name of a function to get the loop data blocks.
This should only be a change to the program logic.

Revision 1.42 / (download) - annotate - [select for diffs], Sat Jan 10 16:59:02 2009 UTC (15 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.41: +75 -38 lines
Diff to previous 1.41 (colored) to selected 1.48 (colored)

When substituting .for control variables any } or ) that matches the
${ or $( must be \ escaped.
Should fix some pkgsrc issues - eg 'clean' in print/gv.

Revision 1.41 / (download) - annotate - [select for diffs], Mon Dec 29 10:12:30 2008 UTC (15 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.40: +5 -5 lines
Diff to previous 1.40 (colored) to selected 1.48 (colored)

Count both () and {} when looking for the end of a :M pattern.
In particular inside .if empty(...) it was only counting ().
In reality this needs further changes.
This may well fix recent pkgsrc breakage.

Revision 1.40 / (download) - annotate - [select for diffs], Sun Dec 21 19:19:55 2008 UTC (15 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.39: +14 -6 lines
Diff to previous 1.39 (colored) to selected 1.48 (colored)

Only escape ':' in the outer level of .for variable substitution.
XXX: like elsewhere this code just counts {( against })

Revision 1.39 / (download) - annotate - [select for diffs], Sun Dec 21 18:06:53 2008 UTC (15 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.38: +109 -34 lines
Diff to previous 1.38 (colored) to selected 1.48 (colored)

Change the way .for variables are substituted.
Instead of doing a full substitution giving plain text, just replace the
variable part with something that will expand to the required text - leaving
any modifiers for the later evaluation of the input line.
This stops .for being used as an 'eval' (previously you could generate .if etc)
and also means it is still a variable expansion - which some other parts need
to work in the expected fashion.

Revision 1.38 / (download) - annotate - [select for diffs], Sat Dec 20 22:41:53 2008 UTC (15 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.37: +32 -80 lines
Diff to previous 1.37 (colored) to selected 1.48 (colored)

Add functions for processing extendable arrays of pointers to strings.
Use for the .for variables and substution items - changing the latter from
make's all conquering lst.lib functions.
Being able to index everything makes the code simpler.
No functional changes intended.

Revision 1.37 / (download) - annotate - [select for diffs], Sat Dec 20 17:38:37 2008 UTC (15 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.36: +7 -17 lines
Diff to previous 1.36 (colored) to selected 1.48 (colored)

Set the .for loop control variables in reverse order to avoid faffing.

Revision 1.36 / (download) - annotate - [select for diffs], Sat Dec 13 15:19:29 2008 UTC (15 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.35: +4 -4 lines
Diff to previous 1.35 (colored) to selected 1.48 (colored)

Use NULL instead of -1 cast to the relavant type (usually via NIL).
This was a suggestion from christos - so blame him if there is a deep
reason for using -1 :-)

Revision 1.35 / (download) - annotate - [select for diffs], Mon Dec 1 21:05:21 2008 UTC (15 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.34: +11 -6 lines
Diff to previous 1.34 (colored) to selected 1.48 (colored)

Correct some comments.

Revision 1.34 / (download) - annotate - [select for diffs], Mon Dec 1 19:35:55 2008 UTC (15 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.33: +5 -5 lines
Diff to previous 1.33 (colored) to selected 1.48 (colored)

fix off-by-one allocation. functional change intended...

Revision 1.33 / (download) - annotate - [select for diffs], Sun Nov 30 22:37:55 2008 UTC (15 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.32: +60 -85 lines
Diff to previous 1.32 (colored) to selected 1.48 (colored)

Simplify somewhat the code that parses .for lines.
Use malloc to allocate space for teh strings (instead of a buf structure)
to make it mossible to not leak the associated memory (leak not fixed!).
No functional change intended.

Revision 1.32 / (download) - annotate - [select for diffs], Sat Nov 29 17:50:11 2008 UTC (15 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.31: +112 -113 lines
Diff to previous 1.31 (colored) to selected 1.48 (colored)

Split For_Eval() into two functions.
For_Eval() is now only called for the first line of a .for.
For_Accum() is called for the subsequent lines.
Stops any problems with forLevel being left invalid after an error.
Use a return value of -1 from For_Eval() to mean 'skip input line' to stop
a .for line with a syntax error being reparsed by make.

Revision 1.31 / (download) - annotate - [select for diffs], Sat Nov 22 17:34:56 2008 UTC (15 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.30: +9 -8 lines
Diff to previous 1.30 (colored) to selected 1.48 (colored)

Convert ADDWORD() to do { ... } while (0)

Revision 1.30 / (download) - annotate - [select for diffs], Mon Oct 6 22:09:21 2008 UTC (15 years, 5 months ago) by joerg
Branch: MAIN
CVS Tags: netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2
Changes since 1.29: +5 -5 lines
Diff to previous 1.29 (colored) to selected 1.48 (colored)

Don't use emalloc and friends directly, but call them consistently
bmake_malloc and friends. Implement them via macros for the native case
and provide fallback implementations otherwise. Avoid polluting the
namespace by not defining enomem globally. Don't bother to provide
strdup and strndup, they were only used for the estrdup and estrndup
comapt code.

This addresses the presence of emalloc in system libraries on A/UX and
resulted strange issues as reported by Timothy E. Larson.

Revision 1.29 / (download) - annotate - [select for diffs], Mon May 26 14:29:55 2008 UTC (15 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base
Changes since 1.28: +4 -4 lines
Diff to previous 1.28 (colored) to selected 1.48 (colored)

PR/38756: dominik: make dumps core on invalid makefile

Revision 1.28 / (download) - annotate - [select for diffs], Fri Feb 15 21:29:50 2008 UTC (16 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base2, yamt-pf42-base, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-nbase, hpcarm-cleanup-base
Branch point for: yamt-pf42, wrstuden-revivesa
Changes since 1.27: +6 -7 lines
Diff to previous 1.27 (colored) to selected 1.48 (colored)

back all changes out until I fix it properly.

Revision 1.27 / (download) - annotate - [select for diffs], Thu Feb 14 22:11:20 2008 UTC (16 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: christos-broken
Changes since 1.26: +10 -9 lines
Diff to previous 1.26 (colored) to selected 1.48 (colored)

- use pid_t/size_t as appropriate instead of int.
- use %ld to print pids.
- fix a bit of lint.
- WARNS=4

Revision 1.26 / (download) - annotate - [select for diffs], Mon Jan 1 21:31:51 2007 UTC (17 years, 2 months ago) by dsl
Branch: MAIN
CVS Tags: matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-base, matt-armv6, hpcarm-cleanup, cube-autoconf-base, cube-autoconf
Changes since 1.25: +10 -11 lines
Diff to previous 1.25 (colored) to selected 1.48 (colored)

Remove 'else' after 'return', and similar whitspace changes.
Extra debug on where files are actually found.

Revision 1.25 / (download) - annotate - [select for diffs], Sat Dec 16 08:59:29 2006 UTC (17 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.24: +4 -4 lines
Diff to previous 1.24 (colored) to selected 1.48 (colored)

Use open/read/close instead of stdio for makefiles.
Commons up the code for reading files and buffers, and allows a further
change where we don't copy the data out of the buffer when generating 'lines.
This will speed up makefile parsing (esp .if clauses).

Revision 1.24 / (download) - annotate - [select for diffs], Fri Oct 27 21:00:19 2006 UTC (17 years, 4 months ago) by dsl
Branch: MAIN
CVS Tags: netbsd-4-base
Branch point for: wrstuden-fixsa, netbsd-4
Changes since 1.23: +4 -4 lines
Diff to previous 1.23 (colored) to selected 1.48 (colored)

Since 'ClientData' is 'void *', nuke almost all the (ClientData) casts.

Revision 1.23 / (download) - annotate - [select for diffs], Sun Oct 15 08:38:21 2006 UTC (17 years, 5 months ago) by dsl
Branch: MAIN
Changes since 1.22: +8 -8 lines
Diff to previous 1.22 (colored) to selected 1.48 (colored)

Output all debug trace output through 'debug_file' defaulting to 'stdout'.
(Almost all the debug output went there, but some went to stderr.)
Split the parsing of -d (debug flags) out into its own routine.
Allow the output filename to be changed by specifying -dF<file> to create
a log file, or -dF+<file> to append to it. <file> may be stdout or stderr.
Also change so that -d-<flags> acts on <flags> locally but doesn't copy
them to MAKEFLAGS so they aren't inherited by child makes.
I'm not 100% happy with the command line syntax for the above, so they are
currently undocumented.

Revision 1.22 / (download) - annotate - [select for diffs], Tue Aug 9 21:36:42 2005 UTC (18 years, 7 months ago) by christos
Branch: MAIN
CVS Tags: chap-midi-nbase, chap-midi-base, chap-midi, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.21: +4 -4 lines
Diff to previous 1.21 (colored) to selected 1.48 (colored)

Add typedefs for DuplicateProc and FreeProc from Max Okumoto.

Revision 1.21 / (download) - annotate - [select for diffs], Mon Aug 8 16:42:54 2005 UTC (18 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.20: +7 -7 lines
Diff to previous 1.20 (colored) to selected 1.48 (colored)

From Max Okumoto:
- Remove casts to NULL.
- Remove space between cast and object.

Revision 1.20 / (download) - annotate - [select for diffs], Fri Aug 5 00:53:18 2005 UTC (18 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.19: +4 -4 lines
Diff to previous 1.19 (colored) to selected 1.48 (colored)

More KNF cleanups from Max Okumoto

Revision 1.19 / (download) - annotate - [select for diffs], Mon Jul 25 22:55:58 2005 UTC (18 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.18: +12 -12 lines
Diff to previous 1.18 (colored) to selected 1.48 (colored)

Whitespace KNF cleanup from Max Okumoto

Revision 1.18 / (download) - annotate - [select for diffs], Wed Feb 16 15:11:52 2005 UTC (19 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3
Changes since 1.17: +4 -4 lines
Diff to previous 1.17 (colored) to selected 1.48 (colored)

PR/29203, PR/29204: Max Okumoto: KNF changes to make [no functional changes]

Revision 1.17 / (download) - annotate - [select for diffs], Fri May 7 00:04:38 2004 UTC (19 years, 10 months ago) by ross
Branch: MAIN
Changes since 1.16: +4 -4 lines
Diff to previous 1.16 (colored) to selected 1.48 (colored)

Simplify build, no functional changes.

Instead of adding MAKE_BOOTSTRAP for hosted environments, i.e., when
you want things simple, instead add MAKE_NATIVE to get those hugely
important features like __RCSID().

It's now possible to build make on some hosts with: cc *.c */*.c

Revision 1.16 / (download) - annotate - [select for diffs], Sat Mar 6 03:57:07 2004 UTC (20 years ago) by enami
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.15: +5 -5 lines
Diff to previous 1.15 (colored) to selected 1.48 (colored)

Print useful line number on error while executing .for directive.

Revision 1.15 / (download) - annotate - [select for diffs], Thu Aug 7 11:14:50 2003 UTC (20 years, 7 months ago) by agc
Branch: MAIN
Changes since 1.14: +4 -8 lines
Diff to previous 1.14 (colored) to selected 1.48 (colored)

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.

Revision 1.14 / (download) - annotate - [select for diffs], Mon Jul 14 18:19:12 2003 UTC (20 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.13: +4 -4 lines
Diff to previous 1.13 (colored) to selected 1.48 (colored)

Pass WARNS=3

Revision 1.13 / (download) - annotate - [select for diffs], Sat Jun 15 18:24:56 2002 UTC (21 years, 9 months ago) by wiz
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.12: +13 -12 lines
Diff to previous 1.12 (colored) to selected 1.48 (colored)

Remove !__STDC__ stuff, de-__P(), ANSIfy, and de-register.

Revision 1.12 / (download) - annotate - [select for diffs], Tue Mar 12 20:15:15 2002 UTC (22 years ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6
Changes since 1.11: +9 -4 lines
Diff to previous 1.11 (colored) to selected 1.48 (colored)

PR/15888: Jarkko Teppo: Problems building on HP/UX
1. Compensate for h-pox assert brain damage where it gets confused by the
   string in: assert(!memcmp(foo, "in", 2)); I miss the h-pox broken compiler,
   I had not had to work around it for years.
2. Oh, finally h-pox has random() and utimes(). We don't need our own anymore.

Revision 1.11 / (download) - annotate - [select for diffs], Tue Jun 12 23:36:17 2001 UTC (22 years, 9 months ago) by sjg
Branch: MAIN
Changes since 1.10: +4 -4 lines
Diff to previous 1.10 (colored) to selected 1.48 (colored)

Add 4th arg (flags) to Var_Set so that VarLoopExpand can tell it not
to export interator variables when using context VAR_CMD.

Reviewed: christos

Revision 1.10 / (download) - annotate - [select for diffs], Tue Jun 6 04:56:52 2000 UTC (23 years, 9 months ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5
Changes since 1.9: +10 -7 lines
Diff to previous 1.9 (colored) to selected 1.48 (colored)

Roll back my for-expansion changes.  Doing this right is just too hard to be
worth it.

Revision 1.9 / (download) - annotate - [select for diffs], Thu Jun 1 04:16:39 2000 UTC (23 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.8: +10 -13 lines
Diff to previous 1.8 (colored) to selected 1.48 (colored)

Create a `for' context, and substitute iteration variable from it using the
normal Var_Parse() path.  This allows :R, etc. to work on iteration variables.

Revision 1.8 / (download) - annotate - [select for diffs], Tue Apr 18 03:46:41 2000 UTC (23 years, 11 months ago) by simonb
Branch: MAIN
CVS Tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Changes since 1.7: +4 -4 lines
Diff to previous 1.7 (colored) to selected 1.48 (colored)

Buf_GetAll() takes an int *, not a size_t *.

Build failure on alpha reported by Tim Rightnour on current-users.

Revision 1.7 / (download) - annotate - [select for diffs], Sun Apr 16 22:08:06 2000 UTC (23 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.6: +158 -78 lines
Diff to previous 1.6 (colored) to selected 1.48 (colored)

PR/9899: David A. Holland: multi-variable .for constructs in make

Revision 1.6 / (download) - annotate - [select for diffs], Sun Sep 28 03:31:03 1997 UTC (26 years, 5 months ago) by lukem
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, netbsd-1-4, netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002, netbsd-1-3-PATCH001, netbsd-1-3-BETA, netbsd-1-3, comdex-fall-1999-base, comdex-fall-1999
Changes since 1.5: +6 -2 lines
Diff to previous 1.5 (colored) to selected 1.48 (colored)

wrap #include <sys/cdefs.h>, __RCSID(...) stuff in #ifndef MAKE_BOOTSTRAP

Revision 1.5 / (download) - annotate - [select for diffs], Tue Jul 1 21:17:19 1997 UTC (26 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.4: +3 -2 lines
Diff to previous 1.4 (colored) to selected 1.48 (colored)

Add WARNS=1
RCSID police

Revision 1.4 / (download) - annotate - [select for diffs], Wed Nov 6 17:59:05 1996 UTC (27 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.3: +12 -12 lines
Diff to previous 1.3 (colored) to selected 1.48 (colored)

- Merge in FreeBSD and Lite2 changes.
- Fix bug where a non-archive target with a .a suffix would always
  be considered to be out of date, since it does not have a TOC.

Revision 1.3 / (download) - annotate - [select for diffs], Wed Jun 14 15:19:13 1995 UTC (28 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-BETA, netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Branch point for: netbsd-1-2
Changes since 1.2: +7 -2 lines
Diff to previous 1.2 (colored) to selected 1.48 (colored)

- $NetBSD$ rcsids
- Fixed so that .[A-Z]* targets that do not match keywords are ignored as
  Posix mandates
- Added .PHONY target keyword

Revision 1.2 / (download) - annotate - [select for diffs], Mon Jun 6 22:45:28 1994 UTC (29 years, 9 months ago) by jtc
Branch: MAIN
CVS Tags: netbsd-1-0-base, netbsd-1-0-RELEASE, netbsd-1-0-PATCH1, netbsd-1-0-PATCH06, netbsd-1-0-PATCH05, netbsd-1-0-PATCH04, netbsd-1-0-PATCH03, netbsd-1-0-PATCH02, netbsd-1-0-PATCH0, netbsd-1-0
Changes since 1.1: +28 -22 lines
Diff to previous 1.1 (colored) to selected 1.48 (colored)

Fixes from Christos Zoulas, who used purify, objectcenter and testcenter
to find memory leaks and illegal memory accesses.

Revision 1.1 / (download) - annotate - [select for diffs], Sat Mar 5 00:34:44 1994 UTC (30 years ago) by cgd
Branch: MAIN
Diff to selected 1.48 (colored)

fixes/improvements from Christos Zoulas <christos@deshaw.com>.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>