The NetBSD Project

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

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.262 / (download) - annotate - [select for diffs], Fri Jan 5 23:22:06 2024 UTC (2 months, 3 weeks ago) by rillig
Branch: MAIN
CVS Tags: HEAD
Changes since 1.261: +9 -13 lines
Diff to previous 1.261 (colored) to selected 1.12 (colored)

make: miscellaneous cleanups

Revision 1.261 / (download) - annotate - [select for diffs], Fri Dec 29 18:53:24 2023 UTC (2 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.260: +3 -3 lines
Diff to previous 1.260 (colored) to selected 1.12 (colored)

make: fix declared types of list nodes

No functional change.

Revision 1.260 / (download) - annotate - [select for diffs], Fri Dec 29 12:20:55 2023 UTC (2 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.259: +4 -4 lines
Diff to previous 1.259 (colored) to selected 1.12 (colored)

make: simplify memory allocation for string buffers

In edge cases and short-lived buffers, the initial buffer size is
irrelevant, so use the default.

No functional change.

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

make: clean up calls to Var_Subst

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

No functional change.

Revision 1.258 / (download) - annotate - [select for diffs], Mon Dec 5 23:28:08 2022 UTC (15 months, 3 weeks ago) by rillig
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10
Changes since 1.257: +11 -13 lines
Diff to previous 1.257 (colored) to selected 1.12 (colored)

make: inline local macro in GNodeFlags_ToString

No binary change.

Revision 1.257 / (download) - annotate - [select for diffs], Tue Sep 27 17:46:58 2022 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.256: +4 -4 lines
Diff to previous 1.256 (colored) to selected 1.12 (colored)

make: set WARNS to 6, from the default 5

No binary change on x86_64.

Revision 1.256 / (download) - annotate - [select for diffs], Wed Aug 17 20:10:29 2022 UTC (19 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.255: +3 -3 lines
Diff to previous 1.255 (colored) to selected 1.12 (colored)

make: fix exit status for '-q' (since 1994)

Revision 1.255 / (download) - annotate - [select for diffs], Sat May 7 17:49:47 2022 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.254: +27 -3 lines
Diff to previous 1.254 (colored) to selected 1.12 (colored)

make: allow to randomize build order of targets

In complex dependency structures, when a build fails, a probable cause
is a missing dependency declaration between some files.  In compat mode,
the build order is deterministic, in jobs mode, it is somewhat
deterministic.  To explore more edge cases, add the line ".MAKE.MODE +=
randomize-targets" somewhere in the makefile.

Fixes PR bin/45226 by riastradh.  Reviewed by christos.

Revision 1.254 / (download) - annotate - [select for diffs], Sat May 7 10:05:49 2022 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.253: +10 -18 lines
Diff to previous 1.253 (colored) to selected 1.12 (colored)

make: inline MakeBuildParent

The word "parent" didn't match exactly, since this part is about the
predecessor/successor relationship due to the .ORDER attribute.

No functional change.

Revision 1.253 / (download) - annotate - [select for diffs], Sat May 7 09:44:50 2022 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.252: +8 -20 lines
Diff to previous 1.252 (colored) to selected 1.12 (colored)

make: inline make_abort, improve error details

This function was only called a single time, making the source code line
number redundant.  Instead, print the name of the state instead of its
ordinal value.

Revision 1.252 / (download) - annotate - [select for diffs], Sun Jan 9 15:48:30 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.251: +6 -6 lines
Diff to previous 1.251 (colored) to selected 1.12 (colored)

make: use consistent variable names for varargs

No binary change.

Revision 1.251 / (download) - annotate - [select for diffs], Sat Jan 8 09:53:44 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.250: +3 -4 lines
Diff to previous 1.250 (colored) to selected 1.12 (colored)

make: remove redundant braces

No binary change, except for assertion line numbers.

Revision 1.250 / (download) - annotate - [select for diffs], Mon Dec 27 18:26:22 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.249: +4 -4 lines
Diff to previous 1.249 (colored) to selected 1.12 (colored)

make: remove unnecessary words from command line options

Several years ago, the command line options were individual global
variables.  The global variable could therefore not be named 'silent'
since that would have conflicted with local variables of the same name.
After moving the global variable to the namespace 'struct CmdOpts',
there is no conflict anymore.

There doesn't seem to be any risk of naming collisions for the names
'touch' and 'query'.

No functional change.

Revision 1.249 / (download) - annotate - [select for diffs], Wed Dec 15 12:58:01 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.248: +11 -6 lines
Diff to previous 1.248 (colored) to selected 1.12 (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.248 / (download) - annotate - [select for diffs], Sun Nov 28 23:12:51 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.247: +3 -3 lines
Diff to previous 1.247 (colored) to selected 1.12 (colored)

make: fix a few lint warnings about type mismatch in enum comparisons

These warnings were triggered with the lint flag '-e', which enables
additional checks on enums.  This check would have detected the type
mismatch from the previous commit.

The check has a few strange warnings though, complaining about
initialization of 'unsigned long' with 'unsigned long', so don't enable
it for the official builds.

No functional change.

Revision 1.247 / (download) - annotate - [select for diffs], Sun Nov 28 22:48:06 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.246: +2 -12 lines
Diff to previous 1.246 (colored) to selected 1.12 (colored)

make: move duplicate function Buf_AddFlag to buf.c

It is used only for debug output, therefore performance doesn't matter.

No functional change.

Revision 1.246 / (download) - annotate - [select for diffs], Sun Nov 28 19:51:06 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.245: +37 -37 lines
Diff to previous 1.245 (colored) to selected 1.12 (colored)

make: convert GNodeFlags from enum into bit-fields

Now that Enum_ToString is implemented for each type separately, it's
easy to convert them to bit-fields.  This gets rid of the magic numbers
12 for CYCLE and 13 for DONECYCLE that left a suspicious gap in the
numbers.  This gap was not needed since the code didn't make use of the
relative ordering of the enum constants.

The effects of this conversion are fewer capital letters in the code,
smaller scope for the GNode flags, and clearer code especially when
setting a flag back to false.

One strange thing is that GCC 10.3.0 doesn't optimize GNodeFlags_IsNone
to an single bitmasking instruction, at least on x86_64.  Instead it
generates a testb instruction for each of the flags, even loading bit 8
separately from the others.  Clang 12.0.1 knows this optimization
though and generates the obvious sequence of movzwl, testl, jz.

No functional change.

Revision 1.245 / (download) - annotate - [select for diffs], Sun Nov 28 18:58:58 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.244: +79 -21 lines
Diff to previous 1.244 (colored) to selected 1.12 (colored)

make: replace bloated bit-set-to-string code with simple code

It was a nice idea to implement a bit-set using an enum type and have a
generic ToString function for them.  In the end, the implementation
involved really heavy preprocessor magic and was probably difficult to
understand.  Replace all the code with a few bits of straight-forward
preprocessor magic that can be readily understood by just looking 5
lines around, instead of digging through 130 lines of lengthy macro
definitions.

Curiously, this reduces the binary size even though the 3 ToString
functions now have a few lines of duplicate code and there are more
explicit function calls.

The ToString functions are only seldom used, so the additional memory
allocation is acceptable.

No functional change.

Revision 1.244 / (download) - annotate - [select for diffs], Sun Apr 4 10:05:08 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
CVS Tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.243: +7 -6 lines
Diff to previous 1.243 (colored) to selected 1.12 (colored)

make: rename a few functions to be more descriptive

No functional change.

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

make: use C99 bool type instead of defining its own

No functional change.

Revision 1.242 / (download) - annotate - [select for diffs], Fri Feb 5 05:15:12 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.241: +15 -15 lines
Diff to previous 1.241 (colored) to selected 1.12 (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.241 / (download) - annotate - [select for diffs], Thu Feb 4 21:42:46 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.240: +6 -6 lines
Diff to previous 1.240 (colored) to selected 1.12 (colored)

make: rename context and ctxt to scope

This continues the previous commit, in which VAR_GLOBAL, VAR_INTERNAL
and VAR_CMDLINE were renamed.

Renaming the variable 'ctxt' was trivial since that word is used nowhere
else.  In the comments though, each occurrence of the word 'context' had
to be checked individually since the word 'context' was not only used
for referring to a variable scope.  It is also used to distinguish
different situations where characters are escaped in a certain way
('parsing context') and in a few other expressions.

Revision 1.240 / (download) - annotate - [select for diffs], Tue Feb 2 21:26:51 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.239: +4 -4 lines
Diff to previous 1.239 (colored) to selected 1.12 (colored)

make: remove unused INTERNAL flag

It had been used for cached_realpaths, until this variable had its type
changed from GNode to HashTable in main.c 1.469 from 2020-11-14.

Revision 1.239 / (download) - annotate - [select for diffs], Tue Feb 2 17:56:31 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.238: +4 -8 lines
Diff to previous 1.238 (colored) to selected 1.12 (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.238 / (download) - annotate - [select for diffs], Mon Feb 1 20:42:13 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.237: +6 -9 lines
Diff to previous 1.237 (colored) to selected 1.12 (colored)

make: remove unused return type of MakeBuildParent

Revision 1.237 / (download) - annotate - [select for diffs], Mon Feb 1 20:40:02 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.236: +43 -40 lines
Diff to previous 1.236 (colored) to selected 1.12 (colored)

make: reduce indentation in MakeAddAllSrc

No functional change.

Revision 1.236 / (download) - annotate - [select for diffs], Sat Jan 30 15:48:42 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.235: +5 -7 lines
Diff to previous 1.235 (colored) to selected 1.12 (colored)

make(1): reduce boilerplate for printing bit sets in debug mode

No functional change.

Revision 1.235 / (download) - annotate - [select for diffs], Sat Jan 16 20:49:31 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.234: +8 -8 lines
Diff to previous 1.234 (colored) to selected 1.12 (colored)

make(1): fix a few inconsistencies for lint's strict bool mode

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

make(1): consistently use boolean expressions in conditions

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

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

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

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

make(1): format multi-line comments

Revision 1.232 / (download) - annotate - [select for diffs], Sat Dec 19 13:16:25 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.231: +4 -4 lines
Diff to previous 1.231 (colored) to selected 1.12 (colored)

make(1): rename parameter line to lineno

Revision 1.231 / (download) - annotate - [select for diffs], Fri Dec 18 15:47:34 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.230: +7 -7 lines
Diff to previous 1.230 (colored) to selected 1.12 (colored)

make(1): spell nonexistent consistently

Revision 1.230 / (download) - annotate - [select for diffs], Fri Dec 18 14:46:44 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.229: +4 -3 lines
Diff to previous 1.229 (colored) to selected 1.12 (colored)

make(1): use symbolic time for 0 in Make_Recheck

This makes the test depsrc-optional independent from the current time
zone.

Revision 1.229 / (download) - annotate - [select for diffs], Tue Dec 15 20:17:08 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.228: +713 -662 lines
Diff to previous 1.228 (colored) to selected 1.12 (colored)

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

Revision 1.228 / (download) - annotate - [select for diffs], Tue Dec 15 19:47:02 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.227: +14 -10 lines
Diff to previous 1.227 (colored) to selected 1.12 (colored)

make(1): extract MakeChildren from MakeStartJobs

Revision 1.227 / (download) - annotate - [select for diffs], Sun Dec 6 18:13:17 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.226: +10 -14 lines
Diff to previous 1.226 (colored) to selected 1.12 (colored)

make(1): remove comment decoration

Revision 1.226 / (download) - annotate - [select for diffs], Sat Nov 28 23:50:58 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.225: +13 -13 lines
Diff to previous 1.225 (colored) to selected 1.12 (colored)

make(1): reduce memory allocation for toBeMade

Revision 1.225 / (download) - annotate - [select for diffs], Sat Nov 28 23:48:36 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.224: +10 -10 lines
Diff to previous 1.224 (colored) to selected 1.12 (colored)

make(1): reduce memory allocation in Make_ProcessWait

Revision 1.224 / (download) - annotate - [select for diffs], Sat Nov 28 23:45:25 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.223: +9 -9 lines
Diff to previous 1.223 (colored) to selected 1.12 (colored)

make(1): reduce memory allocation in Make_ExpandUse

Revision 1.223 / (download) - annotate - [select for diffs], Sat Nov 28 19:22:32 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.222: +3 -3 lines
Diff to previous 1.222 (colored) to selected 1.12 (colored)

make(1): reduce pointer indirection for GNode.implicitParents

Revision 1.222 / (download) - annotate - [select for diffs], Sat Nov 28 19:20:03 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.221: +5 -5 lines
Diff to previous 1.221 (colored) to selected 1.12 (colored)

make(1): reduce pointer indirection for GNode.cohorts

Revision 1.221 / (download) - annotate - [select for diffs], Sat Nov 28 19:16:53 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.220: +5 -5 lines
Diff to previous 1.220 (colored) to selected 1.12 (colored)

make(1): reduce pointer indirection for GNode.order_pred and order_succ

Revision 1.220 / (download) - annotate - [select for diffs], Sat Nov 28 19:12:28 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.219: +23 -23 lines
Diff to previous 1.219 (colored) to selected 1.12 (colored)

make(1): reduce memory allocation for GNode.parents and GNode.children

Revision 1.219 / (download) - annotate - [select for diffs], Sat Nov 28 18:55:52 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.218: +5 -5 lines
Diff to previous 1.218 (colored) to selected 1.12 (colored)

make(1): remove pointer indirection from GNode.commands

Just to save a few memory allocations.  No noticeable effect on the
performance though.

Revision 1.218 / (download) - annotate - [select for diffs], Fri Nov 27 08:07:26 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.217: +4 -4 lines
Diff to previous 1.217 (colored) to selected 1.12 (colored)

make(1): inline Lst_ForEachUntil in meta mode

This means no more unnecessary void pointers in function signatures and
no more abstraction level at checking a single element of a list.  In
most cases it is more appropriate to define a function that operates on
the list as a whole, thereby hiding implementation details like the
ListNode from the caller.

Revision 1.217 / (download) - annotate - [select for diffs], Tue Nov 24 23:13:09 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.216: +167 -160 lines
Diff to previous 1.216 (colored) to selected 1.12 (colored)

make(1): indent some functions in make.c with tabs instead of spaces

Revision 1.216 / (download) - annotate - [select for diffs], Tue Nov 24 22:58:54 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.215: +5 -7 lines
Diff to previous 1.215 (colored) to selected 1.12 (colored)

make(1): remove void pointers from MakeBuildParent

Revision 1.215 / (download) - annotate - [select for diffs], Tue Nov 24 22:55:24 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.214: +14 -3 lines
Diff to previous 1.214 (colored) to selected 1.12 (colored)

make(1): inline Lst_ForEachUntil in Make_Update

Revision 1.214 / (download) - annotate - [select for diffs], Tue Nov 24 22:50:38 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.213: +10 -11 lines
Diff to previous 1.213 (colored) to selected 1.12 (colored)

make(1): remove void pointers from MakeBuildChild

Revision 1.213 / (download) - annotate - [select for diffs], Tue Nov 24 22:45:24 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.212: +12 -3 lines
Diff to previous 1.212 (colored) to selected 1.12 (colored)

make(1): inline Lst_ForEachUntil in MakeStartJobs

Revision 1.212 / (download) - annotate - [select for diffs], Tue Nov 24 22:32:18 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.211: +9 -4 lines
Diff to previous 1.211 (colored) to selected 1.12 (colored)

make(1): inline Lst_ForEachUntil in MakeBuildChild

This prepares for removing the void pointers from the function
signature.

Revision 1.211 / (download) - annotate - [select for diffs], Tue Nov 24 19:33:13 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.210: +8 -7 lines
Diff to previous 1.210 (colored) to selected 1.12 (colored)

make(1): add high-level API for GNode.made

Having an enum whose constants must be ordered in a certain way may be
unexpected to casual readers.  Hide this implementation detail in
separate functions.

Revision 1.210 / (download) - annotate - [select for diffs], Sat Nov 21 10:51:26 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.209: +10 -10 lines
Diff to previous 1.209 (colored) to selected 1.12 (colored)

make(1): fix indentation in Make_HandleUse

Revision 1.209 / (download) - annotate - [select for diffs], Mon Nov 16 22:31:42 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.208: +4 -4 lines
Diff to previous 1.208 (colored) to selected 1.12 (colored)

make(1): clean up code style in make.c and suff.c

Revision 1.208 / (download) - annotate - [select for diffs], Mon Nov 16 21:39:22 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.207: +3 -3 lines
Diff to previous 1.207 (colored) to selected 1.12 (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.207 / (download) - annotate - [select for diffs], Sun Nov 15 10:11:26 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.206: +23 -32 lines
Diff to previous 1.206 (colored) to selected 1.12 (colored)

make(1): clean up make.c stylistically

Revision 1.206 / (download) - annotate - [select for diffs], Sun Nov 15 09:57:05 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.205: +6 -6 lines
Diff to previous 1.205 (colored) to selected 1.12 (colored)

make(1): rename checked to checked_seqno

The new name is more precise and also matches the GNode field.

Revision 1.205 / (download) - annotate - [select for diffs], Sat Nov 14 15:03:37 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.204: +3 -3 lines
Diff to previous 1.204 (colored) to selected 1.12 (colored)

make(1): fix debug output for GNode details

Revision 1.204 / (download) - annotate - [select for diffs], Sat Nov 14 14:57:05 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.203: +12 -9 lines
Diff to previous 1.203 (colored) to selected 1.12 (colored)

make(1): use symbolic names in debug output of GNodes

Revision 1.203 / (download) - annotate - [select for diffs], Sun Nov 8 11:37:46 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.202: +4 -13 lines
Diff to previous 1.202 (colored) to selected 1.12 (colored)

make(1): clean up Make_ExpandUse

The targets need to be copied to the 'examine' queue, not because the
targets list would be modified but because the queue is modified and the
targets list should not be affected by that.

Revision 1.202 / (download) - annotate - [select for diffs], Sun Nov 8 11:28:44 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.201: +6 -6 lines
Diff to previous 1.201 (colored) to selected 1.12 (colored)

make(1): fix type of have_token in MakeStartJobs

Revision 1.201 / (download) - annotate - [select for diffs], Sun Nov 8 11:25:26 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.200: +25 -22 lines
Diff to previous 1.200 (colored) to selected 1.12 (colored)

make(1): inline MakeCheckOrder into IsWaitingForOrder

This gets rid of a few void pointers and an unnecessary and unused
function parameter.

The variable name "bn" may have meant "before", but that was not
obvious.  The new name "ogn" nicely matches the ".ORDER" in the debug
message.

Revision 1.200 / (download) - annotate - [select for diffs], Sun Nov 8 11:05:58 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.199: +22 -18 lines
Diff to previous 1.199 (colored) to selected 1.12 (colored)

make(1): inline MakeAddChild into ExamineLater

This gets rid of a few void pointers and unspecific variable names like
"l" for the list that should have rather been called "examine" all the
time.

Add quotes around placeholders in debug messages.  Especially for targets
like "all" the message had been syntactically misleading.

Revision 1.199 / (download) - annotate - [select for diffs], Sun Nov 8 10:50:50 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.198: +11 -24 lines
Diff to previous 1.198 (colored) to selected 1.12 (colored)

make(1): inline MakeFindChild into PretendAllChildrenAreMade

This gets rid of a few void pointers and some function calls.  The
documentation of MakeFindChild essentially repeated what the code does,
and the redundant parts of it have been removed.

Revision 1.198 / (download) - annotate - [select for diffs], Sun Nov 8 10:40:07 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.197: +9 -4 lines
Diff to previous 1.197 (colored) to selected 1.12 (colored)

make(1): extract PretendAllChildrenAreMade from Make_ExpandUse

Revision 1.197 / (download) - annotate - [select for diffs], Sun Nov 8 10:33:47 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.196: +26 -27 lines
Diff to previous 1.196 (colored) to selected 1.12 (colored)

make(1): fix debug output in out-of-date for cohorts (since 2003-11-14)

Before, a wrong cause for being out-of-date was printed in the debug log,
for optional cohorts.  This was caused by having the same conditions
duplicated in the code, instead of putting them in a separate function.

Now the optional cohort is correctly identified as using the '::'
dependency operator.

Revision 1.196 / (download) - annotate - [select for diffs], Sun Nov 8 10:17:55 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.195: +3 -3 lines
Diff to previous 1.195 (colored) to selected 1.12 (colored)

make(1): add test for wrong debug message in GNode_IsOODate

Revision 1.195 / (download) - annotate - [select for diffs], Sun Nov 8 09:48:52 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.194: +20 -15 lines
Diff to previous 1.194 (colored) to selected 1.12 (colored)

make(1): extract condition from GNode_IsOODate into separate function

Revision 1.194 / (download) - annotate - [select for diffs], Sun Nov 8 09:34:55 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.193: +10 -7 lines
Diff to previous 1.193 (colored) to selected 1.12 (colored)

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

Only some callers actually needed the updated time, and because of the
many branches, it was difficult to see that the return value was indeed
gn->mtime all the time.

Revision 1.193 / (download) - annotate - [select for diffs], Sun Nov 8 09:06:23 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.192: +5 -2 lines
Diff to previous 1.192 (colored) to selected 1.12 (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.192 / (download) - annotate - [select for diffs], Sun Nov 8 08:55:25 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.191: +8 -10 lines
Diff to previous 1.191 (colored) to selected 1.12 (colored)

make(1): clean up comments in Make_Recheck

Revision 1.191 / (download) - annotate - [select for diffs], Sun Nov 8 08:53:22 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.190: +3 -4 lines
Diff to previous 1.190 (colored) to selected 1.12 (colored)

make(1): use common indentation style for else

Revision 1.190 / (download) - annotate - [select for diffs], Sun Nov 8 08:33:07 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.189: +5 -5 lines
Diff to previous 1.189 (colored) to selected 1.12 (colored)

make(1): rename Make_OODate to GNode_IsOODate

It doesn't matter which of the make modules is in charge of determining
whether a node is out-of-date.  Therefore, remove the module name from
the function name.

Revision 1.189 / (download) - annotate - [select for diffs], Sun Nov 8 08:26:22 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.188: +12 -12 lines
Diff to previous 1.188 (colored) to selected 1.12 (colored)

make(1): rename Make_TimeStamp to GNode_UpdateYoungestChild

Revision 1.188 / (download) - annotate - [select for diffs], Sat Nov 7 21:22:37 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.187: +7 -9 lines
Diff to previous 1.187 (colored) to selected 1.12 (colored)

make(1): clean up Make_OODate and Make_Run

Revision 1.187 / (download) - annotate - [select for diffs], Sat Nov 7 10:16:18 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.186: +13 -13 lines
Diff to previous 1.186 (colored) to selected 1.12 (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.186 / (download) - annotate - [select for diffs], Sun Nov 1 17:47:26 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.185: +5 -5 lines
Diff to previous 1.185 (colored) to selected 1.12 (colored)

make(1): negate NoExecute to GNode_ShouldExecute

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

make(1): format #include directives consistently

Revision 1.184 / (download) - annotate - [select for diffs], Sat Oct 31 11:54:33 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.183: +8 -20 lines
Diff to previous 1.183 (colored) to selected 1.12 (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.183 / (download) - annotate - [select for diffs], Fri Oct 30 20:30:44 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.182: +6 -6 lines
Diff to previous 1.182 (colored) to selected 1.12 (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.182 / (download) - annotate - [select for diffs], Fri Oct 30 15:39:17 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.181: +9 -9 lines
Diff to previous 1.181 (colored) to selected 1.12 (colored)

make(1): fix indentation in source code

Revision 1.181 / (download) - annotate - [select for diffs], Mon Oct 26 21:34:10 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.180: +11 -11 lines
Diff to previous 1.180 (colored) to selected 1.12 (colored)

make(1): group the command line options and arguments

By having a single struct that holds all command line options and
arguments, it is easy to see in the code when such a command line
argument is modified.  It also cleans up the namespace since the command
line options don't follow a common naming style.  Having them in a
struct also means that there is a single place for putting the
documentation, not two as before.

The struct also suggests to extract the initialization code out of main,
which is still too large, having more than 400 lines of code and
covering far too many topics.

Revision 1.180 / (download) - annotate - [select for diffs], Sun Oct 25 21:51:48 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.179: +5 -6 lines
Diff to previous 1.179 (colored) to selected 1.12 (colored)

make(1): add GNode_Path to access the path of a GNode

Revision 1.179 / (download) - annotate - [select for diffs], Sun Oct 25 10:07:23 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.178: +11 -3 lines
Diff to previous 1.178 (colored) to selected 1.12 (colored)

make(1): inline Lst_Copy in Make_ExpandUse

Revision 1.178 / (download) - annotate - [select for diffs], Fri Oct 23 19:48:17 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.177: +20 -17 lines
Diff to previous 1.177 (colored) to selected 1.12 (colored)

make(1): rename GNode.cmgn to youngestChild

The name is longer than before but also clearer.

Revision 1.177 / (download) - annotate - [select for diffs], Fri Oct 23 18:36:09 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.176: +5 -5 lines
Diff to previous 1.176 (colored) to selected 1.12 (colored)

make(1): negate OP_NOP and rename it to GNode_IsTarget

Revision 1.176 / (download) - annotate - [select for diffs], Fri Oct 23 04:58:33 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.175: +6 -8 lines
Diff to previous 1.175 (colored) to selected 1.12 (colored)

make(1): remove Lst_ForEachUntilConcurrent

The remaining callers of that function don't modify the list
structurally and thus can use the simpler Lst_ForEachUntil instead.

Revision 1.175 / (download) - annotate - [select for diffs], Thu Oct 22 21:53:01 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.174: +10 -9 lines
Diff to previous 1.174 (colored) to selected 1.12 (colored)

make(1): fix MakePrintStatusList

The current unit tests don't cover a situation where there are more than
100 errors reported at once.  This fixes the bug introduced in the
previous commit, a few minutes ago.

Revision 1.174 / (download) - annotate - [select for diffs], Thu Oct 22 21:49:44 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.173: +15 -9 lines
Diff to previous 1.173 (colored) to selected 1.12 (colored)

make(1): remove void pointers from MakePrintStatus

Revision 1.173 / (download) - annotate - [select for diffs], Thu Oct 22 21:43:56 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.172: +15 -11 lines
Diff to previous 1.172 (colored) to selected 1.12 (colored)

make(1): remove void pointers from MakePrintStatusOrder

Revision 1.172 / (download) - annotate - [select for diffs], Thu Oct 22 21:27:24 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.171: +12 -9 lines
Diff to previous 1.171 (colored) to selected 1.12 (colored)

make(1): add Lst_ForEachUntilConcurrent

Previously, Lst_ForEachUntil allowed the list to be modified while
iterating.  Almost none of the code needs this, and it's also confusing
for human readers.

None of the current unit tests makes use of this concurrent modification
right now, but that's not evidence enough.  Only 72% of the code are
covered by unit tests right now, and there are lots of edge cases
(whether intended or not) that are not covered by unit tests.

Therefore, all calls to Lst_ForEachUntil were changed to
Lst_ForEachUntilConcurrent and those that were obvious were changed
back.  The remaining calls probably don't need the concurrent
modification code, but that's not obvious from looking at the code.

Revision 1.171 / (download) - annotate - [select for diffs], Thu Oct 22 20:09:07 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.170: +3 -5 lines
Diff to previous 1.170 (colored) to selected 1.12 (colored)

make(1): replace Lst_Open with simple iteration in Make_ProcessWait

Revision 1.170 / (download) - annotate - [select for diffs], Thu Oct 22 20:00:13 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.169: +6 -10 lines
Diff to previous 1.169 (colored) to selected 1.12 (colored)

make(1): replace Lst_Open with simple iteration in Make_Update

Revision 1.169 / (download) - annotate - [select for diffs], Thu Oct 22 17:29:32 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.168: +32 -23 lines
Diff to previous 1.168 (colored) to selected 1.12 (colored)

make(1): extract UpdateImplicitParentsVars from Make_Update

Revision 1.168 / (download) - annotate - [select for diffs], Thu Oct 22 17:20:35 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.167: +13 -13 lines
Diff to previous 1.167 (colored) to selected 1.12 (colored)

make(1): replace Lst_Open with simple iteration in Make_Update

This iteration is safe from concurrent modification.

Revision 1.167 / (download) - annotate - [select for diffs], Thu Oct 22 05:50:02 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.166: +5 -5 lines
Diff to previous 1.166 (colored) to selected 1.12 (colored)

make(1): remove redundant type casts

This mainly affects the void pointers in callback functions for lists.
These had been necessary once when the parameter type was still
ClientData instead of void pointer.

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

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

Revision 1.165 / (download) - annotate - [select for diffs], Mon Oct 19 21:57:37 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.164: +8 -8 lines
Diff to previous 1.164 (colored) to selected 1.12 (colored)

make(1): inline simple Lst getters

The function call variant takes more screen space than the direct field
access.  Having an abstract API is usually a good idea, in this case of
simple read-only member access it makes the code more difficult to read.

LstNode_Set has been kept as a function since it is not a read-only
accessor function.

Revision 1.164 / (download) - annotate - [select for diffs], Mon Oct 19 19:55:25 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.163: +15 -17 lines
Diff to previous 1.163 (colored) to selected 1.12 (colored)

make(1): inline link_parent into Make_ProcessWait

Revision 1.163 / (download) - annotate - [select for diffs], Mon Oct 19 19:48:09 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.162: +5 -9 lines
Diff to previous 1.162 (colored) to selected 1.12 (colored)

make(1): inline MakeTimeStamp in Make_OODate

Revision 1.162 / (download) - annotate - [select for diffs], Mon Oct 19 19:45:50 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.161: +9 -9 lines
Diff to previous 1.161 (colored) to selected 1.12 (colored)

make(1): eliminate void pointer from MakeAddAllSrc

Revision 1.161 / (download) - annotate - [select for diffs], Sun Oct 18 14:58:45 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.160: +7 -8 lines
Diff to previous 1.160 (colored) to selected 1.12 (colored)

make(1): replace Lst_Open with simple iteration in Make_HandleUse

Revision 1.160 / (download) - annotate - [select for diffs], Sun Oct 18 13:02:10 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.159: +4 -4 lines
Diff to previous 1.159 (colored) to selected 1.12 (colored)

make(1): rename Lst_Init to Lst_New

For the other types such as HashTable and Buffer, the Init function does
not allocate the memory for the structure itself, it only fills it.

Revision 1.159 / (download) - annotate - [select for diffs], Sun Oct 18 11:09:08 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.158: +8 -2 lines
Diff to previous 1.158 (colored) to selected 1.12 (colored)

make(1): convert NoExecute to non-inline

The header make.h is not only used by usr.bin/make but also by
usr.bin/xinstall, to get the needshell function.

That program does not declare the variables noRecursiveExecute and
noExecute, leading to an "unresolved reference" at link time.  To fix
this, move the inline functions away from make.h.

It's a quirk that make.h gets included by other programs since it
contains a whole lot of definitions that are only useful in make itself.
If any, there should be a separate header that defines the public
library API of make, and only that.

Revision 1.158 / (download) - annotate - [select for diffs], Sat Oct 17 17:47:14 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.157: +3 -3 lines
Diff to previous 1.157 (colored) to selected 1.12 (colored)

make(1): fix indentation

Revision 1.157 / (download) - annotate - [select for diffs], Thu Oct 1 22:42:00 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.156: +2 -7 lines
Diff to previous 1.156 (colored) to selected 1.12 (colored)

make(1): remove redundant function prototypes

Revision 1.156 / (download) - annotate - [select for diffs], Mon Sep 28 23:13:57 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.155: +5 -5 lines
Diff to previous 1.155 (colored) to selected 1.12 (colored)

make(1): replace += 1 with ++ and -= 1 with --

Just for visual consistency.  The generated code stays exactly the same.

Revision 1.155 / (download) - annotate - [select for diffs], Mon Sep 28 23:02:02 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.154: +4 -5 lines
Diff to previous 1.154 (colored) to selected 1.12 (colored)

make(1): migrate Make_ProcessWait from Lst_ForEachUntil to Lst_ForEach

Revision 1.154 / (download) - annotate - [select for diffs], Mon Sep 28 22:38:32 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.153: +12 -2 lines
Diff to previous 1.153 (colored) to selected 1.12 (colored)

make(1): remove the inline attribute from debug_printf

The code size overhead of a varargs function is much more than I had
expected.  Since GCC 5 didn't inline the function anyway and it is only
used in debug mode, there is no point keeping multiple copies of that
code around.

Revision 1.153 / (download) - annotate - [select for diffs], Mon Sep 28 22:23:35 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.152: +30 -31 lines
Diff to previous 1.152 (colored) to selected 1.12 (colored)

make(1): make debug logging simpler

This avoids referring to the debug_file variable in many places where
this implementation detail is not necessary.

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

make(1): make debugging code shorter

Revision 1.151 / (download) - annotate - [select for diffs], Sun Sep 27 21:35:16 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.150: +36 -36 lines
Diff to previous 1.150 (colored) to selected 1.12 (colored)

make(1): normalize whitespace in source code

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

Revision 1.150 / (download) - annotate - [select for diffs], Sun Sep 27 13:27:50 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.149: +21 -18 lines
Diff to previous 1.149 (colored) to selected 1.12 (colored)

make(1): inline Lst_ForEachUntil in Make_ExpandUse

The tricky detail here is that the current node from the iteration is
removed if it is no longer needed.

The Lst_FindDatum that has been removed was both inefficient and
misleading since it could never return null, yet there was a null check
for it.  The callback API from Lst_ForEachUntil would have required to
define a custom struct for passing this parameter to the callback
function, in addition to the parent node.

Inlining the whole Lst_ForEach and passing the list node as a parameter
is much more obvious.

Revision 1.149 / (download) - annotate - [select for diffs], Sun Sep 27 11:14:03 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.148: +81 -227 lines
Diff to previous 1.148 (colored) to selected 1.12 (colored)

make(1): clean up comments in job.c and make.c

Revision 1.148 / (download) - annotate - [select for diffs], Sat Sep 26 17:39:45 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.147: +94 -36 lines
Diff to previous 1.147 (colored) to selected 1.12 (colored)

make(1): revert migration from Lst_ForEachUntil to Lst_ForEach

There is a crucial difference between these functions, in that
Lst_ForEachUntil can cope with a few concurrent modifications while
iterating over the list.  This is something that Lst_ForEach doesn't do.

This difference led to a crash very early in NetBSD's build.sh.

Revision 1.147 / (download) - annotate - [select for diffs], Sat Sep 26 17:15:20 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.146: +3 -3 lines
Diff to previous 1.146 (colored) to selected 1.12 (colored)

make(1): inline and remove LstNode_Prev and LstNode_Next

These functions made the code larger than necessary.  The prev and next
fields are published intentionally since navigating in a doubly-linked
list is simple to do and there is no need to wrap this in a layer of
function calls, not even syntactically.  (On the execution level, the
function calls had been inlined anyway.)

Revision 1.146 / (download) - annotate - [select for diffs], Sat Sep 26 16:55:58 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.145: +36 -94 lines
Diff to previous 1.145 (colored) to selected 1.12 (colored)

make(1): replace a few Lst_ForEachUntil with simpler Lst_ForEach

Revision 1.145 / (download) - annotate - [select for diffs], Sat Sep 26 16:00:12 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.144: +3 -3 lines
Diff to previous 1.144 (colored) to selected 1.12 (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.144 / (download) - annotate - [select for diffs], Fri Sep 25 14:00:17 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.143: +10 -10 lines
Diff to previous 1.143 (colored) to selected 1.12 (colored)

make(1): inline Lst_ForEach in MakeUnmark

By the way, the additional argument to Lst_ForEach was not used at all.

Revision 1.143 / (download) - annotate - [select for diffs], Thu Sep 24 07:37:42 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.142: +9 -16 lines
Diff to previous 1.142 (colored) to selected 1.12 (colored)

make(1): migrate MakeTimeStamp and MakeUnmark to Lst_ForEach

Revision 1.142 / (download) - annotate - [select for diffs], Thu Sep 24 07:34:35 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.141: +6 -11 lines
Diff to previous 1.141 (colored) to selected 1.12 (colored)

make(1): migrate MakeAddAllSrc to Lst_ForEach

Revision 1.141 / (download) - annotate - [select for diffs], Thu Sep 24 07:32:03 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.140: +16 -18 lines
Diff to previous 1.140 (colored) to selected 1.12 (colored)

make(1): move documentation for MakeAddAllSrc to its correct place

Revision 1.140 / (download) - annotate - [select for diffs], Thu Sep 24 07:11:29 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.139: +23 -23 lines
Diff to previous 1.139 (colored) to selected 1.12 (colored)

make(1): rename Lst_ForEach to Lst_ForEachUntil

Since the callback function returns a terminating condition, this is not
really a foreach loop.

Many of the calls to Lst_ForEachUntil don't make use of the terminating
condition, and several don't modify the list structurally, which means
they don't need this complicated implementation.

In a follow-up commit, Lst_ForEach will be added back with a much
simpler implementation that iterates over the list naively, without a
terminating condition and without taking the iteration state from
Lst_Open/Lst_Next/Lst_Close into account.  The migration to this simpler
implementation will be done step by step since each callback function
needs to be examined closely.

Revision 1.139 / (download) - annotate - [select for diffs], Thu Sep 24 06:45:59 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.138: +16 -21 lines
Diff to previous 1.138 (colored) to selected 1.12 (colored)

make(1): refactor add_wait_dep to not use Lst_ForEachFrom anymore

It was the last remaining use of that function outside of lst.c.

While here, clean up the code of add_wait_dep by removing unreachable
code (the GNode lists never contain NULL, only the GNode.commands lists
do that).

Revision 1.138 / (download) - annotate - [select for diffs], Tue Sep 22 20:19:46 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.137: +4 -3 lines
Diff to previous 1.137 (colored) to selected 1.12 (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.137 / (download) - annotate - [select for diffs], Tue Sep 22 04:05:41 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.136: +19 -20 lines
Diff to previous 1.136 (colored) to selected 1.12 (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.136 / (download) - annotate - [select for diffs], Sun Sep 13 15:15:51 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.135: +4 -14 lines
Diff to previous 1.135 (colored) to selected 1.12 (colored)

make(1): clean up RCSID blocks

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

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

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

Revision 1.135 / (download) - annotate - [select for diffs], Sat Sep 12 16:38:19 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.134: +6 -9 lines
Diff to previous 1.134 (colored) to selected 1.12 (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.134 / (download) - annotate - [select for diffs], Mon Sep 7 06:20:07 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.133: +3 -4 lines
Diff to previous 1.133 (colored) to selected 1.12 (colored)

make(1): remove redundant includes

Revision 1.133 / (download) - annotate - [select for diffs], Sun Aug 30 14:11:42 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.132: +7 -7 lines
Diff to previous 1.132 (colored) to selected 1.12 (colored)

make(1): rename GNode.iParents to implicitParents

The i alone was too ambiguous.  It could have meant ignore, implicit,
interactive, and probably many more.

Revision 1.132 / (download) - annotate - [select for diffs], Sun Aug 30 11:15:05 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.131: +7 -7 lines
Diff to previous 1.131 (colored) to selected 1.12 (colored)

make(1): rename Lst_Datum to LstNode_Datum

Revision 1.131 / (download) - annotate - [select for diffs], Sun Aug 30 11:12:06 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.130: +4 -4 lines
Diff to previous 1.130 (colored) to selected 1.12 (colored)

make(1): rename Lst_Memeber to Lst_FindDatum

The new name nicely aligns with Lst_Find and Lst_FindFrom.

Revision 1.130 / (download) - annotate - [select for diffs], Sat Aug 29 13:16:54 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.129: +4 -4 lines
Diff to previous 1.129 (colored) to selected 1.12 (colored)

make(1): trust that Var_Subst never returns NULL

It really never does, and it doesn't even report errors.  It just
returns the content of the buffer, up to the first parse error.

Revision 1.129 / (download) - annotate - [select for diffs], Fri Aug 28 04:48:57 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.128: +71 -71 lines
Diff to previous 1.128 (colored) to selected 1.12 (colored)

make(1): remove trailing 'S' from names of Lst functions

The migration from null-passing Lst functions to argument-checking Lst
functions is completed.

There were 2 surprises: The targets list may be NULL, and in Dir_AddDir,
the path may be NULL.  The latter case is especially surprising since
that function turns into an almost-nop in that case.  This is another
case where probably 2 independent functions have been squeezed into a
single function.  This may be improved in a follow-up commit.

All other lists were fine.  They were always defined and thus didn't
need much work.

Revision 1.128 / (download) - annotate - [select for diffs], Fri Aug 28 04:14:31 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.127: +6 -6 lines
Diff to previous 1.127 (colored) to selected 1.12 (colored)

make(1): migrate Lst_First to Lst_FirstS

Revision 1.127 / (download) - annotate - [select for diffs], Thu Aug 27 19:15:35 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.126: +9 -9 lines
Diff to previous 1.126 (colored) to selected 1.12 (colored)

make(1): migrate Lst_IsEmpty to Lst_IsEmptyS

Revision 1.126 / (download) - annotate - [select for diffs], Thu Aug 27 06:53:57 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.125: +23 -22 lines
Diff to previous 1.125 (colored) to selected 1.12 (colored)

make(1): migrate Lst_ForEach to Lst_ForEachS

Most lists are always valid.  Only the "targets" variable may be null in
some cases, probably.

Revision 1.125 / (download) - annotate - [select for diffs], Thu Aug 27 06:31:46 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.124: +4 -4 lines
Diff to previous 1.124 (colored) to selected 1.12 (colored)

make(1): migrate Lst_ForEachFrom to Lst_ForEachFromS

Revision 1.124 / (download) - annotate - [select for diffs], Wed Aug 26 22:55:46 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.123: +6 -6 lines
Diff to previous 1.123 (colored) to selected 1.12 (colored)

make(1): add stricter variants for remaining Lst functions

In most cases the Lst functions are only called when the arguments are
indeed valid.  It's not guaranteed though, therefore each function call
needs to be analyzed and converted individually.

While here, remove a few statements that were only useful when the Lst
functions handled circular lists.

Revision 1.123 / (download) - annotate - [select for diffs], Tue Aug 25 16:27:24 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.122: +22 -21 lines
Diff to previous 1.122 (colored) to selected 1.12 (colored)

make(1): distinguish enum flags and values in debugging mode

When printing an enum value in debugging mode, distinguish between
bitsets containing flags and ordinary enums that just contain different
values.

Make the macros in enum.h more uniform.  Provide a simple scheme for
defining the run-time type information of enums whose number of values
is a number with more than 2 bits set in the binary representation.
This case was not obvious before, and it was pure luck that the current
interesting enum types only had 3, 10 or 32 different values.

The type with the 32 different values actually only has 31 significant
bits since the enum constant OP_OPMASK is only used when querying the
enum, not for defining or describing the possible values.  For this
reason, it was unavoidable to refactor the rtti macros, to support even
this case.

Revision 1.122 / (download) - annotate - [select for diffs], Mon Aug 24 20:15:51 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.121: +56 -19 lines
Diff to previous 1.121 (colored) to selected 1.12 (colored)

make(1): in debug mode, print GNode details in symbols

A string like OP_DEPENDS|OP_OPTIONAL|OP_PRECIOUS is much easier to read
and understand than the bit pattern 00000089.

The implementation in enum.h looks really bloated and ugly, but using
this API is as simple and natural as possible.  That's the trade-off.

In enum.h, I thought about choosing the numbers in the macros such that
it is always possible to combine two of them in order to reach an
arbitrary number, because of the "part1, part2" in the ENUM__SPEC macro.
The powers of 2 are not these numbers, as 7 cannot be expressed as the
sum of two of them.  Neither are the fibonacci numbers since 12 cannot
be expressed as the sum of 2 fibonacci numbers.  I tried to find a
general pattern to generate these minimal 2-sum numbers, but failed.

Revision 1.121 / (download) - annotate - [select for diffs], Sat Aug 22 22:57:53 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.120: +4 -4 lines
Diff to previous 1.120 (colored) to selected 1.12 (colored)

make(1): replace Lst_Duplicate with Lst_CopyS

Lst_Duplicate would have passed through any null pointer, which was not
needed for make.  It was the last function that used Lst_AtEnd, which in
turn was the last function that used LstInsertAfter.  As a result, these
two functions have been removed.

Revision 1.120 / (download) - annotate - [select for diffs], Sat Aug 22 22:41:42 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.119: +7 -17 lines
Diff to previous 1.119 (colored) to selected 1.12 (colored)

make(1): make moving and copying lists simpler

Instead of the two-in-one Lst_Concat, having two separate functions is
easier to understand.  There is no need for a long API comment anymore
since the new functions have a single purpose that is accurately
described by their name.

The long comment inside Lst_Concat has been removed since it only
repeated the exact code, only in more words.

The comments in make.c about appending the cohorts had been wrong.  They
were not appended but prepended.  Once more, the function name expresses
everything that the comment said, making the comment redundant.  There
is no need to test whether the cohorts list is empty, doing nothing is
implied by the word All in Lst_PrependAllS.

Revision 1.119 / (download) - annotate - [select for diffs], Sat Aug 22 20:03:41 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.118: +116 -117 lines
Diff to previous 1.118 (colored) to selected 1.12 (colored)

make(1): use Lst_OpenS in make.c

The fields GNode.children, parents and iParents are guaranteed to be
valid lists.

Revision 1.118 / (download) - annotate - [select for diffs], Sat Aug 22 15:43:32 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.117: +4 -4 lines
Diff to previous 1.117 (colored) to selected 1.12 (colored)

make(1): require argument of Lst_Member to be non-null

Since the lists don't contain null pointers, it doesn't make sense to
search for a null pointer.  All calls but one already had obviously
non-null arguments.  The one remaining call using targ->suff has been
guarded for now.

The code for Lst_Member became much simpler than before.  Partly because
the old code had an extra condition for circular lists, which are not
used by make.

Revision 1.117 / (download) - annotate - [select for diffs], Sat Aug 22 15:17:09 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.116: +7 -7 lines
Diff to previous 1.116 (colored) to selected 1.12 (colored)

make(1): replace Lst_Datum with non-null guaranteeing Lst_DatumS

Revision 1.116 / (download) - annotate - [select for diffs], Sat Aug 22 14:54:48 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.115: +4 -4 lines
Diff to previous 1.115 (colored) to selected 1.12 (colored)

make(1): add strict argument checks for Lst_InsertBefore

As with the other modifying operations on lists, the callers already
made sure that the arguments are valid.

Revision 1.115 / (download) - annotate - [select for diffs], Sat Aug 22 14:39:12 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.114: +11 -11 lines
Diff to previous 1.114 (colored) to selected 1.12 (colored)

make(1): convert Lst_Enqueue and Lst_Dequeue to nonnull variants

Except for once instance in parse.c, the usage pattern for Lst_Dequeue
was to first test whether the list is empty.  This pattern allowed the
implementation of Lst_Dequeue to become simpler since the null check is
not needed anymore.

The calls to Lst_Enqueue never pass an invalid list or a null pointer,
therefore making them strict was trivial.

Revision 1.114 / (download) - annotate - [select for diffs], Sat Aug 22 13:44:17 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.113: +4 -4 lines
Diff to previous 1.113 (colored) to selected 1.12 (colored)

make(1): replace two instances of Lst_AtFront with Lst_Prepend

In these cases, the list is guaranteed to be valid, therefore no
assertion is expected.

For comparison, the Lst_AtFront in dir.c needs to be kept since the path
may be null there.

Revision 1.113 / (download) - annotate - [select for diffs], Sat Aug 22 13:28:20 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.112: +10 -10 lines
Diff to previous 1.112 (colored) to selected 1.12 (colored)

make(1): convert remaining Lst_AtEnd to the stricter Lst_Append

The general-purpose list library that is included in make allows to call
Lst_AtEnd for invalid lists, silently ignoring this programming error.
This is a flexibility that make doesn't need.

Another unneeded "feature" is that list items can theoretically be null
pointers.  This doesn't make sense as well and is therefore not needed
by make.

These programming errors are now caught early by assertions.

Revision 1.112 / (download) - annotate - [select for diffs], Sat Aug 22 13:06:39 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.111: +7 -17 lines
Diff to previous 1.111 (colored) to selected 1.12 (colored)

make(1): make Make_HandleUse simpler

Since the function names now contain the text from the comments, the
comments can be shortened a bit.

Revision 1.111 / (download) - annotate - [select for diffs], Sat Aug 22 11:57:18 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.110: +8 -7 lines
Diff to previous 1.110 (colored) to selected 1.12 (colored)

make(1): make .USEBEFORE handling simpler

There is no need to duplicate the list of .USEBEFORE commands, just to
destroy that list immediately.  Instead, it's simpler to just prepend
the commands from the .USEBEFORE node to the parent.

Revision 1.110 / (download) - annotate - [select for diffs], Sat Aug 22 11:35:00 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.109: +5 -5 lines
Diff to previous 1.109 (colored) to selected 1.12 (colored)

make(1): replace "(void)Lst_AtEnd" with stricter "Lst_AppendS"

This change ensures that there is actually something added to the list.
Lst_AtEnd had silently skipped the addition if the list was invalid
(null pointer), which was not intended in these cases.  The "(void)" is
assumed to mean "I know that this cannot fail", while it could also mean
"I don't care whether something actually happened".

Running "./build.sh -j6 tools" still succeeds after this change,
therefore chances are very low that this change breaks anything.  If
there is any change, it's an obvious assertion failure.  There is no
silent change in behavior though.

Revision 1.109 / (download) - annotate - [select for diffs], Sat Aug 22 08:40:03 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.108: +10 -23 lines
Diff to previous 1.108 (colored) to selected 1.12 (colored)

make(1): condense the comment for Make_HandleUse

The "side effects" were already mentioned in the main section.

Revision 1.108 / (download) - annotate - [select for diffs], Sat Aug 22 08:01:34 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.107: +12 -12 lines
Diff to previous 1.107 (colored) to selected 1.12 (colored)

make(1): remove form feeds in the code

Revision 1.107 / (download) - annotate - [select for diffs], Fri Aug 21 04:42:02 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.106: +8 -8 lines
Diff to previous 1.106 (colored) to selected 1.12 (colored)

make(1): use stricter list API for sequential access

In several places, it just doesn't make sense to have a null pointer
when a list is expected.

In the existing unit tests, the list passed to Lst_Open is always valid,
but that's not a guarantee for real-world usage.  Therefore, Lst_Open
has been left for now, and Lst_OpenS is only the preferred alternative
to it.

Revision 1.106 / (download) - annotate - [select for diffs], Fri Aug 21 04:09:12 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.105: +7 -7 lines
Diff to previous 1.105 (colored) to selected 1.12 (colored)

make(1): assert correct usage of the Lst_Open API

All calls to Lst_Next are properly protected by Lst_Open, so there is no
possible assertion failure here.

Revision 1.105 / (download) - annotate - [select for diffs], Fri Aug 21 03:36:03 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.104: +4 -4 lines
Diff to previous 1.104 (colored) to selected 1.12 (colored)

make(1): make list library code stricter

Up to now, the list library didn't distinguish between programming
mistakes (violations of invariants, illegal parameter values) and
actually interesting situations like "element not found in list".

The current code contains many branches for conditions that are neither
exercised by the unit tests nor by real-world usage.  There is no point
in keeping this unnecessary code.

The list functions will be migrated from their lenient variants to the
stricter variants in small parts, each function getting the S suffix
when it is made strict, to avoid any confusion about how strict a
particular function is.  When all functions have been migrated, they
will be renamed back to their original names.

While here, the comments of the functions are cleaned up since they
mention irrelevant implementation details in the API comments, as well
as "side effects" that are really main effects.

Revision 1.104 / (download) - annotate - [select for diffs], Fri Aug 21 02:20:47 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.103: +5 -5 lines
Diff to previous 1.103 (colored) to selected 1.12 (colored)

make(1): remove unused code for circular lists

The list library had probably been imported from a general-purpose
library that also supported circular lists.  These are not used by make
though.

After replacing Lst_Init(FALSE) with Lst_Init(), only a single call to
Lst_Init remained with a non-constant argument, and that was in
Lst_Concat, which was to be expected.

Revision 1.103 / (download) - annotate - [select for diffs], Sat Aug 1 09:55:00 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.102: +8 -8 lines
Diff to previous 1.102 (colored) to selected 1.12 (colored)

make(1): avoid calls to free(3) in the common case of a NULL pointer

Revision 1.102 / (download) - annotate - [select for diffs], Sat Aug 1 09:25:36 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.101: +6 -6 lines
Diff to previous 1.101 (colored) to selected 1.12 (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.101 / (download) - annotate - [select for diffs], Tue Jul 28 16:42:22 2020 UTC (3 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.100: +4 -4 lines
Diff to previous 1.100 (colored) to selected 1.12 (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.100 / (download) - annotate - [select for diffs], Sun Jul 19 12:26:17 2020 UTC (3 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.99: +4 -4 lines
Diff to previous 1.99 (colored) to selected 1.12 (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.99 / (download) - annotate - [select for diffs], Fri Jul 3 08:13:23 2020 UTC (3 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.98: +8 -8 lines
Diff to previous 1.98 (colored) to selected 1.12 (colored)

make(1): remove trailing whitespace

Revision 1.98 / (download) - annotate - [select for diffs], Fri Jul 3 08:02:55 2020 UTC (3 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.97: +15 -15 lines
Diff to previous 1.97 (colored) to selected 1.12 (colored)

make(1): remove redundant parentheses around return values

Revision 1.97 / (download) - annotate - [select for diffs], Thu Jul 2 15:47:38 2020 UTC (3 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.96: +11 -11 lines
Diff to previous 1.96 (colored) to selected 1.12 (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.95.2.1 / (download) - annotate - [select for diffs], Sat Jan 7 08:56:58 2017 UTC (7 years, 2 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.95: +4 -4 lines
Diff to previous 1.95 (colored) next main 1.96 (colored) to selected 1.12 (colored)

Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.96 / (download) - annotate - [select for diffs], Thu Nov 10 23:41:58 2016 UTC (7 years, 4 months ago) by sjg
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-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, is-mlppp-base, is-mlppp, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Changes since 1.95: +4 -4 lines
Diff to previous 1.95 (colored) to selected 1.12 (colored)

Report node name rather than (null) when modified before src

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

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

Revision 1.94 / (download) - annotate - [select for diffs], Sun Jan 17 17:45:21 2016 UTC (8 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.93: +9 -15 lines
Diff to previous 1.93 (colored) to selected 1.12 (colored)

remove free NULL checks (Tilman Sauerbeck)

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

Preserve $$ in := assignments..

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

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

Revision 1.92 / (download) - annotate - [select for diffs], Sun Oct 11 04:51:24 2015 UTC (8 years, 5 months ago) by sjg
Branch: MAIN
Changes since 1.91: +4 -4 lines
Diff to previous 1.91 (colored) to selected 1.12 (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.91 / (download) - annotate - [select for diffs], Sat Oct 18 08:33:30 2014 UTC (9 years, 5 months ago) by snj
Branch: MAIN
Changes since 1.90: +4 -4 lines
Diff to previous 1.90 (colored) to selected 1.12 (colored)

src is too big these days to tolerate superfluous apostrophes.  It's
"its", people!

Revision 1.90 / (download) - annotate - [select for diffs], Sun Sep 7 20:55:34 2014 UTC (9 years, 6 months ago) by joerg
Branch: MAIN
Changes since 1.89: +18 -80 lines
Diff to previous 1.89 (colored) to selected 1.12 (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.89 / (download) - annotate - [select for diffs], Sat Aug 23 15:05:40 2014 UTC (9 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.88: +83 -21 lines
Diff to previous 1.88 (colored) to selected 1.12 (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.84.2.4 / (download) - annotate - [select for diffs], Wed Jan 16 05:34:06 2013 UTC (11 years, 2 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.84.2.3: +5 -5 lines
Diff to previous 1.84.2.3 (colored) to branchpoint 1.84 (colored) next main 1.85 (colored) to selected 1.12 (colored)

sync with (a bit old) head

Revision 1.87.2.1 / (download) - annotate - [select for diffs], Tue Nov 20 03:02:57 2012 UTC (11 years, 4 months ago) by tls
Branch: tls-maxphys
Changes since 1.87: +5 -5 lines
Diff to previous 1.87 (colored) next main 1.88 (colored) to selected 1.12 (colored)

Resync to 2012-11-19 00:00:00 UTC

Revision 1.88 / (download) - annotate - [select for diffs], Fri Nov 9 18:53:05 2012 UTC (11 years, 4 months ago) by sjg
Branch: MAIN
CVS Tags: yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, tls-maxphys-base, 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.87: +5 -5 lines
Diff to previous 1.87 (colored) to selected 1.12 (colored)

Do not stop looking for children, just because one has a .ORDER dependency.

Revision 1.84.2.3 / (download) - annotate - [select for diffs], Tue Oct 30 19:00:22 2012 UTC (11 years, 4 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.84.2.2: +6 -6 lines
Diff to previous 1.84.2.2 (colored) to branchpoint 1.84 (colored) to selected 1.12 (colored)

sync with head

Revision 1.87 / (download) - annotate - [select for diffs], Tue Jun 12 19:21:51 2012 UTC (11 years, 9 months ago) by joerg
Branch: MAIN
CVS Tags: yamt-pagecache-base6
Branch point for: tls-maxphys
Changes since 1.86: +6 -6 lines
Diff to previous 1.86 (colored) to selected 1.12 (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.84.2.2 / (download) - annotate - [select for diffs], Wed May 23 10:08:26 2012 UTC (11 years, 10 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.84.2.1: +4 -4 lines
Diff to previous 1.84.2.1 (colored) to branchpoint 1.84 (colored) to selected 1.12 (colored)

sync with head.

Revision 1.86 / (download) - annotate - [select for diffs], Thu May 10 19:53:26 2012 UTC (11 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base5
Changes since 1.85: +4 -4 lines
Diff to previous 1.85 (colored) to selected 1.12 (colored)

Don't use the cache when building nodes that might have changed since the
last exec.

Revision 1.84.2.1 / (download) - annotate - [select for diffs], Tue Apr 17 00:09:35 2012 UTC (11 years, 11 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.84: +7 -7 lines
Diff to previous 1.84 (colored) to selected 1.12 (colored)

sync with head

Revision 1.85 / (download) - annotate - [select for diffs], Sat Apr 7 18:29:08 2012 UTC (11 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base4
Changes since 1.84: +7 -7 lines
Diff to previous 1.84 (colored) to selected 1.12 (colored)

Remove recheck hackery that caused extra stats, and explicitly ask for
recheck when needed. Before it used to be the case that we could only
use the cached entry once. Once the cached entry was used, we removed
it from the cache. Now it is kept forever.

Revision 1.84 / (download) - annotate - [select for diffs], Fri Sep 16 15:38:04 2011 UTC (12 years, 6 months ago) by joerg
Branch: MAIN
CVS Tags: 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.83: +4 -4 lines
Diff to previous 1.83 (colored) to selected 1.12 (colored)

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

Revision 1.83 / (download) - annotate - [select for diffs], Thu Nov 25 21:31:09 2010 UTC (13 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Changes since 1.82: +20 -19 lines
Diff to previous 1.82 (colored) to selected 1.12 (colored)

Instead of keeping around the mtime of the youngest child, keep a pointer
to it, so that we can print it when we do the out of date determination.

Revision 1.82 / (download) - annotate - [select for diffs], Mon Sep 13 15:36:57 2010 UTC (13 years, 6 months ago) by sjg
Branch: MAIN
Changes since 1.81: +9 -3 lines
Diff to previous 1.81 (colored) to selected 1.12 (colored)

Add meta.c which implements "meta" mode for make.
In this mode, a .meta file is created for each target, capturing
the expanded commands used, any command output, and if filemon(9)
is available, a record of system calls which are of interest.
Not enabled unless USE_META=yes is set when building make.
Also, if FILEMON_H exists, meta.c will be compiled to use filemon(9).

Revision 1.81 / (download) - annotate - [select for diffs], Tue Jul 6 03:56:59 2010 UTC (13 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.80: +0 -1 lines
Diff to previous 1.80 (colored) to selected 1.12 (colored)

Revert 1.80, which somehow manages to produce different (wrong)
behavior with -jN. Unfixes PR 43534. Need a different approach...

Revision 1.80 / (download) - annotate - [select for diffs], Wed Jun 30 00:25:04 2010 UTC (13 years, 9 months ago) by dholland
Branch: MAIN
Changes since 1.79: +4 -3 lines
Diff to previous 1.79 (colored) to selected 1.12 (colored)

Set .PREFIX early the same place .TARGET is set. This makes sure it's
defined even in cases where the suffix search logic is skipped, such
as .PHONY targets, and fixes PR 43534.

Note: because .PHONY targets do not get suffix searching, .PREFIX will
not have any suffixes removed. This seems vaguely logical, although
it's not the only reasonable interpretation.

We may also want to reconsider whether suffix rules are skipped for
phony targets, too. That behavior is somewhat counterintuitive.

Revision 1.79 / (download) - annotate - [select for diffs], Wed Apr 7 00:11:27 2010 UTC (13 years, 11 months ago) by sjg
Branch: MAIN
Changes since 1.78: +7 -3 lines
Diff to previous 1.78 (colored) to selected 1.12 (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.78 / (download) - annotate - [select for diffs], Fri Jan 23 21:26:30 2009 UTC (15 years, 2 months ago) by dsl
Branch: MAIN
CVS Tags: matt-premerge-20091211, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend
Changes since 1.77: +25 -25 lines
Diff to previous 1.77 (colored) to selected 1.12 (colored)

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

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

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

Revision 1.76 / (download) - annotate - [select for diffs], Fri Feb 15 21:29:50 2008 UTC (16 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-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, 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, mjf-devfs2-base, mjf-devfs2, 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, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-nbase, hpcarm-cleanup-base
Changes since 1.75: +0 -2 lines
Diff to previous 1.75 (colored) to selected 1.12 (colored)

back all changes out until I fix it properly.

Revision 1.75 / (download) - annotate - [select for diffs], Thu Feb 14 22:11:20 2008 UTC (16 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: christos-broken
Changes since 1.74: +5 -3 lines
Diff to previous 1.74 (colored) to selected 1.12 (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.68.4.1 / (download) - annotate - [select for diffs], Mon Sep 3 07:05:30 2007 UTC (16 years, 6 months ago) by wrstuden
Branch: wrstuden-fixsa
Changes since 1.68: +43 -28 lines
Diff to previous 1.68 (colored) next main 1.69 (colored) to selected 1.12 (colored)

Sync w/ NetBSD-4-RC_1

Revision 1.68.2.1 / (download) - annotate - [select for diffs], Tue Jun 5 20:53:29 2007 UTC (16 years, 9 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.68: +43 -28 lines
Diff to previous 1.68 (colored) next main 1.69 (colored) to selected 1.12 (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.74 / (download) - annotate - [select for diffs], Mon Jan 1 21:42:42 2007 UTC (17 years, 2 months ago) by dsl
Branch: MAIN
CVS Tags: matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-base, matt-armv6, hpcarm-cleanup, cube-autoconf-base, cube-autoconf
Changes since 1.73: +9 -6 lines
Diff to previous 1.73 (colored) to selected 1.12 (colored)

Request the 'verbose' node print when aborting and scheduling nodes.

Revision 1.73 / (download) - annotate - [select for diffs], Mon Jan 1 21:39:58 2007 UTC (17 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.72: +6 -6 lines
Diff to previous 1.72 (colored) to selected 1.12 (colored)

Add the other half of the fix to stop stuff that depends on .WAIT nodes
being always rebuilt.

Revision 1.72 / (download) - annotate - [select for diffs], Mon Jan 1 21:35:40 2007 UTC (17 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.71: +4 -4 lines
Diff to previous 1.71 (colored) to selected 1.12 (colored)

Don't force things that have dependencies against .WAIT nodes to be rebuilt.
This is what causes all of ksh to be built every time through.

Revision 1.71 / (download) - annotate - [select for diffs], Thu Dec 21 20:05:37 2006 UTC (17 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.70: +5 -4 lines
Diff to previous 1.70 (colored) to selected 1.12 (colored)

Fix breakage of previous commit.

Revision 1.70 / (download) - annotate - [select for diffs], Wed Dec 20 20:46:35 2006 UTC (17 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.69: +31 -20 lines
Diff to previous 1.69 (colored) to selected 1.12 (colored)

Fix detection and reporting of dependency loops in parallel makes.
make's unit_tests should now run again.

Revision 1.69 / (download) - annotate - [select for diffs], Mon Dec 18 15:06:16 2006 UTC (17 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.68: +4 -4 lines
Diff to previous 1.68 (colored) to selected 1.12 (colored)

From Anon Ymous:
Removed two "(void)&" constructs as there is no setjmp() or vfork() insight.
Flagged a few parameters __unused so this will compile with -Wextra now.

Revision 1.68 / (download) - annotate - [select for diffs], Fri Nov 17 22:07:39 2006 UTC (17 years, 4 months ago) by dsl
Branch: MAIN
CVS Tags: netbsd-4-base
Branch point for: wrstuden-fixsa, netbsd-4
Changes since 1.67: +454 -165 lines
Diff to previous 1.67 (colored) to selected 1.12 (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.67 / (download) - annotate - [select for diffs], Fri Oct 27 21:00:19 2006 UTC (17 years, 5 months ago) by dsl
Branch: MAIN
Changes since 1.66: +19 -19 lines
Diff to previous 1.66 (colored) to selected 1.12 (colored)

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

Revision 1.66 / (download) - annotate - [select for diffs], Sun Oct 15 08:38:22 2006 UTC (17 years, 5 months ago) by dsl
Branch: MAIN
Changes since 1.65: +25 -25 lines
Diff to previous 1.65 (colored) to selected 1.12 (colored)

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

Revision 1.65 / (download) - annotate - [select for diffs], Wed Oct 11 07:01:44 2006 UTC (17 years, 5 months ago) by dsl
Branch: MAIN
Changes since 1.64: +3 -4 lines
Diff to previous 1.64 (colored) to selected 1.12 (colored)

There is no need to resize the pollfd array, it can only ever have 2+maxJobs
entries, so allocate at startup.
Use an 'int jobPipe[2]' within the job structure, and create pipes directly
into it.  Common up the code that creates all the pipes - making them all
non-block on the read side in the process.
Call Job_CatchChildren() directly from Job_CatchOutput() so that it only
gets called when a child actually exits.
NB: Something causes a 'pregnant pause' if (for example) you call 'nbmake obj'
in src/tools.  Introduced between netbsd 3 and 4.

Revision 1.64 / (download) - annotate - [select for diffs], Mon Oct 9 14:36:41 2006 UTC (17 years, 5 months ago) by dsl
Branch: MAIN
Changes since 1.63: +4 -4 lines
Diff to previous 1.63 (colored) to selected 1.12 (colored)

Rip out the code for the undocumented -P (don't use pipes for command
output) option.  I'm sure it is baggage from the past.

Revision 1.63 / (download) - annotate - [select for diffs], Sat Sep 23 20:51:28 2006 UTC (17 years, 6 months ago) by dsl
Branch: MAIN
Changes since 1.62: +4 -4 lines
Diff to previous 1.62 (colored) to selected 1.12 (colored)

Complete revamp of the way make handles job control signals.
- Send each type of signal to its own handler.
- Only call JobFinish when a process exits, in particular don't 'fake up'
  'exitstatus' for jobs being continued, nor call it for suspends.
- When a job is stopped, use an entire variable to remember the fact, so
  we know we need to send a SIGCONT.  Don't change any other state.
- In order to report '*** [job3] Suspended' before we suspend ourselves we
  have to call waitpid() from the signal handler - where we don't want to
  process job termination events. Save the exit status and process later.
The code now handles:
- jobs that suspend themselves
- jobs exiting while suspended
- jobs that don't actually suspend at all
Hoewever it still does printfs() from the signal handler, and I haven't yet
stopped it thrashing the signal mask.

Revision 1.62 / (download) - annotate - [select for diffs], Fri Mar 31 21:05:34 2006 UTC (18 years ago) by dsl
Branch: MAIN
CVS Tags: chap-midi-nbase, chap-midi-base, chap-midi, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.61: +4 -4 lines
Diff to previous 1.61 (colored) to selected 1.12 (colored)

There is no need to count jobs and job tokens.
If we don't create the job pipe, use the '-j n' option to limit the number
of tokens we will remove from the pipe.

Revision 1.61 / (download) - annotate - [select for diffs], Sat Feb 11 20:59:49 2006 UTC (18 years, 1 month ago) by dsl
Branch: MAIN
Changes since 1.60: +7 -3 lines
Diff to previous 1.60 (colored) to selected 1.12 (colored)

Add some more debug prints.

Revision 1.60 / (download) - annotate - [select for diffs], Sat Feb 11 18:37:36 2006 UTC (18 years, 1 month ago) by dsl
Branch: MAIN
Changes since 1.59: +12 -9 lines
Diff to previous 1.59 (colored) to selected 1.12 (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.59 / (download) - annotate - [select for diffs], Wed Jan 4 21:16:53 2006 UTC (18 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.58: +11 -5 lines
Diff to previous 1.58 (colored) to selected 1.12 (colored)

For parallel makes, don't recycle the job token when we decide not to
run anything.

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

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

Revision 1.57 / (download) - annotate - [select for diffs], Mon Jul 25 22:55:58 2005 UTC (18 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.56: +26 -26 lines
Diff to previous 1.56 (colored) to selected 1.12 (colored)

Whitespace KNF cleanup from Max Okumoto

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

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

Revision 1.55 / (download) - annotate - [select for diffs], Thu Jul 1 20:38:09 2004 UTC (19 years, 9 months ago) by jmc
Branch: MAIN
Changes since 1.54: +4 -8 lines
Diff to previous 1.54 (colored) to selected 1.12 (colored)

Change to use __unused instead and provide a compat definition in make.h if
not already defined from cdefs.h

Revision 1.54 / (download) - annotate - [select for diffs], Thu Jul 1 04:39:31 2004 UTC (19 years, 9 months ago) by jmc
Branch: MAIN
Changes since 1.53: +7 -3 lines
Diff to previous 1.53 (colored) to selected 1.12 (colored)

Add some checks for gcc around a few function declarations and note the
unused variables. Also fix a few other warnings that PR#22118 shows when
trying to compile bmake on non-NetBSD hosts

Revision 1.52.2.1 / (download) - annotate - [select for diffs], Mon May 10 15:41:41 2004 UTC (19 years, 10 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.52: +4 -4 lines
Diff to previous 1.52 (colored) next main 1.53 (colored) to selected 1.12 (colored)

Pull up revision 1.53 (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.53 / (download) - annotate - [select for diffs], Fri May 7 00:04:39 2004 UTC (19 years, 10 months ago) by ross
Branch: MAIN
Changes since 1.52: +4 -4 lines
Diff to previous 1.52 (colored) to selected 1.12 (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.52 / (download) - annotate - [select for diffs], Fri Nov 14 22:32:44 2003 UTC (20 years, 4 months ago) by dsl
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.51: +12 -11 lines
Diff to previous 1.51 (colored) to selected 1.12 (colored)

Don't create targets if dependant files marked .OPTIONAL are missing.

Revision 1.51 / (download) - annotate - [select for diffs], Thu Aug 7 11:14:54 2003 UTC (20 years, 7 months ago) by agc
Branch: MAIN
Changes since 1.50: +33 -3 lines
Diff to previous 1.50 (colored) to selected 1.12 (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.50 / (download) - annotate - [select for diffs], Sat Jun 15 18:24:57 2002 UTC (21 years, 9 months ago) by wiz
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.49: +78 -54 lines
Diff to previous 1.49 (colored) to selected 1.12 (colored)

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

Revision 1.49 / (download) - annotate - [select for diffs], Thu Mar 21 11:42:21 2002 UTC (22 years 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.48: +4 -5 lines
Diff to previous 1.48 (colored) to selected 1.12 (colored)

Darn.. remove test code from previous commit.

Revision 1.48 / (download) - annotate - [select for diffs], Thu Mar 21 11:34:17 2002 UTC (22 years ago) by pk
Branch: MAIN
Changes since 1.47: +11 -7 lines
Diff to previous 1.47 (colored) to selected 1.12 (colored)

When looking at predecessor/successor dependencies, we need to consult a
cohort's centurion as well.

Revision 1.47 / (download) - annotate - [select for diffs], Wed Mar 20 18:10:31 2002 UTC (22 years ago) by pk
Branch: MAIN
Changes since 1.46: +48 -22 lines
Diff to previous 1.46 (colored) to selected 1.12 (colored)

Xref: parse.c, rev 1.46; make.c, rev 1.23

In these revisions `::' dependency handling was simplified by not linking
the cohort nodes into the dependency graph. This broke dependency checking
on all but the first instance of a `::' target since all of the cohort nodes
now just form a collection of disconnected dependency graphs.

Fix this by keeping a back-reference in each cohort to its leader (the
first instance of a :: node with the same name) and a count of the number
of cohorts that need to be made before dependent nodes are scheduled.

Classically, we'd need six centurions for cohort, but in this case one
suffices...

Revision 1.46 / (download) - annotate - [select for diffs], Tue Mar 12 23:52:35 2002 UTC (22 years ago) by pk
Branch: MAIN
Changes since 1.45: +5 -4 lines
Diff to previous 1.45 (colored) to selected 1.12 (colored)

MakeAddAllSrc(): check for empty .ALLSRC variable before using its value.

Revision 1.45 / (download) - annotate - [select for diffs], Fri Mar 8 23:22:38 2002 UTC (22 years ago) by pk
Branch: MAIN
Changes since 1.44: +15 -6 lines
Diff to previous 1.44 (colored) to selected 1.12 (colored)

Propagate a .JOIN node's .ALLSRC contents to the parent's .ALLSRC.

Revision 1.44 / (download) - annotate - [select for diffs], Mon Feb 18 12:13:59 2002 UTC (22 years, 1 month ago) by pk
Branch: MAIN
Changes since 1.43: +84 -60 lines
Diff to previous 1.43 (colored) to selected 1.12 (colored)

Make{_}HandleUse(): update comments and layout, re-arrange to avoid some
code duplication.

Revision 1.43 / (download) - annotate - [select for diffs], Mon Feb 18 00:33:40 2002 UTC (22 years, 1 month ago) by pk
Branch: MAIN
Changes since 1.42: +22 -22 lines
Diff to previous 1.42 (colored) to selected 1.12 (colored)

The use of OP_MARK in the MakeHandleUse() list callback function prevents
the removal of .USE nodes from a node's children list in case a given .USE
nodes appears multiple times on that list, preventing the target from ever
making it on the `to be made' queue.

Since the suffix rule processing code deals itself with removing the
transformation nodes from the parents to which it applies them, arrange
for doing the same for .USE nodes in MakeHandleUse() instead of in
Make_HandleUse(), and still use the OP_MARK stuff to avoid duplication
of commands.

Also, since Make_HandleUse() is not a list callback function and its
return value is no longer used, make its return type void.

Revision 1.42 / (download) - annotate - [select for diffs], Thu Feb 7 16:48:23 2002 UTC (22 years, 1 month ago) by pk
Branch: MAIN
Changes since 1.41: +24 -11 lines
Diff to previous 1.41 (colored) to selected 1.12 (colored)

When making a node which is the source of both a .MADE target and a
normal target (the latter dependency being the reason why it's made),
the .MADE parent should not be put on the `toBeMade' list again (in
Make_Update()) since it was already put on it in Make_ExpandUse().
Doing so would cause the rules for the .MADE target to be executed
(at least) twice, and also mess up the unmade children count of _its_
parent, resulting in spurious graph cylce detection.

To achieve this, make sure the unmade children count of the .MADE target
is set to zero before enqueueing it on the `toBeMade' list in
Make_ExpandUse(). Then, in Make_Update(), check if the parent has the
.MADE attribute before diddling with the queue.

For the same reason the status of a node must not be set to UPTODATE
unconditionally in compat mode, since that will prevent the node from
being built even if it is the source of a normal target. Instead,
check both its state and the type of the parent to decide whether to
continue on behalf of the current parent.

Revision 1.41 / (download) - annotate - [select for diffs], Sun Feb 3 19:58:15 2002 UTC (22 years, 1 month ago) by pk
Branch: MAIN
Changes since 1.40: +5 -4 lines
Diff to previous 1.40 (colored) to selected 1.12 (colored)

Don't bother to apply suffix rules to find sources for a target marked
as .MADE.

Revision 1.40 / (download) - annotate - [select for diffs], Sun Jan 27 01:50:55 2002 UTC (22 years, 2 months ago) by reinoud
Branch: MAIN
Changes since 1.39: +3 -4 lines
Diff to previous 1.39 (colored) to selected 1.12 (colored)

Fix major bug in make(1) ... due to shadowing of the dotLast path used for
the .DOTLAST primitive by a boolean variable with the same name, this whole
mechanism was broken ... it doesn't save much stat calls but it was wrong.

Thanks to Jason Thorpe for the other shadow-variable fixing patches he
made.

Revision 1.39 / (download) - annotate - [select for diffs], Tue Jul 3 18:08:51 2001 UTC (22 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.38: +28 -17 lines
Diff to previous 1.38 (colored) to selected 1.12 (colored)

add .USEBEFORE Attribute

Revision 1.38 / (download) - annotate - [select for diffs], Tue Jun 12 23:36:17 2001 UTC (22 years, 9 months ago) by sjg
Branch: MAIN
Changes since 1.37: +11 -11 lines
Diff to previous 1.37 (colored) to selected 1.12 (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.37 / (download) - annotate - [select for diffs], Mon Jun 11 01:50:58 2001 UTC (22 years, 9 months ago) by wiz
Branch: MAIN
Changes since 1.36: +4 -4 lines
Diff to previous 1.36 (colored) to selected 1.12 (colored)

Fix various misspellings of compatible/compatibility.

Revision 1.36 / (download) - annotate - [select for diffs], Mon Mar 5 16:20:33 2001 UTC (23 years ago) by sjg
Branch: MAIN
Changes since 1.35: +4 -4 lines
Diff to previous 1.35 (colored) to selected 1.12 (colored)

Test for non-existant LIB was incorrect (using cmtime cf. mtime).

Revision 1.35 / (download) - annotate - [select for diffs], Mon Jan 15 22:17:09 2001 UTC (23 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.34: +5 -4 lines
Diff to previous 1.34 (colored) to selected 1.12 (colored)

.PHONY gnode's don't get a PREFIX, so don't try to set the parent's prefixes
on a parallel make.

Revision 1.34 / (download) - annotate - [select for diffs], Mon Jan 1 15:47:37 2001 UTC (23 years, 3 months ago) by sommerfeld
Branch: MAIN
Changes since 1.33: +4 -4 lines
Diff to previous 1.33 (colored) to selected 1.12 (colored)

Delete forceSerial; just use compatMake for that.
Add -N flag to *really* not execute any commands (useful when using
the -d flags to debug usr/src/Makefile)
Document -N
Update documentation of -n to mention that it still executes commands
for targets marked .MAKE so that the -N/-n distinction is clear.

Revision 1.33 / (download) - annotate - [select for diffs], Sat Dec 30 15:58:34 2000 UTC (23 years, 3 months ago) by sommerfeld
Branch: MAIN
Changes since 1.32: +4 -5 lines
Diff to previous 1.32 (colored) to selected 1.12 (colored)

Fix token accounting for .BEGIN/.END jobs

Revision 1.32 / (download) - annotate - [select for diffs], Sat Dec 30 02:05:21 2000 UTC (23 years, 3 months ago) by sommerfeld
Branch: MAIN
Changes since 1.31: +11 -5 lines
Diff to previous 1.31 (colored) to selected 1.12 (colored)

Add a token-passing scheme to allow a recursive make to successfully
use -j; all make's in a recursive build cooperate to limit the total
number of jobs, using a token-passing scheme.

The current token passing algorithm is similar to the one implemented
by gmake; there is a single pipe which is inherited through the entire
process hierarchy; tokens are obtained by reading a byte from the
"read end" of the pipe, and are returned by writing them to the "write
end".  This exact algorithm is likely to change in the future.

Implementation details:
 - Use the new trace facility to allow measurement of the
effectiveness of different token-passing schemes
 - Get a token in MakeStartJobs(), return it in Make_Update()
 - Eliminate Job_Full() and the jobFull global since they are
redundant with token system.
 - Add an "internal" -J option (to pass the token pipe fd's down to
submakes) and a -T option for tracing.
 - Change how compatMake is forced so that -j means something when
inherited by submakes.
 - When waiting for a token, poll the token-passing pipe as well as
the output pipes of existing jobs.

Revision 1.27.2.1 / (download) - annotate - [select for diffs], Fri Jun 23 16:39:43 2000 UTC (23 years, 9 months ago) by minoura
Branch: minoura-xpg4dl
Changes since 1.27: +37 -12 lines
Diff to previous 1.27 (colored) next main 1.28 (colored) to selected 1.12 (colored)

Sync w/ netbsd-1-5-base.

Revision 1.31 / (download) - annotate - [select for diffs], Sun Jun 11 07:39:52 2000 UTC (23 years, 9 months ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5
Changes since 1.30: +37 -12 lines
Diff to previous 1.30 (colored) to selected 1.12 (colored)

Readd optimization last night.  Problems earlier were partially due to the
arguments names on one function being swapped (by a previous author).

Do not do any duplicate suppression when a source list is created.  Instead:
* OP_MADE protects against trying to make the source multiple times.
* A new OP_MARK flag is introduced to suppress duplicates while expanding
  the .ALLSRC variable and .USE targets.
This turns the O(n^2) insertion into O(n) in most cases.

This is tested with a `make build' and some special test cases.

Revision 1.30 / (download) - annotate - [select for diffs], Sat Jun 10 22:28:33 2000 UTC (23 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.29: +12 -35 lines
Diff to previous 1.29 (colored) to selected 1.12 (colored)

Back out last night's optimization for now.

Revision 1.29 / (download) - annotate - [select for diffs], Sat Jun 10 22:24:21 2000 UTC (23 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.28: +13 -11 lines
Diff to previous 1.28 (colored) to selected 1.12 (colored)

Don't use OP_MARK when attaching suffix transformations.

Revision 1.28 / (download) - annotate - [select for diffs], Sat Jun 10 21:44:08 2000 UTC (23 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.27: +29 -8 lines
Diff to previous 1.27 (colored) to selected 1.12 (colored)

Introduce an OP_MARK bit, and use it to suppress duplicates during .ALLSRC
and .USE expansion.  Also, remove some more Lst_Member() checks that are now
redundant.

Revision 1.27 / (download) - annotate - [select for diffs], Tue Feb 29 22:00:02 2000 UTC (24 years, 1 month ago) by sjg
Branch: MAIN
CVS Tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Changes since 1.26: +5 -5 lines
Diff to previous 1.26 (colored) to selected 1.12 (colored)

Fixed the oodate test to include the check of gn->cmtime == 0 without
breaking the original intent.

PR: 9503

Revision 1.26 / (download) - annotate - [select for diffs], Tue Feb 15 04:41:45 2000 UTC (24 years, 1 month ago) by sjg
Branch: MAIN
Changes since 1.25: +6 -6 lines
Diff to previous 1.25 (colored) to selected 1.12 (colored)

Non-existent libs are always out of date.
This was not handled correctly on ELF where libs do not have T.O.C.

PR: 9393
Reviewed by: christos

Revision 1.25 / (download) - annotate - [select for diffs], Mon Jan 31 13:21:20 2000 UTC (24 years, 2 months ago) by sjg
Branch: MAIN
Changes since 1.24: +5 -4 lines
Diff to previous 1.24 (colored) to selected 1.12 (colored)

You cannot meaningfully test if a non-existent file has a correct
archive header, so don't try - just believe gn->type & OP_LIB.

Revision 1.24 / (download) - annotate - [select for diffs], Thu Sep 16 00:54:14 1999 UTC (24 years, 6 months ago) by mycroft
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, comdex-fall-1999-base, comdex-fall-1999
Changes since 1.23: +4 -4 lines
Diff to previous 1.23 (colored) to selected 1.12 (colored)

Some minor cleanup of :: tests.

Revision 1.23 / (download) - annotate - [select for diffs], Wed Sep 15 10:47:38 1999 UTC (24 years, 6 months ago) by mycroft
Branch: MAIN
Changes since 1.22: +10 -3 lines
Diff to previous 1.22 (colored) to selected 1.12 (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.22 / (download) - annotate - [select for diffs], Wed Nov 11 19:37:06 1998 UTC (25 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, netbsd-1-4
Changes since 1.21: +123 -89 lines
Diff to previous 1.21 (colored) to selected 1.12 (colored)

This patch fixes the problem introduced in the previous commit where
parents would be get remade, even if children were not really updated
by the commands executed for them. It also makes all the children have
the real modification time set if possible, so it should fix some other
timing weirdnesses...

- collapse childMade and make fields into flags and convert them to bits
  CHILDMADE and REMAKE
- introduce FORCE flag that gets set in all the parents of a child that
  has no sources and does not exist.
- set oodate if the FORCE flag is set, and not if CHILDMADE
- centralize the RECHECK into Make_Recheck() and use this in make.c and compat.c
- use Make_TimeStamp for all child -> parent timestamp propagations

Revision 1.21 / (download) - annotate - [select for diffs], Wed Nov 11 11:25:43 1998 UTC (25 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.20: +11 -8 lines
Diff to previous 1.20 (colored) to selected 1.12 (colored)

PR/6426: Jim Bernard: make sometimes does not make directories on top of
	a union mount.

	eg.
	src: FORCE

	FORCE is a fake target that does not have sources. When FORCE is
	considered made it gets updated with the current timestamp. If the
	directory happens to have the same timestamp too, then it will not
	be made because it is considered to be up-to-date with respect to
	the child. This can happen because the time resolution is only in
	seconds. It is more likely to happen on a union filesystem where
	the timestamps take longer to update.

	The fix is to consider the parent unmade when children have been
	updated.

Revision 1.19.2.1 / (download) - annotate - [select for diffs], Fri May 8 06:12:07 1998 UTC (25 years, 10 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.19: +4 -4 lines
Diff to previous 1.19 (colored) next main 1.20 (colored) to selected 1.12 (colored)

Sync with trunk, per request of christos.

Revision 1.20 / (download) - annotate - [select for diffs], Thu Mar 26 19:20:37 1998 UTC (26 years ago) by christos
Branch: MAIN
Changes since 1.19: +4 -4 lines
Diff to previous 1.19 (colored) to selected 1.12 (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.19 / (download) - annotate - [select for diffs], Sun Sep 28 03:31:07 1997 UTC (26 years, 6 months ago) by lukem
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.18: +6 -2 lines
Diff to previous 1.18 (colored) to selected 1.12 (colored)

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

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

Add WARNS=1
RCSID police

Revision 1.17 / (download) - annotate - [select for diffs], Sat Jun 7 16:41:09 1997 UTC (26 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.16: +20 -3 lines
Diff to previous 1.16 (colored) to selected 1.12 (colored)

Deal with archive.a(member.o) nodes when expanding .USE dependencies or
adding children to .OODATE.

Revision 1.16 / (download) - annotate - [select for diffs], Tue May 6 23:51:31 1997 UTC (26 years, 10 months ago) by mycroft
Branch: MAIN
Changes since 1.15: +4 -3 lines
Diff to previous 1.15 (colored) to selected 1.12 (colored)

Make sure `-n' is actually disabled for targets with the .MAKE attribute.

Revision 1.15 / (download) - annotate - [select for diffs], Fri May 2 14:24:27 1997 UTC (26 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.14: +5 -11 lines
Diff to previous 1.14 (colored) to selected 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.14 / (download) - annotate - [select for diffs], Fri Mar 28 22:31:21 1997 UTC (27 years ago) by christos
Branch: MAIN
Changes since 1.13: +15 -7 lines
Diff to previous 1.13 (colored) to selected 1.12 (colored)

Make sure that the children of nodes that are marked .MADE, are marked
UPTODATE and their timestamps are consistent.

Revision 1.13 / (download) - annotate - [select for diffs], Sun Mar 23 01:25:29 1997 UTC (27 years ago) by christos
Branch: MAIN
Changes since 1.12: +29 -3 lines
Diff to previous 1.12 (colored)

Locate all the children of a node marked as MADE.

Revision 1.12 / (download) - annotate - [selected], Mon Mar 10 21:19:56 1997 UTC (27 years ago) by christos
Branch: MAIN
Changes since 1.11: +3 -3 lines
Diff to previous 1.11 (colored)

Add a .MADE directive to indicated that the children of a target are
up-to-date, even when they are not. This is to simulate our current
make install behavior with proper dependencies.

Revision 1.11 / (download) - annotate - [select for diffs], Thu Feb 20 16:51:48 1997 UTC (27 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.10: +77 -28 lines
Diff to previous 1.10 (colored) to selected 1.12 (colored)

Reported by cgd: fix .USE directive problems:
    1. ${.*} variables did not get expanded in dependencies.
    2. expanded ${.*} variables in .USE dependencies can cause tree
       restructuring; handle it.
    3. in compat mode, expand .USE before evaluating the list of targets,
       instead of doing .USE expansions on demand, because they can cause
       tree restructuring.

Revision 1.8.4.1 / (download) - annotate - [select for diffs], Sun Jan 26 05:51:45 1997 UTC (27 years, 2 months ago) by rat
Branch: netbsd-1-2
CVS Tags: netbsd-1-2-PATCH001
Changes since 1.8: +33 -26 lines
Diff to previous 1.8 (colored) next main 1.9 (colored) to selected 1.12 (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:10 1996 UTC (27 years, 3 months ago) by tls
Branch: WFJ-920714, CSRG
CVS Tags: lite-2
Changes since 1.1.1.1: +91 -30 lines
Diff to previous 1.1.1.1 (colored) to selected 1.12 (colored)

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

Revision 1.10 / (download) - annotate - [select for diffs], Wed Nov 6 17:59:15 1996 UTC (27 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.9: +24 -24 lines
Diff to previous 1.9 (colored) to selected 1.12 (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.9 / (download) - annotate - [select for diffs], Fri Aug 30 23:21:10 1996 UTC (27 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.8: +11 -4 lines
Diff to previous 1.8 (colored) to selected 1.12 (colored)

Fix bug reported by Greg Hudson where leaf (source only) nodes were
referenced only by their basename and not by their full pathname. This
breaks when .PATH or MAKEOBJDIR are used. There might be Makefiles around
that try to work around this bug by prepending ${.CURDIR} to the sources,
and they should be found and fixed. Also a lot of the gunk in suff.c that
was attempting to work around the same problem could be removed.

Revision 1.8 / (download) - annotate - [select for diffs], Fri Mar 15 21:52:37 1996 UTC (28 years 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.7: +5 -3 lines
Diff to previous 1.7 (colored) to selected 1.12 (colored)

Add PHONY attribute and target. This is the first step to cleanup the
xinstall and xlint crud.

Revision 1.7 / (download) - annotate - [select for diffs], Wed Jun 14 15:19:40 1995 UTC (28 years, 9 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.6: +7 -2 lines
Diff to previous 1.6 (colored) to selected 1.12 (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.6 / (download) - annotate - [select for diffs], Fri Jan 6 19:57:29 1995 UTC (29 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.5: +8 -2 lines
Diff to previous 1.5 (colored) to selected 1.12 (colored)

Fixes from Paul Borman (prb@bsdi.com)
1. Honor environment variable $MACHINE if set over uname.machine
2. archives with :: are always out of date, even when they have no children.
3. VAR= a b c     # comment, gets the trailing blanks trimmed, unless
   escaped by \. I'll have to read the posix manul to make sure that it
   is ok to handle escapes here.

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

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

Revision 1.4 / (download) - annotate - [select for diffs], Sat Mar 5 00:34:58 1994 UTC (30 years, 1 month ago) by cgd
Branch: MAIN
Changes since 1.3: +15 -4 lines
Diff to previous 1.3 (colored) to selected 1.12 (colored)

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

Revision 1.3 / (download) - annotate - [select for diffs], Thu Jan 13 21:01:57 1994 UTC (30 years, 2 months ago) by jtc
Branch: MAIN
Changes since 1.2: +2 -1 lines
Diff to previous 1.2 (colored) to selected 1.12 (colored)

Include appropriate header files to bring prototypes into scope.

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

Add RCS identifiers.

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Sun Mar 21 09:45:37 1993 UTC (31 years 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) to selected 1.12 (colored)

initial import of 386bsd-0.1 sources

Revision 1.1 / (download) - annotate - [select for diffs], Sun Mar 21 09:45:37 1993 UTC (31 years ago) by cgd
Branch: MAIN
Diff to selected 1.12 (colored)

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>