The NetBSD Project

CVS log for src/usr.bin/make/Attic/nonints.h

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.240, Sun Jan 23 22:12:16 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
CVS Tags: HEAD
Changes since 1.239: +1 -1 lines
FILE REMOVED

make: merge nonints.h into make.h

No functional change.

Revision 1.239 / (download) - annotate - [select for diffs], Sat Jan 15 19:05:23 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.238: +1 -3 lines
Diff to previous 1.238 (colored)

make: remove unnecessary functions for expanding variable names

In meta mode, the affected variable patterns do not contain a '$'.

Outside of meta mode, Global_SetExpand was only called a single time, so
inline that call.

No functional change.

Revision 1.238 / (download) - annotate - [select for diffs], Sat Jan 15 18:34:41 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.237: +2 -1 lines
Diff to previous 1.237 (colored)

make: merge duplicate code for expanding variable expressions

No functional change.

Revision 1.237 / (download) - annotate - [select for diffs], Sun Jan 9 18:49:28 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.236: +2 -2 lines
Diff to previous 1.236 (colored)

make: in Cmd_Exec, return error message instead of format string

This change leaves only literal format strings in parse.c.  It allows
for more detailed error messages than the current "non-zero status" or
"exited on a signal".

No functional change.

Revision 1.236 / (download) - annotate - [select for diffs], Sun Jan 9 12:43:52 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.235: +2 -1 lines
Diff to previous 1.235 (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.235 / (download) - annotate - [select for diffs], Sat Jan 8 23:52:26 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.234: +2 -1 lines
Diff to previous 1.234 (colored)

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

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

Revision 1.234 / (download) - annotate - [select for diffs], Sat Jan 8 20:21:34 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.233: +3 -3 lines
Diff to previous 1.233 (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.233 / (download) - annotate - [select for diffs], Fri Jan 7 20:54:45 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.232: +2 -2 lines
Diff to previous 1.232 (colored)

make: remove redundant function parameter in suffix handling

Now that mainNode is globally visible, there is no need to pass it
through function parameters.

No functional change.

Revision 1.232 / (download) - annotate - [select for diffs], Fri Jan 7 20:50:35 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.231: +1 -2 lines
Diff to previous 1.231 (colored)

make: merge duplicate variables for the main target

No functional change.

Revision 1.231 / (download) - annotate - [select for diffs], Fri Jan 7 20:09:58 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.230: +2 -2 lines
Diff to previous 1.230 (colored)

make: eliminate file-scope variable forLevel

No functional change.

Revision 1.230 / (download) - annotate - [select for diffs], Fri Jan 7 19:24:27 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.229: +1 -2 lines
Diff to previous 1.229 (colored)

make: rename and inline Targ_Precious

No functional change.

Revision 1.229 / (download) - annotate - [select for diffs], Sun Jan 2 01:54:43 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.228: +4 -4 lines
Diff to previous 1.228 (colored)

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

No functional change.

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

make: remove unused parameter from Parse_PushInput

The parameter readMore was never NULL.

No functional change.

Revision 1.227 / (download) - annotate - [select for diffs], Fri Dec 31 00:18:06 2021 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.226: +2 -17 lines
Diff to previous 1.226 (colored)

make: unexport types VarAssignOp and VarAssign

These types are only needed in the parsing module.

No functional change.

Revision 1.226 / (download) - annotate - [select for diffs], Fri Dec 31 00:01:02 2021 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.225: +4 -4 lines
Diff to previous 1.225 (colored)

make: list VarAssignOp in the same order as in the manual page

No functional change.

Revision 1.225 / (download) - annotate - [select for diffs], Wed Dec 29 05:05:21 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.224: +3 -3 lines
Diff to previous 1.224 (colored)

make: merge duplicate types CondEvalResult and CondResult

No binary change.

Revision 1.224 / (download) - annotate - [select for diffs], Wed Dec 29 04:50:56 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.223: +2 -2 lines
Diff to previous 1.223 (colored)

make: remove redundant parameter for evaluating conditions

No functional change.

Revision 1.223 / (download) - annotate - [select for diffs], Tue Dec 28 01:11:36 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.222: +2 -2 lines
Diff to previous 1.222 (colored)

make: constify cached_realpath

No binary change.

Revision 1.222 / (download) - annotate - [select for diffs], Mon Dec 27 17:18:57 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.221: +2 -2 lines
Diff to previous 1.221 (colored)

make: rename eunlink to unlink_file

The name eunlink suggested a relation with the similarly named functions
emalloc or esnprintf, but that was misleading.  Instead, unlink_file
works like unlink, except that it refuses to remove an empty directory.

No functional change.

Revision 1.221 / (download) - annotate - [select for diffs], Wed Dec 15 12:58:01 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.220: +5 -3 lines
Diff to previous 1.220 (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.220 / (download) - annotate - [select for diffs], Wed Dec 15 10:04:49 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.219: +2 -2 lines
Diff to previous 1.219 (colored)

make: change return type of Compat_RunCommand from int to bool

The documentation was wrong before since status was not restricted to
only 0 or 1.

No functional change.

Revision 1.219 / (download) - annotate - [select for diffs], Wed Dec 15 09:53:41 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.218: +32 -32 lines
Diff to previous 1.218 (colored)

make: mark several functions whose result must be used

Suggested by sjg, to catch more bugs like the memory leak in cond.c
1.303 from 2021-12-13.

No binary change.

Revision 1.218 / (download) - annotate - [select for diffs], Mon Dec 13 00:33:33 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.217: +2 -2 lines
Diff to previous 1.217 (colored)

make: fix memory leak when evaluating ${.SUFFIX} (since yesterday)

Revision 1.217 / (download) - annotate - [select for diffs], Sun Dec 12 20:45:48 2021 UTC (2 years, 2 months ago) by sjg
Branch: MAIN
Changes since 1.216: +2 -1 lines
Diff to previous 1.216 (colored)

Add .SUFFIXES as read-only variable.

References to ${.SUFFIXES} are handled dynamically in
ParseVarnameLong by calling Suff_NamesStr.

The variable cannot be set normally.

Reviewed by: rillig

Revision 1.216 / (download) - annotate - [select for diffs], Sun Dec 12 15:44:41 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.215: +2 -2 lines
Diff to previous 1.215 (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.215 / (download) - annotate - [select for diffs], Sun Sep 12 08:03:48 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.214: +2 -2 lines
Diff to previous 1.214 (colored)

make: fix lint warnings for strict bool mode

In strict bool mode, lint does not consider 'x & y' as having type bool,
if x and y have integer type, it only allows this for enums.

No functional change.

Revision 1.214 / (download) - annotate - [select for diffs], Sat Aug 14 13:32:12 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.213: +2 -2 lines
Diff to previous 1.213 (colored)

make: rename variable and function for handling parse errors

The word 'fatals' was an unnecessary abbreviation.

No functional change.

Revision 1.213 / (download) - annotate - [select for diffs], Sun Apr 11 13:35:56 2021 UTC (2 years, 10 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.212: +2 -2 lines
Diff to previous 1.212 (colored)

make: clean up remaining references to VarEvalFlags

VarEvalFlags has been replaced with VarEvalMode.  There were some
comments and tests that still referred to the old names.

No functional change.

Revision 1.212 / (download) - annotate - [select for diffs], Sun Apr 11 12:06:53 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.211: +1 -107 lines
Diff to previous 1.211 (colored)

make: add types Substring and LazyBuf

These will be used for making the string handling more efficient,
avoiding allocations, especially when evaluating variable expressions.

Since the string handling has grown quite a bit in the last months,
extract it into its own header file.

No functional change.

Revision 1.211 / (download) - annotate - [select for diffs], Sun Apr 4 11:56:43 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.210: +25 -46 lines
Diff to previous 1.210 (colored)

make: convert VarEvalFlags back into an enum, but not a bit-set

As was apparent in VarEvalFlags_ToString, a bit-set was not the best
data type since most of the flags were not freely combinable.  The two
flags that could be combined were keepDollar and keepUndef, but even
these have distinguished names in the debug log.

The downside of struct bit-fields is that they need extra helper
functions in C90 (see nonints.h).  Exchange these for a few helper
functions in var.c, to keep the code outside var.c simple.

No functional change.

Revision 1.210 / (download) - annotate - [select for diffs], Sun Apr 4 10:13:09 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.209: +2 -2 lines
Diff to previous 1.209 (colored)

make: remove filler word 'Do' from function names for parsing

No functional change, except for debug logging.

Revision 1.209 / (download) - annotate - [select for diffs], Sun Apr 4 10:05:08 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.208: +2 -2 lines
Diff to previous 1.208 (colored)

make: rename a few functions to be more descriptive

No functional change.

Revision 1.208 / (download) - annotate - [select for diffs], Sat Apr 3 14:39:02 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.207: +50 -9 lines
Diff to previous 1.207 (colored)

make: backport to C90

In the past few months I had accidentally used C99 features in the make
code.  According to tools/README, tools that are used in the build
system should restrict themselves to C90.

This allows make to build with GCC's options "-pedantic
-Wno-system-headers -Dinline= -Wno-error=cast-qual".

I didn't notice anyone actively complaining though, I just wanted to see
how much work this backporting would be.  The identifier __func__ is
still used, as in other tools.

No functional change.

Revision 1.207 / (download) - annotate - [select for diffs], Sat Apr 3 11:08:40 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.206: +26 -26 lines
Diff to previous 1.206 (colored)

make: use C99 bool type instead of defining its own

No functional change.

Revision 1.206 / (download) - annotate - [select for diffs], Mon Mar 15 15:39:13 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.205: +2 -2 lines
Diff to previous 1.205 (colored)

make: change debug log for variable evaluation flags to lowercase

This makes them easier distinguishable from variable names since the
latter are usually uppercase.

No functional change outside debug mode.

Revision 1.205 / (download) - annotate - [select for diffs], Mon Mar 15 12:15:03 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.204: +27 -10 lines
Diff to previous 1.204 (colored)

make: replace enum bit-field with struct bit-field for VarEvalFlags

This makes the code easier to read, especially in var.c.  It also makes
debugging sessions easier since some debuggers don't show enum
bit-fields symbolically as soon as more than one bit is set.

The code outside var.c is basically unchanged, except that instead of
passing the individual flags, there are 4 predefined evaluation modes.
These suffice for all practical use cases.  Only in the implementation
deep inside var.c, the value of the flags keepDollar and keepUndef
differs.

There is no way of passing the struct to EnumFlags_ToString, which means
the ToString function has to be spelled out explicitly.  This allows for
fine-tuning the representation in the debug log, to reduce the amount of
uppercae letters.

No functional change.

Revision 1.204 / (download) - annotate - [select for diffs], Mon Mar 15 11:41:07 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.203: +2 -2 lines
Diff to previous 1.203 (colored)

make: rename VARE_NONE to VARE_PARSE_ONLY

The name 'NONE' described the bit pattern, which was not useful to
understand its meaning.  Omitting VARE_WANTRES only parses the
expression, without evaluating any part of it.

No functional change, not even in debug mode since Enum_FlagsToString
always returns "none" for all-bits-unset.

Revision 1.203 / (download) - annotate - [select for diffs], Sun Feb 14 21:32:58 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.202: +9 -1 lines
Diff to previous 1.202 (colored)

make: clean up FStr and MFStr memory in cleanup mode

Revision 1.202 / (download) - annotate - [select for diffs], Fri Feb 5 05:15:12 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.201: +12 -12 lines
Diff to previous 1.201 (colored)

make: in the Var_ functions, move the scope to the front

This change provides for a more natural reading order in the code.
Placing the scope first makes it immediately clear in which context the
remaining parameters are interpreted.

No functional change.

Revision 1.201 / (download) - annotate - [select for diffs], Fri Feb 5 04:41:17 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.200: +2 -1 lines
Diff to previous 1.200 (colored)

make: add shortcut Global_Delete for deleting a global variable

Revision 1.200 / (download) - annotate - [select for diffs], Thu Feb 4 21:50:39 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.199: +2 -2 lines
Diff to previous 1.199 (colored)

make: rename Var_ValueDirect to GNode_ValueDirect

Revision 1.199 / (download) - annotate - [select for diffs], Thu Feb 4 20:14:33 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.198: +5 -4 lines
Diff to previous 1.198 (colored)

make: group shortcuts for manipulating global variables

No functional change.

Revision 1.198 / (download) - annotate - [select for diffs], Thu Feb 4 19:15:13 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.197: +2 -1 lines
Diff to previous 1.197 (colored)

make: rename Var_SetWithFlags to Var_SetExpandWithFlags

Add back Var_SetWithFlags for the one call that doesn't need to expand
the name.

Now one of the flags is encoded in the function name while the others
are encoded in VarSetFlags.  This is inconsistent.  Maybe there is a
better way to model the different variants of setting a variable.

Revision 1.197 / (download) - annotate - [select for diffs], Thu Feb 4 19:00:45 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.196: +2 -1 lines
Diff to previous 1.196 (colored)

make: rename Var_Set to Var_SetExpand

After doing the textual renaming across all files, I added a new
function Var_Set that does not expand the variable name.  I then undid
the renaming for all calls where the variable name cannot ever contain a
dollar sign.  I omitted the word "Expand" from the textual references in
the unit tests and in the debug logging messages since the focus is
usually on the "Set" part, not on the "Expand".

No functional change.

Revision 1.196 / (download) - annotate - [select for diffs], Wed Feb 3 15:08:17 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.195: +2 -2 lines
Diff to previous 1.195 (colored)

make: rename Var_Delete to Var_DeleteExpand, Var_DeleteVar to Var_Delete

The function names now follow the naming scheme from the other functions
that handle variables.

There are several calls that remain syntactically unchanged but that
omit the call to strchr('$') now.  Since all these calls use constant
variable names, there is no functional change.

Revision 1.195 / (download) - annotate - [select for diffs], Wed Feb 3 14:33:09 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.194: +2 -1 lines
Diff to previous 1.194 (colored)

make: split Var_Exists into plain Var_Exists and Var_ExistsExpand

Most previous calls to Var_Exists use constant variable names.  Only the
two calls in parse.c need to expand the variable name.

It may be a good idea to expand the variable name once in VarAssign_Eval
instead of repeating the expansion in each of its special cases.

No functional change.

Revision 1.194 / (download) - annotate - [select for diffs], Wed Feb 3 13:53:12 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.193: +2 -2 lines
Diff to previous 1.193 (colored)

make: replace Global_AppendExpand with Global_Append

All callers with a variable name that is guaranteed to not contain a
dollar sign have been converted to call Global_Append instead of the
previous Global_AppendExpand.  After that, Global_AppendExpand was
unused, therefore it was effectively just renamed.

Revision 1.193 / (download) - annotate - [select for diffs], Wed Feb 3 13:44:39 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.192: +2 -1 lines
Diff to previous 1.192 (colored)

make: split Var_Append into Var_Append and Var_AppendExpand

The plain Var_Append now does not expand the variable name anymore.  It
is used in situations where the variable name is known to not contain a
dollar sign.

This is a preparation for adding Global_Append, corresponding to
Global_AppendExpand.

Revision 1.192 / (download) - annotate - [select for diffs], Wed Feb 3 08:08:18 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.191: +2 -1 lines
Diff to previous 1.191 (colored)

make: replace Global_SetExpand with Global_Set for constant names

Revision 1.191 / (download) - annotate - [select for diffs], Wed Feb 3 08:00:36 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.190: +3 -1 lines
Diff to previous 1.190 (colored)

make: use shortcut functions Global_SetExpand and Global_AppendExpand

There are many places where global variables are set or appended to.  To
reduce clutter and code size, encode the VAR_GLOBAL in the function
name.

The word Expand in the function names says that the variable name is
expanded.  In most of the cases, this is not necessary, but there are no
corresponding functions Global_Set or Global_Append yet.

Encoding the information whether the name is expanded or not in the
function name will make inconsistencies obvious in future manual code
reviews. Letting the compiler check this by using different types for
unexpanded and expanded variable names is probably not worth the effort.
There are still a few bugs to be fixed, such as in SetVar, which expands
the variable name twice in a row.

Revision 1.190 / (download) - annotate - [select for diffs], Tue Feb 2 17:56:31 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.189: +2 -1 lines
Diff to previous 1.189 (colored)

make: remove overengineered Enum_ValueToString

For printing the status of a GNode, there was already made_name (now
renamed to GNodeMade_Name), which prints user-friendly text instead of
the bare enum constant names.

To do this change confidently, I first had to demonstrate that the
output really affects something other than just the word "UNMADE". There
had not been a test for that case before, and the test immediately
discovered a bug in the -dg2 and -dg3 options.  This bug is one of the
oldest in make, dating back to at least 1993.

Revision 1.189 / (download) - annotate - [select for diffs], Mon Feb 1 21:38:20 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.188: +12 -10 lines
Diff to previous 1.188 (colored)

make: remove outdated comment about VarEvalFlags

The previous variable preserveUndefined is now the flag VARE_KEEP_UNDEF.

Revision 1.188 / (download) - annotate - [select for diffs], Sun Jan 24 20:11:55 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.187: +6 -2 lines
Diff to previous 1.187 (colored)

make(1): convert SearchPath to struct

This prepares for making dotLast a simple struct member instead of a
fake CachedDir, which is easier to understand.

Revision 1.187 / (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.186: +3 -3 lines
Diff to previous 1.186 (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.186 / (download) - annotate - [select for diffs], Mon Dec 28 00:46:24 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.185: +15 -2 lines
Diff to previous 1.185 (colored)

make(1): replace global preserveUndefined with VARE_KEEP_UNDEF

Controlling the expansion of variable expressions using a global
variable and a VARE flag was inconsistent.

Converting the global variable into a flag had to prerequisites:

1.  The unintended duplicate variable assignment had to be fixed, as
done in parse.c 1.520 from 2020-12-27.  Without this fix, it would have
been necessary to add more flags to Var_Exists and Var_SetWithFlags, and
this would have become too complex.

2.  There had to be a unit test demonstrating that VARE_KEEP_DOLLAR only
applies to the top-level expression and is not passed to the
subexpressions, while VARE_KEEP_UNDEF applies to all subexpressions as
well.  This test is in var-op-expand.mk 1.10 from 2020-12-28, at least
for the ':@word@' modifier.  In ParseModifierPartSubst, VARE_KEEP_UNDEF
is not passed down either, in the same way.

Revision 1.185 / (download) - annotate - [select for diffs], Sun Dec 27 14:02:12 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.184: +1 -4 lines
Diff to previous 1.184 (colored)

make(1): remove unnecessary VPR_ERR_SILENT

Revision 1.184 / (download) - annotate - [select for diffs], Sun Dec 27 10:53:23 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.183: +16 -54 lines
Diff to previous 1.183 (colored)

make(1): clean up VarParseResult constants

The many constants were invented because at that time I didn't quite
understand the actual outcomes of Var_Parse that need to be
distinguished.  There are only a few:

(1) Errors, whether they are parse errors, or evaluation errors or
    undefined variables.  The old constants VPR_PARSE_MSG and
    VPR_UNDEF_MSG are merged into VPR_ERR.

(2) Undefined expressions in a situation in which they are allowed.
    Previously the documentation for VPR_UNDEF_SILENT talked about
    undefined expressions in situations where they were not allowed.
    That case is fully covered by VPR_ERR instead.

(3) Errors that are silently ignored.  These are probably bugs.

(4) Everything went fine, the expression has a defined value.

Revision 1.183 / (download) - annotate - [select for diffs], Sun Dec 27 10:09:53 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.182: +2 -7 lines
Diff to previous 1.182 (colored)

make(1): remove unnecessary VPR_UNKNOWN for error handling

There is no sensible way for a caller of Var_Parse to deal with an error
state of "maybe successful, maybe not", therefore remove the constant
for it.

Revision 1.182 / (download) - annotate - [select for diffs], Sun Dec 27 05:06:17 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.181: +3 -3 lines
Diff to previous 1.181 (colored)

make(1): align names of VarExportMode with the directives

Revision 1.181 / (download) - annotate - [select for diffs], Tue Dec 22 20:10:21 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.180: +2 -2 lines
Diff to previous 1.180 (colored)

make(1): allow .undef to undefine multiple variables at once

Since make doesn't support variable names containing spaces, this edge
case is not enough reason to stop this feature.  Having multiple
variable names as arguments nicely aligns with other directives such as
.for and .export.

Revision 1.180 / (download) - annotate - [select for diffs], Sun Dec 20 21:07:32 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.179: +2 -2 lines
Diff to previous 1.179 (colored)

make(1): omit linear search for command in Compat_RunCommand

Revision 1.179 / (download) - annotate - [select for diffs], Sun Dec 20 14:39:46 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.178: +1 -2 lines
Diff to previous 1.178 (colored)

make(1): remove constant parameter from MakeMode

Revision 1.178 / (download) - annotate - [select for diffs], Sun Dec 20 14:32:13 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.177: +2 -2 lines
Diff to previous 1.177 (colored)

make(1): change return type of Var_Value to FStr

Revision 1.177 / (download) - annotate - [select for diffs], Sun Dec 20 13:38:43 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.176: +2 -3 lines
Diff to previous 1.176 (colored)

make(1): return FStr from Var_Parse

This reduces the number of variable declarations at the call sites.

Revision 1.176 / (download) - annotate - [select for diffs], Sun Dec 20 12:53:34 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.175: +54 -1 lines
Diff to previous 1.175 (colored)

make(1): export FStr and MFStr

These types are a replacement for the pattern "var + var_freeIt" that
enforces these two variables to be updated together.

Revision 1.175 / (download) - annotate - [select for diffs], Sat Dec 19 20:47:24 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.174: +2 -1 lines
Diff to previous 1.174 (colored)

make(1): extract Var_DeleteVar from Var_Delete

Revision 1.174 / (download) - annotate - [select for diffs], Sat Dec 19 20:16:36 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.173: +2 -1 lines
Diff to previous 1.173 (colored)

make(1): extract Var_Undef from ParseDirective

Revision 1.173 / (download) - annotate - [select for diffs], Fri Dec 18 14:36:46 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.172: +2 -2 lines
Diff to previous 1.172 (colored)

make(1): constify Targ_FmtTime

Revision 1.172 / (download) - annotate - [select for diffs], Tue Dec 15 20:39:15 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.171: +98 -83 lines
Diff to previous 1.171 (colored)

make(1): indent nonints.h and util.c with tabs instead of spaces

Revision 1.171 / (download) - annotate - [select for diffs], Sun Dec 13 20:14:48 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.170: +8 -1 lines
Diff to previous 1.170 (colored)

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.

Revision 1.170 / (download) - annotate - [select for diffs], Sun Dec 13 02:15:49 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.169: +2 -2 lines
Diff to previous 1.169 (colored)

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.

Revision 1.169 / (download) - annotate - [select for diffs], Sun Dec 13 01:41:12 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.168: +11 -2 lines
Diff to previous 1.168 (colored)

make(1): clean up Var_Export

Revision 1.168 / (download) - annotate - [select for diffs], Sat Dec 12 21:20:30 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.167: +3 -2 lines
Diff to previous 1.167 (colored)

make(1): eliminate boolean argument of Var_Export

Revision 1.167 / (download) - annotate - [select for diffs], Sat Dec 12 18:53:53 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.166: +2 -2 lines
Diff to previous 1.166 (colored)

make(1): rename Var_ExportVars to Var_ReexportVars

Revision 1.166 / (download) - annotate - [select for diffs], Sat Dec 12 00:05:05 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.165: +1 -3 lines
Diff to previous 1.165 (colored)

make(1): inline Targ_Ignore and Targ_Silent

Each of these functions was only used 2 times, and each of these calls
used a different part of the whole expression.

Revision 1.165 / (download) - annotate - [select for diffs], Sun Dec 6 20:09:01 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.164: +3 -3 lines
Diff to previous 1.164 (colored)

make(1): rename IFile.nextbuf to readMore

The previous name sounded too much like a noun, which was too confusing.
See unit-tests/opt-file.mk for the history of this part of the code.

Revision 1.164 / (download) - annotate - [select for diffs], Sun Nov 29 00:04:22 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.163: +3 -3 lines
Diff to previous 1.163 (colored)

make(1): reduce memory allocation for targets

This change moves the initialization and finalization of the list of
targets to the same function.  They had been split before.

Revision 1.163 / (download) - annotate - [select for diffs], Sat Nov 28 22:56:01 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.162: +9 -1 lines
Diff to previous 1.162 (colored)

make(1): replace Dir_Destroy with SearchPath_Free

The function Dir_Destroy is an implementation detail of the cached
directories, and it should not be exported to the other modules.  The
search paths, on the other hand, are the high-level API that may be used
by the other modules, as the concept of search paths is documented in
the manual page.

Revision 1.162 / (download) - annotate - [select for diffs], Mon Nov 16 21:48:18 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.161: +4 -4 lines
Diff to previous 1.161 (colored)

make(1): make some GNode functions const

Revision 1.161 / (download) - annotate - [select for diffs], Mon Nov 16 21:39:22 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.160: +2 -2 lines
Diff to previous 1.160 (colored)

make(1): rename Targ_NewGN to GNode_New

This function is a classical constructor function, and if it weren't for
CLEANUP mode, it would have no dependencies on anything else besides the
memory allocator.  Therefore it doesn't really matter which module
defines this function, and there is no need for the "Targ" to be part of
the function name.

Revision 1.160 / (download) - annotate - [select for diffs], Tue Nov 10 00:32:12 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.159: +2 -2 lines
Diff to previous 1.159 (colored)

make(1): use consistent definition for MAKE_INLINE

Revision 1.159 / (download) - annotate - [select for diffs], Sun Nov 8 16:58:33 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.158: +22 -10 lines
Diff to previous 1.158 (colored)

make(1): rename VARE_ASSIGN to VARE_KEEP_DOLLAR

The other flags in VarEvalFlags already describe their effects, not the
place where they are used.  It's more important to know the effect.

Only a single unit test had to be adjusted.  This probably means that
there are too few tests where the special effects of VARE_KEEP_DOLLAR
come into play.  It could also mean that the effects are so simple and
obvious that they don't need any debug log, but that's not the case.

Revision 1.158 / (download) - annotate - [select for diffs], Sun Nov 8 09:15:19 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.157: +2 -2 lines
Diff to previous 1.157 (colored)

make(1): change return type of Arch_MTime to void

This makes it easier to prove that Dir_MTime always returns gn->mtime,
without looking at the implementation of Arch_UpdateMTime.

Revision 1.157 / (download) - annotate - [select for diffs], Sun Nov 8 09:06:23 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.156: +2 -2 lines
Diff to previous 1.156 (colored)

make(1): change return type of Arch_MemberMTime to void

This makes it easier to prove that Dir_MTime always returns gn->mtime,
without looking at the implementation of Arch_UpdateMemberMTime.

Revision 1.156 / (download) - annotate - [select for diffs], Sat Nov 7 21:31:07 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.155: +5 -3 lines
Diff to previous 1.155 (colored)

make(1): fix type mismatch between int and VarSetFlags

Revision 1.155 / (download) - annotate - [select for diffs], Sat Nov 7 13:13:19 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.154: +5 -2 lines
Diff to previous 1.154 (colored)

make(1): document the relation between VARE_ASSIGN and preserveUndefined

Revision 1.154 / (download) - annotate - [select for diffs], Sat Nov 7 10:16:19 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.153: +8 -6 lines
Diff to previous 1.153 (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.153 / (download) - annotate - [select for diffs], Sat Nov 7 00:06:13 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.152: +2 -2 lines
Diff to previous 1.152 (colored)

make(1): rename Var_Set_with_flags to Var_SetWithFlags

Now that the function is exported from the var module, it should stick
to the naming conventions for public functions.

Revision 1.152 / (download) - annotate - [select for diffs], Sat Nov 7 00:02:54 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.151: +3 -3 lines
Diff to previous 1.151 (colored)

make(1): rename VarSet_Flags to VarSetFlags

Most other types don't have an underscore as well.

Revision 1.151 / (download) - annotate - [select for diffs], Fri Nov 6 23:59:21 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.150: +2 -2 lines
Diff to previous 1.150 (colored)

make(1): rename Arch_MemMTime to Arch_MemberMTime

The abbreviation Mem was ambiguous, it could have meant memory as well.

Revision 1.150 / (download) - annotate - [select for diffs], Fri Nov 6 23:11:11 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.149: +2 -3 lines
Diff to previous 1.149 (colored)

make(1): rename getBoolean and s2Boolean

Revision 1.149 / (download) - annotate - [select for diffs], Sun Nov 1 00:24:57 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.148: +2 -1 lines
Diff to previous 1.148 (colored)

make(1): in lint mode, exit with error status on errors

Calling Parse_Error during parsing has always led to a nonzero exit
status.  Calling Parse_Error later, when expanding the shell commands,
has had no effect on the exit status.  Neither had calling Error.

To make make a reliable tool, it has to report errors as they occur.
Enable this strict behavior in lint mode for now.  Lint mode has to be
enabled explicitly, preserving the default behavior.

Revision 1.148 / (download) - annotate - [select for diffs], Sat Oct 31 11:54:33 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.147: +2 -1 lines
Diff to previous 1.147 (colored)

make(1): do not look up local variables like .TARGET anywhere else

Nobody defines a global variable named .TARGET since that would have
many unpredictable effects, applying to all targets at once.

Nobody defines an environment variable named .TARGET since that's
against the naming conventions for environment variables and would have
the same effect.

Because of this, there is no point looking up the variables that are
local to a GNode anywhere else.  This means they cannot come from the
environment and thus their value doesn't need to be freed after use,
which makes the code simpler.

The newly added accessor functions in make.h refer to external
functions, but since that header is not used anywhere outside of
usr.bin/make, it doesn't matter.  Between 2020-08-25 and 2020-10-30,
that header had been referenced by usr.bin/xinstall.

Revision 1.147 / (download) - annotate - [select for diffs], Fri Oct 30 20:30:44 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.146: +2 -2 lines
Diff to previous 1.146 (colored)

make(1): change char * to void * in Var_Value

The only purpose of the parameter freeIt is to free the memory
associated with the return value.  To do this, no pointer arithmetic is
needed.  Therefore, change to a void pointer, to catch accidental use of
that pointer.

Revision 1.146 / (download) - annotate - [select for diffs], Fri Oct 23 20:04:56 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.145: +2 -2 lines
Diff to previous 1.145 (colored)

make(1): convert error level for Parse_Error to an enum

Revision 1.145 / (download) - annotate - [select for diffs], Mon Oct 19 23:43:55 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.144: +4 -2 lines
Diff to previous 1.144 (colored)

make(1): clean up headers, no functional change

Revision 1.144 / (download) - annotate - [select for diffs], Sun Oct 18 20:14:27 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.143: +2 -5 lines
Diff to previous 1.143 (colored)

make(1): remove redundant code for determining the assignment operator

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

make(1): add tags to enum types

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

Revision 1.142 / (download) - annotate - [select for diffs], Sun Oct 18 07:46:04 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.141: +2 -2 lines
Diff to previous 1.141 (colored)

make(1): replace execError with execDie

All calls to this function were followed by _exit(1).

Revision 1.141 / (download) - annotate - [select for diffs], Sat Oct 17 21:32:30 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.140: +12 -9 lines
Diff to previous 1.140 (colored)

make(1): normalize initialization and cleanup of the modules

Revision 1.140 / (download) - annotate - [select for diffs], Mon Oct 5 19:27:47 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.139: +24 -4 lines
Diff to previous 1.139 (colored)

make(1): revert previous commit

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

Revision 1.139 / (download) - annotate - [select for diffs], Mon Oct 5 19:24:29 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.138: +4 -24 lines
Diff to previous 1.138 (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.138 / (download) - annotate - [select for diffs], Sun Oct 4 20:23:32 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.137: +3 -2 lines
Diff to previous 1.137 (colored)

make(1): clean up parsing of variable assignments

Revision 1.137 / (download) - annotate - [select for diffs], Sun Oct 4 19:36:32 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.136: +20 -3 lines
Diff to previous 1.136 (colored)

make(1): remove duplicate code for parsing a variable name

Revision 1.136 / (download) - annotate - [select for diffs], Sun Oct 4 14:40:13 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.135: +2 -2 lines
Diff to previous 1.135 (colored)

make(1): don't modify the given line during Parse_DoVar

Placing null characters all over the line made the code hard to
understand.  The null characters were placed for top-level whitespace as
well as the operator.

Working with a read-only line makes it easier to inspect the parsing
state during debugging.

This change involves an additional bmake_malloc for each variable name.
This will be compensated later by extending the API of the Var module to
also accept a pair of pointers (start, end) as the variable name.

Revision 1.135 / (download) - annotate - [select for diffs], Sun Oct 4 10:35:25 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.134: +4 -1 lines
Diff to previous 1.134 (colored)

make(1): only use the VARE_ASSIGN flag if necessary

When checking the right-hand side of a variable assignment for syntax
errors, it does not matter  whether a '$$' is expanded to '$' or kept as
'$$'.

Revision 1.134 / (download) - annotate - [select for diffs], Sat Oct 3 15:00:57 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.133: +1 -2 lines
Diff to previous 1.133 (colored)

make(1): inline Str_FindSubstring in JobOutput

Revision 1.133 / (download) - annotate - [select for diffs], Thu Oct 1 23:44:36 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.132: +2 -2 lines
Diff to previous 1.132 (colored)

make(1): add missing const for Parse_AddIncludeDir

Revision 1.132 / (download) - annotate - [select for diffs], Sun Sep 27 11:37:19 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.131: +2 -2 lines
Diff to previous 1.131 (colored)

make(1): make parameter of Compat_RunCommand const

Revision 1.131 / (download) - annotate - [select for diffs], Sat Sep 26 16:41:42 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.130: +2 -2 lines
Diff to previous 1.130 (colored)

make(1): inline Lst_ForEachUntil in Compat_Make

Revision 1.130 / (download) - annotate - [select for diffs], Sat Sep 26 16:00:12 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.129: +5 -3 lines
Diff to previous 1.129 (colored)

make(1): clean up API for finding and creating GNodes

The previous API had complicated rules for the cases in which the single
function returned NULL or what it did.  The flags for that function were
confusing since passing TARG_NOHASH would create a new node even though
TARG_CREATE was not included in that bit mask.

Splitting the function into 3 separate functions avoids this confusion.
It also reveals several places where the complicated API led to
unreachable code.  Such code has been removed.

Revision 1.129 / (download) - annotate - [select for diffs], Fri Sep 25 19:50:04 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.128: +6 -6 lines
Diff to previous 1.128 (colored)

make(1): declare strings for suff.c constant

Revision 1.128 / (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.127: +2 -2 lines
Diff to previous 1.127 (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.127 / (download) - annotate - [select for diffs], Wed Sep 23 03:06:38 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.126: +2 -1 lines
Diff to previous 1.126 (colored)

make(1): fix assertion failure in -j mode with .END node

There had been two separate global variables for the .END node, and in
parallel mode, only the one in jobs.c was initialized.

The code in JobRun heads over to Compat_Make without calling Compat_Run
first, which left the variable ENDNode uninitialized.

Revision 1.126 / (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.125: +2 -2 lines
Diff to previous 1.125 (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.125 / (download) - annotate - [select for diffs], Tue Sep 22 06:06:18 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.124: +16 -16 lines
Diff to previous 1.124 (colored)

make(1): rename VarParseErrors to VarParseResult

The name VPE_OK was confusing since it was not an error at all.

Revision 1.124 / (download) - annotate - [select for diffs], Tue Sep 22 04:05:41 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.123: +10 -10 lines
Diff to previous 1.123 (colored)

make(1): use fine-grained type names for lists and their nodes

This is only intended to help the human reader.  There is no additional
type safety yet.

Revision 1.123 / (download) - annotate - [select for diffs], Mon Sep 21 05:28:26 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.122: +21 -23 lines
Diff to previous 1.122 (colored)

make(1): clean up VarParseErrors, for proper error handling

Having a pure bitset was wrong.

Instead, there are several alternatives (parse error, eval error, undef
error), and each of them can either have an error message printed (good)
or not (bad).  In addition, there are VPE_OK for successful expression
evaluation and VPE_UNKNOWN (only used during migration to the correct
error handling scheme).

Revision 1.122 / (download) - annotate - [select for diffs], Sun Sep 13 20:38:47 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.121: +4 -7 lines
Diff to previous 1.121 (colored)

make(1): fix documentation of VarParseErrors

It does not matter whether lint mode is enabled or not, Var_Parse must
reliably return whether an error message has been printed or not.

In the current phase where proper error handling is implemented only in
lint mode, this leads to code that looks a bit bloated since a few extra
branches are added, but that's ok.  Eventually the SILENT constants will
all be removed, and then the number of different cases will shrink
again.

Revision 1.121 / (download) - annotate - [select for diffs], Sun Sep 13 19:46:23 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.120: +5 -2 lines
Diff to previous 1.120 (colored)

make(1): suppress wrong "Malformed conditional" for undefined variables

This only has an effect in lint mode right now.

Revision 1.120 / (download) - annotate - [select for diffs], Sun Sep 13 19:16:22 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.119: +8 -5 lines
Diff to previous 1.119 (colored)

make(1): make documentation of VarParseErrors more precise

Revision 1.119 / (download) - annotate - [select for diffs], Sun Sep 13 18:27:39 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.118: +56 -2 lines
Diff to previous 1.118 (colored)

make(1): prepare Var_Parse for proper error handling and reporting

Right now, Var_Parse swallows many errors during parsing and evaluation.
Ideally, these errors should propagate from the deeply nested
expressions where they occur up to the top-level expressions.  When such
an error occurs, the depending expressions should not be evaluated any
further.  They may still be parsed, but side effects should be
minimized.

The goal is to prevent incomplete expressions like the "xy}" in
moderrs.exp:106 from being evaluated and eventually passed to the shell
for execution.  This expression is a left-over from a parse error in the
mod-t-parse target in moderrs.mk:154.

This commit is a first step in analyzing and verifying the current state
of affairs. The modelling in VarParseErrors already looks complicated
but is expected to closely match reality.

Revision 1.118 / (download) - annotate - [select for diffs], Sun Sep 13 15:27:25 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.117: +2 -2 lines
Diff to previous 1.117 (colored)

make(1): fix position of MAKE_ATTR_UNUSED in inline functions

The attribute needs to be before the return type, otherwise GCC 5
complains that Hash_GetValue is defined but not used, when compiling
with USER_CPPFLAGS=-Dinline=.  The other functions don't get any
warnings.  It's probably because Hash_GetValue is the only inline
function that returns a pointer.

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

make(1): clean up API for evaluating conditions

There was no need to make struct If publicly visible.

There was no need to have parameters in the public API that were passed
the same constants all the time.

The former function names had not been distinctive.

Revision 1.116 / (download) - annotate - [select for diffs], Sat Sep 12 18:19:50 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.115: +2 -2 lines
Diff to previous 1.115 (colored)

make(1): rename Var_ParsePP back to Var_Parse

The migration to the "parsing position" pointer has been done.

Revision 1.115 / (download) - annotate - [select for diffs], Sat Sep 12 18:04:45 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.114: +1 -2 lines
Diff to previous 1.114 (colored)

make(1): migrate CondParser_String to Var_ParsePP

Revision 1.114 / (download) - annotate - [select for diffs], Sat Sep 12 16:46:24 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.113: +3 -2 lines
Diff to previous 1.113 (colored)

make(1): add typedef for signal handler

Without this typedef, both the declaration and the definition of
bmake_signal were as unreadable as the declaration in the signal(3)
manual page.

Revision 1.113 / (download) - annotate - [select for diffs], Sat Sep 12 16:38:19 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.112: +3 -2 lines
Diff to previous 1.112 (colored)

make(1): fix API of Targ_PrintNode

There was no need to export Targ_PrintNode at all.  All the callers need
is a high-level API for printing a single node or a list of nodes.  The
implementation detail that Targ_PrintNode was used as a callback to
Lst_ForEach should have never leaked into the API.

Revision 1.112 / (download) - annotate - [select for diffs], Sat Sep 12 16:13:48 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.111: +2 -2 lines
Diff to previous 1.111 (colored)

make(1): fix API for Targ_PrintCmd

The previous API was too low-level and not strictly typed.

Revision 1.111 / (download) - annotate - [select for diffs], Sat Sep 12 15:21:25 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.110: +2 -2 lines
Diff to previous 1.110 (colored)

make(1): fix prototype of Suff_EndTransform

Revision 1.110 / (download) - annotate - [select for diffs], Sat Sep 12 15:15:51 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.109: +1 -2 lines
Diff to previous 1.109 (colored)

make(1): move PrintAddr to where it belongs

Revision 1.109 / (download) - annotate - [select for diffs], Sat Sep 12 15:10:55 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.108: +2 -2 lines
Diff to previous 1.108 (colored)

make(1): fix prototype of Compat_Make

Revision 1.108 / (download) - annotate - [select for diffs], Sat Sep 12 15:03:40 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.107: +2 -2 lines
Diff to previous 1.107 (colored)

make(1): fix name and prototype of Compat_RunCommand

By convention, exported identifiers are written with underscore.

The prototype of an exported function must not use void * just because
it is used in Lst_ForEach.  This is an implementation detail and must
remain so.

Revision 1.107 / (download) - annotate - [select for diffs], Sat Sep 12 10:14:16 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.106: +2 -2 lines
Diff to previous 1.106 (colored)

make(1): use proper return type for For_Accum

Revision 1.106 / (download) - annotate - [select for diffs], Sun Sep 6 19:34:36 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.105: +2 -2 lines
Diff to previous 1.105 (colored)

make(1): add const for Parse_IsVar

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

make(1): add const to For_Eval and For_Accum

Revision 1.104 / (download) - annotate - [select for diffs], Thu Sep 3 18:19:15 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.103: +2 -1 lines
Diff to previous 1.103 (colored)

make(1): migrate Var_Parse API to parsing position

The ApplyModifier functions already use this pattern.  For simplicity
and consistency Var_Parse should do the same.  This saves a parameter to
be passed.

The migration takes place step by step, just like for the Lst functions
a few days ago.

Revision 1.103 / (download) - annotate - [select for diffs], Thu Sep 3 16:02:02 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.102: +4 -3 lines
Diff to previous 1.102 (colored)

make(1): make parameter of Cond_Eval and Cond_EvalExpression const

Revision 1.102 / (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.101: +14 -2 lines
Diff to previous 1.101 (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.101 / (download) - annotate - [select for diffs], Sat Aug 29 12:01:46 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.100: +3 -3 lines
Diff to previous 1.100 (colored)

make(1): clean up comments in suff.c, small refactorings

In SuffParseTransform, the parameter names have been renamed to make the
"side effects" comment redundant.

In Suff_AddSuffix and Suff_AddLib, the parameter has been made const.

In SuffRemoveSrc, the unused variable has been removed, and the return
type has been fixed.

Revision 1.100 / (download) - annotate - [select for diffs], Sat Aug 29 07:52:55 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.99: +2 -2 lines
Diff to previous 1.99 (colored)

make(1): allow for strict type checking for Boolean

Having Boolean aliased to int creates ambiguities since int is widely
used.  Allow to occasionally compile make with -DUSE_DOUBLE_BOOLEAN to
check that the type definitions still agree.

Revision 1.99 / (download) - annotate - [select for diffs], Thu Aug 27 06:13:53 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.98: +2 -2 lines
Diff to previous 1.98 (colored)

make(1): convert Arch_ParseArchive from ReturnStatus to Boolean

There are only few functions left that use the ReturnStatus.  These will
be converted as well, to get rid of the additional typedef.

Revision 1.98 / (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.97: +2 -2 lines
Diff to previous 1.97 (colored)

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

Revision 1.97 / (download) - annotate - [select for diffs], Sun Aug 23 09:28:52 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.96: +3 -1 lines
Diff to previous 1.96 (colored)

make(1): fix assertion failure in debug output for read-only variables

Revision 1.96 / (download) - annotate - [select for diffs], Sat Aug 22 19:30:58 2020 UTC (3 years, 6 months ago) by sjg
Branch: MAIN
Changes since 1.95: +8 -1 lines
Diff to previous 1.95 (colored)

Add .SHELL as read-only variable

The .SHELL variable represents the shellPath used to run
scripts.

Reviewed by: rillig, christos

Revision 1.95 / (download) - annotate - [select for diffs], Fri Aug 21 23:28:11 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.94: +1 -5 lines
Diff to previous 1.94 (colored)

make(1): remove function declarations without definitions

Revision 1.94 / (download) - annotate - [select for diffs], Tue Aug 11 18:41:46 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.93: +2 -1 lines
Diff to previous 1.93 (colored)

make(1): add str_concat4 to make the other code simpler

There's no need for arch.c to call strlen when there is a high-level API
for the same purpose.

Revision 1.93 / (download) - annotate - [select for diffs], Mon Aug 10 19:53:19 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.92: +3 -9 lines
Diff to previous 1.92 (colored)

make(1): replace str_concat with str_concat2 and str_concat3

The new functions have a simpler interface, and str_concat3 is even more
general-purpose, since the middle string is no longer required to be
exactly of length 1.

Revision 1.92 / (download) - annotate - [select for diffs], Mon Aug 10 19:30:30 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.91: +9 -2 lines
Diff to previous 1.91 (colored)

make(1): fix parameter name of str_concat

The previous documentation mentioned Str_Concat, but str_concat has been
written in lowercase for years.  The "flags" are not flags since they
cannot be combined, not even when they are written in hex.

Revision 1.91 / (download) - annotate - [select for diffs], Sun Aug 9 13:05:04 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.90: +2 -2 lines
Diff to previous 1.90 (colored)

make(1): improve type signature of Var_Export

Revision 1.90 / (download) - annotate - [select for diffs], Sat Aug 8 13:00:07 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.89: +3 -3 lines
Diff to previous 1.89 (colored)

make(1): clean up Var_UnExport

Mark the parameter as constant since it is not modified.

Remove tests for '\n' since these can never succeed.

newenv can never be NULL since neither of bmake_malloc or bmake_realloc
returns NULL.

Improve variable names: vlist was too unexpressive.

Add debug logging since unexporting variables is an uncommon operation
that directly affects the observable environment of the child processes.

Fix CRLF line endings in a few unit tests.

Revision 1.89 / (download) - annotate - [select for diffs], Sat Aug 1 18:02:37 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.88: +3 -3 lines
Diff to previous 1.88 (colored)

make(1): use enum for return values of Cond_Eval and friends

Revision 1.88 / (download) - annotate - [select for diffs], Sat Aug 1 09:25:36 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.87: +2 -2 lines
Diff to previous 1.87 (colored)

make(1): let Var_Value return a const char *

The return value must not be modified anyway, so let the compiler check
this for free.

Revision 1.87 / (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.86: +2 -2 lines
Diff to previous 1.86 (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.86 / (download) - annotate - [select for diffs], Sun Jul 26 20:21:31 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.85: +2 -2 lines
Diff to previous 1.85 (colored)

make(1): make return value of Var_Parse constant

This return value is not supposed to be modified since it can be a string
literal.  The modifiable part is returned via freePtr, but only for
freeing, not for actually modifying anything.

Revision 1.85 / (download) - annotate - [select for diffs], Sun Jul 26 19:55:24 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.84: +1 -1 lines
Diff to previous 1.84 (colored)

make(1): revert making Var_Parse return a const string

The dependencies between the C files and nonints.h are not declared
properly, which resulted in a successful partial build, but a full "make
clean && make" failed.

Revision 1.84 / (download) - annotate - [select for diffs], Sun Jul 26 19:44:04 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.83: +2 -2 lines
Diff to previous 1.83 (colored)

make(1): mark result of Var_Parse as const

Var_Parse can return either a string literal or an allocated string.  The
former must not be modified by the caller.  If the string is allocated,
it is returned in freePtr as well, but only for freeing it after use.

Revision 1.83 / (download) - annotate - [select for diffs], Sun Jul 26 18:11:12 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.82: +3 -6 lines
Diff to previous 1.82 (colored)

make(1): merge VARE_NOSUBST into VARE_WANTRES

The flag VARE_NOSUBST is only a few days old. It had grown out of the
VARP_NOSUBST and VAR_NOSUBST flags, not knowing at that time that it
meant the exact opposite of VARE_WANTRES.

Revision 1.82 / (download) - annotate - [select for diffs], Mon Jul 20 19:53:40 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.81: +9 -4 lines
Diff to previous 1.81 (colored)

make(1): fix edge cases with $ at the end of the :@ modifier

In both parts of the :@ modifier, by passing &pflags to
ParseModifierPart, a final $ was interpreted as an anchor, which only
makes sense in the :S and :C modifiers.

This edge case is neither used by src nor by pkgsrc, except for the unit
tests that have been adjusted.

Revision 1.81 / (download) - annotate - [select for diffs], Mon Jul 20 18:12:48 2020 UTC (3 years, 7 months ago) by sjg
Branch: MAIN
Changes since 1.80: +3 -1 lines
Diff to previous 1.80 (colored)

Make DEBUG_HASH less of a fire-hose.

Reporting keys on every lookup is overkill unless
playing with a new HASH, so wrap in #ifdef DEBUG_HASH_LOOKUP
Also add some stats at the end so we can see
final size and max chain length - maxchain is a better
variable name than maxlen.

Revision 1.80 / (download) - annotate - [select for diffs], Sun Jul 19 12:26:17 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.79: +7 -7 lines
Diff to previous 1.79 (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.79 / (download) - annotate - [select for diffs], Sun Jul 19 09:26:18 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.78: +1 -3 lines
Diff to previous 1.78 (colored)

make(1): move SysV string matching to var.c

This kind of string matching is only used in variable modifiers, and only
if this feature is enabled by SYSVVARSUB.

Revision 1.78 / (download) - annotate - [select for diffs], Fri Jul 3 07:40:13 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.77: +2 -2 lines
Diff to previous 1.77 (colored)

make(1): refactor Str_Match

- use shorter variable names to avoid line breaks
- eliminate c2 variable
- change return type to Boolean

Revision 1.77 / (download) - annotate - [select for diffs], Thu Jul 2 15:47:38 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.76: +2 -2 lines
Diff to previous 1.76 (colored)

make(1): remove useless parameter from Var_Set

The enum corresponding to this int parameter is only defined in var.c,
which makes it impractical for the outside to set this parameter to
anything but 0.

On x86_64, this reduces the size of the resulting executable by 5 kB.

Revision 1.76 / (download) - annotate - [select for diffs], Thu Jul 2 15:14:38 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.75: +10 -3 lines
Diff to previous 1.75 (colored)

make(1): add more type safety for enums

There are several types of flags for variables, and these cannot be
mixed.  To prevent accidental typos, these are defined in separate enum
types.  Clang warns about direct assignments between distinct types, but
not about mixing distinct types in binary expressions like A | B.  GCC
does not warn at all.

Revision 1.75 / (download) - annotate - [select for diffs], Sat Apr 25 18:20:57 2020 UTC (3 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.74: +3 -3 lines
Diff to previous 1.74 (colored)

- Percent on the rhs is special only if the lhs has one too.
- If the rhs does not have percent, but the lhs has, the result is the rhs
This behavior matches gmake

Revision 1.74 / (download) - annotate - [select for diffs], Mon Sep 5 00:40:29 2016 UTC (7 years, 5 months ago) by sevan
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-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, 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, localcount-20160914, is-mlppp-base, is-mlppp, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Changes since 1.73: +1 -2 lines
Diff to previous 1.73 (colored)

Drop main() prototype.

Revision 1.73 / (download) - annotate - [select for diffs], Fri Jun 3 01:21:59 2016 UTC (7 years, 8 months ago) by sjg
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount
Changes since 1.72: +2 -1 lines
Diff to previous 1.72 (colored)

Add cached_realpath()

realpath(3) is expensive, and meta mode at least uses it extensively.
We use cached_realpath() to save the result of successful calls to
realpath(3) in a private variable context.

This improves the worst case performance (eg examining libc with
nothing to do) by a factor of 4.

Reviewed by: christos

Revision 1.72 / (download) - annotate - [select for diffs], Thu Feb 18 20:25:08 2016 UTC (8 years ago) by sjg
Branch: MAIN
Changes since 1.71: +2 -1 lines
Diff to previous 1.71 (colored)

Add .export-literal to avoid the need for $$ dance when trying to put
unexpanded variables into environment.

Reviewed by: christos

Revision 1.71 / (download) - annotate - [select for diffs], Thu Feb 18 18:29:14 2016 UTC (8 years ago) by christos
Branch: MAIN
Changes since 1.70: +3 -4 lines
Diff to previous 1.70 (colored)

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

Revision 1.70 / (download) - annotate - [select for diffs], Sat Jan 9 00:55:17 2016 UTC (8 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.69: +4 -3 lines
Diff to previous 1.69 (colored)

Preserve $$ in := assignments..

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

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

Revision 1.69 / (download) - annotate - [select for diffs], Sun Oct 11 04:51:24 2015 UTC (8 years, 4 months ago) by sjg
Branch: MAIN
Changes since 1.68: +3 -3 lines
Diff to previous 1.68 (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.68 / (download) - annotate - [select for diffs], Tue May 5 21:51:09 2015 UTC (8 years, 9 months ago) by sjg
Branch: MAIN
Changes since 1.67: +2 -2 lines
Diff to previous 1.67 (colored)

When evaluating condtionals from .if we want to require
that the lhs is a variable reference, a number or a quoted string.
This helps avoid subtle bugs caused by typos.

When conditionals are being evaluated during variable expansion
we cannot be as strict becuase lhs will already have been expanded.

We therefor pass a boolean to Cond_EvalExpression to tell it how
lhs should be treated.

Add unit-tests/cond2.mk to test the above

Reviewed by: christos, joerg

Revision 1.67 / (download) - annotate - [select for diffs], Sun Sep 7 20:55:34 2014 UTC (9 years, 5 months ago) by joerg
Branch: MAIN
Changes since 1.66: +4 -4 lines
Diff to previous 1.66 (colored)

Revert all make changes except the unit tests to the state of three
weeks ago. Individual changes can be reapplied after review.

Revision 1.66 / (download) - annotate - [select for diffs], Sat Aug 23 15:05:40 2014 UTC (9 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.65: +5 -5 lines
Diff to previous 1.65 (colored)

PR/46096: Jarmo Jaakkola: fix many problems with dependencies (PR 49086)

Quite extensive rewrite of the Suff module.  Some ripple effects into
Parse and Targ modules too.

Dependency searches in general were made to honor explicit rules so
implicit and explicit sources are no longer applied on targets that
do not invoke a transformation rule.

Archive member dependency search was rewritten.  Explicit rules now
work properly and $(.TARGET) is set correctly.  POSIX semantics for
lib(member.o) and .s1.a rules are supported.

.SUFFIXES list maintenance was rewritten so that scanning of existing
rules works when suffixes are added and that clearing the suffix list
removes single suffix rules too.  Transformation rule nodes are now
mixed with regular nodes so they are available as regular targets too
if needed (especially after the known suffixes are cleared).

The .NULL target was documented in the manual page, especially to
warn against using it when a single suffix rule would work.
A deprecation warning was also added to the manual and make also
warns the user if it encounters .NULL.

Search for suffix rules no longer allows the explicit dependencies
to override the selected transformation rule.  A check is made in
the search that the transformation that would be tried does not
already exist in the chain.  This prevents getting stuck in an infinite
loop under specific circumstances.  Local variables are now set
before node's children are expanded so dynamic sources work in
multi-stage transformations.  Make_HandleUse() no longer expands
the added children for transformation nodes, preventing triple
expansion and allowing the Suff module to properly postpone their
expansion until proper values are set for the local variables.

Directory prefix is no longer removed from $(.PREFIX) if the target
is found via directory search.

The last rule defined is now used instead of the first one (POSIX
requirement) in case a rule is defined multiple times.  Everything
defined in the first instance is undone, but things added "globally"
are honored.  To implement this, each node tracks attribute bits
which have been set by special targets (global) instead of special
sources (local).  They also track dependencies that were added by
a rule with commands (local) instead of rule with no commands (global).

New attribute, OP_FROM_SYS_MK is introduced.  It is set on all targets
found in system makefiles so that they are not eligible to become
the main target.  We cannot just set OP_NOTMAIN because it is one of
the attributes inherited from transformation and .USE rules and would
make any eligible target that uses a built-in inference rule ineligible.

The $(.IMPSRC) local variable now works like in gmake: it is set to
the first prerequisite for explicit rules.  For implicit rules it
is still the implied source.

The manual page is improved regarding the fixed features.  Test cases
for the fixed problems are added.

Other improvements in the Suff module include:
  - better debug messages for transformation rule search (length of
    the chain is now visualized by indentation)
  - Suff structures are created, destroyed and moved around by a set
    of maintenance functions so their reference counts are easier
    to track (this also gets rid of a lot of code duplication)
  - some unreasonably long functions were split into smaller ones
  - many local variables had their names changed to describe their
    purpose instead of their type

Revision 1.63.2.1 / (download) - annotate - [select for diffs], Tue Oct 30 19:00:22 2012 UTC (11 years, 4 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.63: +8 -15 lines
Diff to previous 1.63 (colored) next main 1.64 (colored)

sync with head

Revision 1.65 / (download) - annotate - [select for diffs], Thu Aug 30 21:17:05 2012 UTC (11 years, 6 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.64: +2 -1 lines
Diff to previous 1.64 (colored)

Add a knob to control whether -V fully expands a plain variable by default.
The default retains the traditional NetBSD behavior, but the knob
can be set so that FreeBSD can retain their expected behavior.
This is a compromise to be sure.

Add a debug flag -dV to override the above, so that regardless of
the knob setting, the raw value of a variable can be easily seen.

Revision 1.64 / (download) - annotate - [select for diffs], Tue Jun 12 19:21:51 2012 UTC (11 years, 8 months ago) by joerg
Branch: MAIN
Changes since 1.63: +7 -15 lines
Diff to previous 1.63 (colored)

Replace __dead, __unused and the various printf format attributes
with versions prefixed by MAKE_ATTR_* to avoid modifying the
implementation namespace. Make sure they are available in all places
using nonints.h to fix bootstrap on Linux.

Revision 1.63 / (download) - annotate - [select for diffs], Fri Sep 16 15:38:04 2011 UTC (12 years, 5 months ago) by joerg
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
Branch point for: yamt-pagecache
Changes since 1.62: +2 -2 lines
Diff to previous 1.62 (colored)

Use __dead consistently. If it doesn't exist, define it away.

Revision 1.62 / (download) - annotate - [select for diffs], Sat Dec 25 04:57:07 2010 UTC (13 years, 2 months ago) by dholland
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Changes since 1.61: +2 -2 lines
Diff to previous 1.61 (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.61 / (download) - annotate - [select for diffs], Thu Dec 9 22:30:17 2010 UTC (13 years, 2 months ago) by sjg
Branch: MAIN
Changes since 1.60: +2 -1 lines
Diff to previous 1.60 (colored)

meta_oodate(): we should track 'latestdir' on a per process basis.
Also, only consider target out of date if a not-found file is outside
'CWD'.  Ignore anything in "/tmp/" or tmpdir.

Revision 1.60 / (download) - annotate - [select for diffs], Sat Aug 7 06:44:08 2010 UTC (13 years, 6 months ago) by sjg
Branch: MAIN
Changes since 1.59: +4 -1 lines
Diff to previous 1.59 (colored)

wait[pid]() is called in several places.
If we encounter an error and run the .ERROR target, we may
reap a pid which jobs is waiting for.  Ensure that we
cleanup so that make isn't left waiting for an already
deceased child.

Revision 1.59 / (download) - annotate - [select for diffs], Thu Jun 3 15:40:16 2010 UTC (13 years, 9 months ago) by sjg
Branch: MAIN
Changes since 1.58: +4 -1 lines
Diff to previous 1.58 (colored)

We have required sigaction() for quite a while.
Use bmake_signal() - a wrapper around sigaction()
rather than signal() to ensure that signals are handled
consistently.

Revision 1.58 / (download) - annotate - [select for diffs], Wed Apr 7 00:11:27 2010 UTC (13 years, 10 months ago) by sjg
Branch: MAIN
Changes since 1.57: +2 -1 lines
Diff to previous 1.57 (colored)

Add:

.error "message"
.warning "message"
	based on FreeBSD implementation.
	add .info while were at it.

.ERROR:	a target to run on error.
	We pass the failing GNode to PrintOnError so it can set
	.ERROR_TARGET.

.MAKE.MAKEFILE_PREFERENCE
	As a means to control make's list of prefered makefile names.
	(Default: "makefile Makefile")

.MAKE.DEPENDFILE
	Names the file to read dependencies from
	(Default ".depend")

.MAKE.MODE
	Processed after all makefiles are read.
	Can put make into "compat" mode (more to come).

Fix:

compat.c: Error code should not be sent to debug_file.
Make_DoAllVar: use DONE_ALLSRC to avoid processing a node multiple times.
ReadMakefile: we can simply use doing_depend to control setting MAKEFILE.

Revision 1.57 / (download) - annotate - [select for diffs], Thu Nov 19 00:30:24 2009 UTC (14 years, 3 months ago) by sjg
Branch: MAIN
CVS Tags: matt-premerge-20091211
Changes since 1.56: +2 -1 lines
Diff to previous 1.56 (colored)

Add .unexport - the exact opposite of .export
and .unexport-env which unexport's all previously .export'd globals
as well as clearing environ[].
Allow's sys.mk near total controll.

Reviewed by: apb

Revision 1.56 / (download) - annotate - [select for diffs], Wed Jan 28 21:38:13 2009 UTC (15 years, 1 month ago) by dsl
Branch: MAIN
CVS Tags: jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend
Changes since 1.55: +3 -2 lines
Diff to previous 1.55 (colored)

Allow for () in the argument to .ifdef et al.
Save/restore current values of global data across expression evaluation
to give ${foo:? ...} a change of working inside another .if.

Revision 1.55 / (download) - annotate - [select for diffs], Sat Jan 24 11:59:39 2009 UTC (15 years, 1 month ago) by dsl
Branch: MAIN
Changes since 1.54: +1 -13 lines
Diff to previous 1.54 (colored)

Move the bmake_malloc() functions into their own .c and .h files.
Include instead of make.h in a few places.

Revision 1.54 / (download) - annotate - [select for diffs], Fri Jan 23 21:26:30 2009 UTC (15 years, 1 month ago) by dsl
Branch: MAIN
Changes since 1.53: +7 -7 lines
Diff to previous 1.53 (colored)

Change 'ClientData' to 'void *' so that relevant parameters can
be made 'const void *'.

Revision 1.53 / (download) - annotate - [select for diffs], Sat Jan 17 13:29:37 2009 UTC (15 years, 1 month ago) by dsl
Branch: MAIN
Changes since 1.52: +2 -2 lines
Diff to previous 1.52 (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.52 / (download) - annotate - [select for diffs], Tue Jan 13 18:22:34 2009 UTC (15 years, 1 month ago) by dsl
Branch: MAIN
Changes since 1.51: +2 -2 lines
Diff to previous 1.51 (colored)

Sprinkle a const. (arg of Main_ParseArgLine())

Revision 1.51 / (download) - annotate - [select for diffs], Sun Jan 11 15:50:06 2009 UTC (15 years, 1 month ago) by dsl
Branch: MAIN
Changes since 1.50: +2 -2 lines
Diff to previous 1.50 (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.50 / (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.49: +2 -1 lines
Diff to previous 1.49 (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.49 / (download) - annotate - [select for diffs], Mon Oct 6 22:09:21 2008 UTC (15 years, 4 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.48: +10 -8 lines
Diff to previous 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.48 / (download) - annotate - [select for diffs], Fri Feb 15 21:29:50 2008 UTC (16 years ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-pf42, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, mjf-devfs2-base, mjf-devfs2, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-nbase, hpcarm-cleanup-base
Changes since 1.47: +5 -5 lines
Diff to previous 1.47 (colored)

back all changes out until I fix it properly.

Revision 1.47 / (download) - annotate - [select for diffs], Thu Feb 14 22:11:20 2008 UTC (16 years ago) by christos
Branch: MAIN
CVS Tags: christos-broken
Changes since 1.46: +6 -6 lines
Diff to previous 1.46 (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.43.4.1 / (download) - annotate - [select for diffs], Tue Nov 6 23:36:02 2007 UTC (16 years, 3 months ago) by matt
Branch: matt-armv6
CVS Tags: matt-armv6-prevmlocking
Changes since 1.43: +5 -1 lines
Diff to previous 1.43 (colored) next main 1.44 (colored)

sync with HEAD

Revision 1.46 / (download) - annotate - [select for diffs], Mon Oct 15 01:07:34 2007 UTC (16 years, 4 months ago) by sjg
Branch: MAIN
CVS Tags: matt-armv6-base, cube-autoconf-base, cube-autoconf
Changes since 1.45: +2 -1 lines
Diff to previous 1.45 (colored)

If we don't have emalloc, we won't have strndup either.
Allows building current make on 2.0.

Revision 1.45 / (download) - annotate - [select for diffs], Sat Oct 13 16:16:41 2007 UTC (16 years, 4 months ago) by apb
Branch: MAIN
Changes since 1.44: +2 -1 lines
Diff to previous 1.44 (colored)

* Convert all uses of strdup() to estrdup();
* Use estrndup() in a few cases where it simplifies the code;
* Provide compatibility definitions of strndup and estrndup;

Revision 1.44 / (download) - annotate - [select for diffs], Fri Oct 5 15:27:45 2007 UTC (16 years, 4 months ago) by sjg
Branch: MAIN
Changes since 1.43: +3 -1 lines
Diff to previous 1.43 (colored)

Add the ability to .export variables to the environment.

Revision 1.41.4.1 / (download) - annotate - [select for diffs], Mon Sep 3 07:05:31 2007 UTC (16 years, 6 months ago) by wrstuden
Branch: wrstuden-fixsa
Changes since 1.41: +5 -4 lines
Diff to previous 1.41 (colored) next main 1.42 (colored)

Sync w/ NetBSD-4-RC_1

Revision 1.41.2.1 / (download) - annotate - [select for diffs], Tue Jun 5 20:53:30 2007 UTC (16 years, 8 months ago) by bouyer
Branch: netbsd-4
CVS Tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0
Changes since 1.41: +5 -4 lines
Diff to previous 1.41 (colored) next main 1.42 (colored)

Apply patch (requested by tron in ticket #696):
	usr.bin/make/compat.c		patch
	usr.bin/make/cond.c		patch
	usr.bin/make/dir.c		patch
	usr.bin/make/for.c		patch
	usr.bin/make/main.c		patch
	usr.bin/make/make.1		patch
	usr.bin/make/make.c		patch
	usr.bin/make/make.h		patch
	usr.bin/make/nonints.h		patch
	usr.bin/make/parse.c		patch
	usr.bin/make/str.c		patch
	usr.bin/make/targ.c		patch
	usr.bin/make/util.c		patch
	usr.bin/make/var.c		patch

Synchronize make(1) with HEAD branch to increase perfomance and
improve stability.

Revision 1.43 / (download) - annotate - [select for diffs], Sun Feb 4 19:23:49 2007 UTC (17 years ago) by dsl
Branch: MAIN
CVS Tags: matt-mips64-base, matt-mips64, hpcarm-cleanup
Branch point for: matt-armv6
Changes since 1.42: +3 -2 lines
Diff to previous 1.42 (colored)

Add code to ensure that .if/.endif are correctly nested with .for/.endfor
and also include files don't have mismatched .if/.endif
It has been suggested that make used to have this test, but I can't
remember removing any code that might have performed it.

Revision 1.42 / (download) - annotate - [select for diffs], Sat Dec 16 08:59:29 2006 UTC (17 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.41: +3 -3 lines
Diff to previous 1.41 (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.41 / (download) - annotate - [select for diffs], Fri Nov 17 22:07:39 2006 UTC (17 years, 3 months ago) by dsl
Branch: MAIN
CVS Tags: netbsd-4-base
Branch point for: wrstuden-fixsa, netbsd-4
Changes since 1.40: +2 -1 lines
Diff to previous 1.40 (colored)

A rather large rototil in the way the parallel make code schedules jobs.
This gives a considerable speedup in the processing of .WAIT and .ORDER.
Both .WAIT and .ORDER stop both the commands of the node, and its dependant
nodes being built until the LH nodes are complete.
.WAIT only applies to the dependency line on which it appears, whereas
.ORDER applies globally between the two nodes.
In both cases dependant nodes can be built because other targets need them.
make now processes the target list left to right, scheduling child nodes
as they are needed to make other nodes (instead of attempting to generate
a bottom-up dependency graph at the start).  This means that 'make -j1'
will tend to build in the same order as a non-parallel make.
Note that:
    all: x y
    x: a .WAIT b
    y: b .WAIT a
does not generate a dependency loop.
But
    x: y
    .ORDER y x
does (unless something elswhere causes 'y' to be built).

Revision 1.40 / (download) - annotate - [select for diffs], Wed Nov 1 23:48:20 2006 UTC (17 years, 4 months ago) by sjg
Branch: MAIN
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored)

Use of libutil to provide emalloc et al, should be predicated on
a native NetBSD build using TOOLDIR etc.
Otherwise use the local versions.

Reviewed by: christos

Revision 1.39 / (download) - annotate - [select for diffs], Sat Aug 26 22:19:03 2006 UTC (17 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.38: +2 -2 lines
Diff to previous 1.38 (colored)

Fix non-native build.

Revision 1.38 / (download) - annotate - [select for diffs], Sat Aug 26 22:13:00 2006 UTC (17 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.37: +2 -2 lines
Diff to previous 1.37 (colored)

Don't include <util.h> if we are not NetBSD. Other OS's don't have it.

Revision 1.37 / (download) - annotate - [select for diffs], Sat Aug 26 18:17:42 2006 UTC (17 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.36: +5 -1 lines
Diff to previous 1.36 (colored)

More programs using efun.

Revision 1.36 / (download) - annotate - [select for diffs], Fri Mar 31 21:58:08 2006 UTC (17 years, 11 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.35: +2 -2 lines
Diff to previous 1.35 (colored)

Add some coverity allocation comments, and change the way the allocator
functions work. When they allocate storage that needs to be freed, instead
of setting a boolean, set the pointer to be freed. Plug some more memory
leaks found by inspection.

Revision 1.35 / (download) - annotate - [select for diffs], Sat Feb 11 18:37:36 2006 UTC (18 years ago) by dsl
Branch: MAIN
Changes since 1.34: +2 -1 lines
Diff to previous 1.34 (colored)

Debug trace all the targets we are actually intending making.
De-optimise the getting of a job token so we don't re-order the job
list when there are no tokens.
This might have helped etc/Makefile, but isn't enough.

Revision 1.34 / (download) - annotate - [select for diffs], Sun May 8 00:38:47 2005 UTC (18 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.33: +3 -2 lines
Diff to previous 1.33 (colored)

Now that dependencies in .BEGIN, .END, and .INTERRUPT work, allow them.

Revision 1.33 / (download) - annotate - [select for diffs], Wed Dec 29 00:43:02 2004 UTC (19 years, 2 months 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.32: +2 -1 lines
Diff to previous 1.32 (colored)

Dir_MTime did not search for a file using the correct parh; i.e. it was
ignoring suffix-specific path search. So if a node was marked .MADE,
then suffix rules would not be applied to it, and we would look for
the file only in the default path, not the suffix-specific path.

XXX: Now that we looked for the suffix, we can save it in the GNode,
but we don't do this yet.

Revision 1.30.2.2 / (download) - annotate - [select for diffs], Mon May 10 15:53:06 2004 UTC (19 years, 9 months ago) by tron
Branch: netbsd-2-0
CVS Tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2
Changes since 1.30.2.1: +2 -1 lines
Diff to previous 1.30.2.1 (colored) to branchpoint 1.30 (colored) next main 1.31 (colored)

Pull up revision 1.32 (requested by sjg in ticket #282):
Remove use of sh -e when running in compat mode.
Its not posix compliant and serves very little purpose.
With this change compat and jobs modes are consistent wrt how
they treat each line of a script.
Add support for the '+' command line prefix as required by posix.
Lines prefixed with '+' are executed even when -n is given.
[Actually posix says they should also be done for -q and -t]
PR:
Reviewed by: jmc

Revision 1.30.2.1 / (download) - annotate - [select for diffs], Mon May 10 15:43:33 2004 UTC (19 years, 9 months ago) by tron
Branch: netbsd-2-0
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

Pull up revision 1.31 (requested by sjg in ticket #282):
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.32 / (download) - annotate - [select for diffs], Fri May 7 08:12:16 2004 UTC (19 years, 9 months ago) by sjg
Branch: MAIN
Changes since 1.31: +2 -1 lines
Diff to previous 1.31 (colored)

Remove use of sh -e when running in compat mode.
Its not posix compliant and serves very little purpose.
With this change compat and jobs modes are consistent wrt how
they treat each line of a script.

Add support for the '+' command line prefix as required by posix.
Lines prefixed with '+' are executed even when -n is given.
[Actually posix says they should also be done for -q and -t]

PR:
Reviewed by: jmc

Revision 1.31 / (download) - annotate - [select for diffs], Fri May 7 00:04:40 2004 UTC (19 years, 9 months ago) by ross
Branch: MAIN
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (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.30 / (download) - annotate - [select for diffs], Sat Mar 6 03:57:07 2004 UTC (19 years, 11 months ago) by enami
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.29: +3 -3 lines
Diff to previous 1.29 (colored)

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

Revision 1.29 / (download) - annotate - [select for diffs], Thu Aug 7 11:14:55 2003 UTC (20 years, 6 months ago) by agc
Branch: MAIN
Changes since 1.28: +33 -1 lines
Diff to previous 1.28 (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.28 / (download) - annotate - [select for diffs], Mon Jul 14 18:19:13 2003 UTC (20 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.27: +23 -23 lines
Diff to previous 1.27 (colored)

Pass WARNS=3

Revision 1.27 / (download) - annotate - [select for diffs], Sat Jun 15 18:24:57 2002 UTC (21 years, 8 months ago) by wiz
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.26: +89 -91 lines
Diff to previous 1.26 (colored)

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

Revision 1.26 / (download) - annotate - [select for diffs], Thu Mar 14 16:08:39 2002 UTC (21 years, 11 months ago) by pk
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.25: +2 -2 lines
Diff to previous 1.25 (colored)

JobExec(): don't use Punt() in the child; it can't possibly DTRT, and will also
mess up the parents variables.

Instead, use execError() for all error paths in the child code.

Revision 1.25 / (download) - annotate - [select for diffs], Fri Jan 18 03:36:00 2002 UTC (22 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.24: +2 -1 lines
Diff to previous 1.24 (colored)

Before we #define __attribute__ away, #undef it.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Jan 18 03:34:19 2002 UTC (22 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored)

Make sure to eat __attribute__'s argument, too.

Revision 1.23 / (download) - annotate - [select for diffs], Thu Jan 17 19:15:02 2002 UTC (22 years, 1 month ago) by eeh
Branch: MAIN
Changes since 1.22: +5 -1 lines
Diff to previous 1.22 (colored)

__attribute__() if we're doing MAKE_BOOTSTRAP is a no-no.

Revision 1.22 / (download) - annotate - [select for diffs], Tue Jun 12 23:36:18 2001 UTC (22 years, 8 months ago) by sjg
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (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.21 / (download) - annotate - [select for diffs], Tue May 29 17:37:52 2001 UTC (22 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.20: +2 -1 lines
Diff to previous 1.20 (colored)

better error messages on exec* failures. From Simon Burge.

Revision 1.20 / (download) - annotate - [select for diffs], Sun Dec 3 02:18:14 2000 UTC (23 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.19: +9 -5 lines
Diff to previous 1.19 (colored)

add noreturn attribute to the functions that need it.

Revision 1.17.2.1 / (download) - annotate - [select for diffs], Thu Oct 19 16:31:49 2000 UTC (23 years, 4 months ago) by he
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-PATCH003
Changes since 1.17: +6 -5 lines
Diff to previous 1.17 (colored) next main 1.18 (colored)

Pull up revision 1.19 (requested by he):
  Format string cleanup.

Revision 1.18.8.1 / (download) - annotate - [select for diffs], Wed Oct 18 01:32:46 2000 UTC (23 years, 4 months ago) by tv
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA
Changes since 1.18: +6 -5 lines
Diff to previous 1.18 (colored) next main 1.19 (colored)

Pullup usr.bin string format fixes [is].
See "cvs log" for explicit revision numbers per file, from sommerfeld.

Revision 1.19 / (download) - annotate - [select for diffs], Wed Oct 11 14:46:12 2000 UTC (23 years, 4 months ago) by is
Branch: MAIN
Changes since 1.18: +6 -5 lines
Diff to previous 1.18 (colored)

More format string cleanup by sommerfeld.

Revision 1.18 / (download) - annotate - [select for diffs], Wed Sep 15 10:47:44 1999 UTC (24 years, 5 months ago) by mycroft
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, netbsd-1-5-base, netbsd-1-5-ALPHA2, minoura-xpg4dl-base, minoura-xpg4dl, comdex-fall-1999-base, comdex-fall-1999
Branch point for: netbsd-1-5
Changes since 1.17: +2 -1 lines
Diff to previous 1.17 (colored)

Rework how :: dependencies are handled.
Build a list of `cohorts' as before, but do *not* link each one into all the
parent nodes; instead, copy the `cohort' lists into the stream of targets to
be built inside Make_ExpandUse().  Also do the attribute propagation as a
separate pass after parsing.
This eliminates several O(n^2) algorithms.

Revision 1.17 / (download) - annotate - [select for diffs], Fri Sep 18 20:35:11 1998 UTC (25 years, 5 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001
Branch point for: netbsd-1-4
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

Fix conditional variable expression parsing (reported by cgd)

Revision 1.14.2.1 / (download) - annotate - [select for diffs], Fri May 8 06:12:08 1998 UTC (25 years, 9 months ago) by mycroft
Branch: netbsd-1-3
CVS Tags: netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002
Changes since 1.14: +3 -4 lines
Diff to previous 1.14 (colored) next main 1.15 (colored)

Sync with trunk, per request of christos.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Apr 1 14:18:10 1998 UTC (25 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.15: +2 -1 lines
Diff to previous 1.15 (colored)

Add conditional variable evaluation from Alistair Crooks.

Revision 1.15 / (download) - annotate - [select for diffs], Thu Mar 26 19:20:37 1998 UTC (25 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.14: +2 -4 lines
Diff to previous 1.14 (colored)

PR/5210: Hauke Fath: make core dumps with .SHELL
Unfortunately this revealed a deeper problem with the brk_string code.
To fix it:
	- remove sharing of the buffer between brk_string invocations
	- change the semantics of brk_string so that the argument array
	  starts with 0, and return the buffer where the strings are
	  stored

Revision 1.14 / (download) - annotate - [select for diffs], Tue Sep 23 21:15:09 1997 UTC (26 years, 5 months ago) by fair
Branch: MAIN
CVS Tags: netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH001, netbsd-1-3-BETA
Branch point for: netbsd-1-3
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (colored)

fix some ints that should be "time_t" per PR#4139

Revision 1.13 / (download) - annotate - [select for diffs], Fri May 2 14:24:29 1997 UTC (26 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.12: +3 -2 lines
Diff to previous 1.12 (colored)

- Target searching addition:
	Make used to only use the search path for nodes that were pure
	sources (not targets of other sources). This has been corrected
	and now gnu-autoconf generated Makefiles work in directories other
	than the source one.

- Suffix transformation rescanning:
	Suffix transformations (.c.o:; cc ...) were only recognized in
	the past when both suffixes were members of the suffix list.
	Thus a sequence like:
		.z.b:
			echo ${.TARGET}
		.SUFFIXES: .z
	would cause .z.b: to be inserted as a regular target (and the main
	target in this case). Other make programs always add rules that
	start with a period in the transformation list and never consider
	them as targets. We cannot do that (consider .depend files) so we
	resort to scanning the list of the current targets every time a
	suffix gets added, and we mutate existing targets that are now
	valid transformation rules into transformation rules. If the
	transformed target was also the main target, we set the main target
	to be the next target in the targets list.

Revision 1.9.4.1 / (download) - annotate - [select for diffs], Sun Jan 26 05:51:47 1997 UTC (27 years, 1 month ago) by rat
Branch: netbsd-1-2
CVS Tags: netbsd-1-2-PATCH001
Changes since 1.9: +7 -4 lines
Diff to previous 1.9 (colored) next main 1.10 (colored)

Update make(1) from trunk, by request from Christos Zoulas.  Fixes many bugs.

Revision 1.1.1.2 / (download) - annotate - [select for diffs] (vendor branch), Sat Dec 28 04:41:12 1996 UTC (27 years, 2 months ago) by tls
Branch: WFJ-920714, CSRG
CVS Tags: lite-2
Changes since 1.1.1.1: +102 -90 lines
Diff to previous 1.1.1.1 (colored)

Import 4.4BSD-Lite2 sources onto CSRG branch (already merged at head)

Revision 1.12 / (download) - annotate - [select for diffs], Wed Nov 6 17:59:19 1996 UTC (27 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.11: +5 -4 lines
Diff to previous 1.11 (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.11 / (download) - annotate - [select for diffs], Tue Aug 13 16:42:11 1996 UTC (27 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.10: +2 -1 lines
Diff to previous 1.10 (colored)

Add estrdup(), a checked version of strdup and use it.

Revision 1.10 / (download) - annotate - [select for diffs], Tue May 28 23:34:44 1996 UTC (27 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.9: +2 -1 lines
Diff to previous 1.9 (colored)

- Move -D flags from Makefile to config.h and explain what they do. Add
  -Wall -Wno-unused to CFLAGS. Add new define SYSVVARSUB to enable SysV
  style variable substitutions and enable them.
- Add SunOS style command substitutions via SUNSHCMD
- Fix core dump with '{variable = value'

Revision 1.9 / (download) - annotate - [select for diffs], Sun Mar 31 21:30:07 1996 UTC (27 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-BETA
Branch point for: netbsd-1-2
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (colored)

make emalloc and erealloc return void *; closes PR/2276

Revision 1.8 / (download) - annotate - [select for diffs], Fri Mar 29 02:17:30 1996 UTC (27 years, 11 months ago) by jtc
Branch: MAIN
Changes since 1.7: +2 -1 lines
Diff to previous 1.7 (colored)

Added erealloc() function that calls enomem() if the allocation fails
(this is like the existing emalloc() function).  Changed all realloc()
calls to erealloc().

Revision 1.7 / (download) - annotate - [select for diffs], Thu Nov 2 23:55:00 1995 UTC (28 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.6: +2 -1 lines
Diff to previous 1.6 (colored)

Minor:
    - ${.PREFIX} should never contain a full pathname
    - Fixed gcc -Wall warnings
Major:
    - compatMake is now FALSE. This means that we are now running in
      full pmake mode:
	  * rules on dependency lines can be executed in parallel and or
	    out of sequence:

	    foo: bar baz

	    can fire the rule for baz before the rule for bar is fired.
	    To enforce bar to be fired before baz, another rule needs to be
	    added. [bar: baz]
	  * adjacent shell commands in a target are now executed by a single
	    invocation of the shell, not one invocation of the shell per line
      (compatMake can be turned off using the -B flag)
    - The -j flag now works... I.e. make -j 4 will fork up to four jobs in
      parallel when it can. The target name is printed before each burst
      of output caused by the target execution as '--- target ---', when j > 1
    - I have changed all the Makefiles so that they work with make -j N, and
      I have tested the whole netbsd by:
	  'make -j 4 cleandir; make -j 4 depend; make -j 4; make -j 4 install'
    - I have not compiled or tested this version of make with -DREMOTE.

Revision 1.6 / (download) - annotate - [select for diffs], Wed Jun 14 15:19:45 1995 UTC (28 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Changes since 1.5: +2 -1 lines
Diff to previous 1.5 (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.5 / (download) - annotate - [select for diffs], Thu Jun 16 18:50:16 1994 UTC (29 years, 8 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.4: +2 -2 lines
Diff to previous 1.4 (colored)

Christos' fix for quoting variable extraction properly.

Revision 1.4 / (download) - annotate - [select for diffs], Mon Jun 6 22:45:37 1994 UTC (29 years, 9 months ago) by jtc
Branch: MAIN
Changes since 1.3: +13 -5 lines
Diff to previous 1.3 (colored)

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

Revision 1.3 / (download) - annotate - [select for diffs], Sat Mar 5 00:35:02 1994 UTC (30 years ago) by cgd
Branch: MAIN
Changes since 1.2: +92 -88 lines
Diff to previous 1.2 (colored)

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

Revision 1.2 / (download) - annotate - [select for diffs], Sun Aug 1 18:11:59 1993 UTC (30 years, 7 months ago) by mycroft
Branch: MAIN
Changes since 1.1: +2 -1 lines
Diff to previous 1.1 (colored)

Add RCS identifiers.

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Sun Mar 21 09:45:37 1993 UTC (30 years, 11 months ago) by cgd
Branch: WFJ-920714, CSRG
CVS Tags: patchkit-0-2-2, netbsd-alpha-1, netbsd-0-9-base, netbsd-0-9-RELEASE, netbsd-0-9-BETA, netbsd-0-9-ALPHA2, netbsd-0-9-ALPHA, netbsd-0-9, netbsd-0-8, WFJ-386bsd-01
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of 386bsd-0.1 sources

Revision 1.1 / (download) - annotate - [select for diffs], Sun Mar 21 09:45:37 1993 UTC (30 years, 11 months ago) by cgd
Branch: MAIN

Initial revision

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>