The NetBSD Project

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

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.351 / (download) - annotate - [select for diffs], Sat Jul 31 09:30:17 2021 UTC (2 months, 2 weeks ago) by rillig
Branch: MAIN
CVS Tags: HEAD
Changes since 1.350: +3 -2 lines
Diff to previous 1.350 (colored)

make: fix lint warnings

The string functions from str.h are declared as 'static __unused' when
compiled with GCC, but lint explicitly undefines __GCC__ during
preprocessing.  Therefore, make those functions inline, to prevent
warnings that they are unused.

The macro UNCONST is used in a few places, and (again) since lint
undefines __GCC__, that macro expanded to a simple type cast, which lint
warned about.  To prevent this warning, implement UNCONST as a function
that works everywhere and hides the type cast.

In filemon_open, the code for closing F->in was obviously unreachable.

No functional change.

Revision 1.350 / (download) - annotate - [select for diffs], Sun Apr 4 10:05:08 2021 UTC (6 months, 2 weeks 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.349: +5 -4 lines
Diff to previous 1.349 (colored)

make: rename a few functions to be more descriptive

No functional change.

Revision 1.349 / (download) - annotate - [select for diffs], Sat Apr 3 11:08:40 2021 UTC (6 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.348: +30 -30 lines
Diff to previous 1.348 (colored)

make: use C99 bool type instead of defining its own

No functional change.

Revision 1.348 / (download) - annotate - [select for diffs], Mon Mar 15 12:15:03 2021 UTC (7 months ago) by rillig
Branch: MAIN
Changes since 1.347: +3 -3 lines
Diff to previous 1.347 (colored)

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

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

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

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

No functional change.

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

make: rename VARE_NONE to VARE_PARSE_ONLY

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

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

Revision 1.346 / (download) - annotate - [select for diffs], Tue Feb 23 15:56:29 2021 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.345: +3 -3 lines
Diff to previous 1.345 (colored)

make: improve error message for unclosed modifier

Replace "variable specification" with the more modern "variable
expression", reduce the number of parentheses, output more than a single
character for modifiers, make it obvious that in expressions such as
${:Serror}, the "" means a variable name.

Revision 1.345 / (download) - annotate - [select for diffs], Fri Feb 5 05:15:12 2021 UTC (8 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.344: +18 -18 lines
Diff to previous 1.344 (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.344 / (download) - annotate - [select for diffs], Thu Feb 4 21:42:46 2021 UTC (8 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.343: +4 -4 lines
Diff to previous 1.343 (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.343 / (download) - annotate - [select for diffs], Wed Feb 3 08:08:18 2021 UTC (8 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.342: +4 -4 lines
Diff to previous 1.342 (colored)

make: replace Global_SetExpand with Global_Set for constant names

Revision 1.342 / (download) - annotate - [select for diffs], Wed Feb 3 08:00:36 2021 UTC (8 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.341: +4 -4 lines
Diff to previous 1.341 (colored)

make: use shortcut functions Global_SetExpand and Global_AppendExpand

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

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

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

Revision 1.341 / (download) - annotate - [select for diffs], Sat Jan 30 15:48:42 2021 UTC (8 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.340: +3 -5 lines
Diff to previous 1.340 (colored)

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

No functional change.

Revision 1.340 / (download) - annotate - [select for diffs], Sun Jan 24 20:11:55 2021 UTC (8 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.339: +3 -3 lines
Diff to previous 1.339 (colored)

make(1): convert SearchPath to struct

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

Revision 1.339 / (download) - annotate - [select for diffs], Sat Jan 23 12:35:22 2021 UTC (8 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.338: +6 -6 lines
Diff to previous 1.338 (colored)

make(1): rename local variable in FindCmds

Revision 1.338 / (download) - annotate - [select for diffs], Sat Jan 23 12:25:35 2021 UTC (8 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.337: +3 -3 lines
Diff to previous 1.337 (colored)

make(1): remove the remaining beasts from the comments

Revision 1.337 / (download) - annotate - [select for diffs], Sat Jan 23 11:34:41 2021 UTC (8 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.336: +4 -4 lines
Diff to previous 1.336 (colored)

make(1): rename Dir_AddDir, reorder parameters of SearchPath_ToFlags

Revision 1.336 / (download) - annotate - [select for diffs], Sat Jan 23 10:48:49 2021 UTC (8 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.335: +3 -3 lines
Diff to previous 1.335 (colored)

make(1): rename Dir_Expand to SearchPath_Expand

The main subject of this function is the search path.  In this search
path the pattern is expanded.

Revision 1.335 / (download) - annotate - [select for diffs], Sun Jan 10 21:20:46 2021 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.334: +3 -3 lines
Diff to previous 1.334 (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.334 / (download) - annotate - [select for diffs], Sat Jan 9 16:06:09 2021 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.333: +4 -2 lines
Diff to previous 1.333 (colored)

make(1): fix lint warnings

Revision 1.333 / (download) - annotate - [select for diffs], Wed Dec 30 10:03:16 2020 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.332: +18 -10 lines
Diff to previous 1.332 (colored)

make(1): format multi-line comments

Revision 1.332 / (download) - annotate - [select for diffs], Sun Dec 20 13:38:43 2020 UTC (9 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.331: +6 -8 lines
Diff to previous 1.331 (colored)

make(1): return FStr from Var_Parse

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

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

make(1): spell nonexistent consistently

Revision 1.330 / (download) - annotate - [select for diffs], Sun Dec 13 20:14:48 2020 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.329: +7 -25 lines
Diff to previous 1.329 (colored)

make(1): add str_basename to reduce duplicate code

The function basename from POSIX has a few unfortunate properties, it is
allowed to return a pointer to static memory.  This is too unreliable,
therefore this trivial own implementation.

Revision 1.329 / (download) - annotate - [select for diffs], Mon Dec 7 01:27:08 2020 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.328: +2 -3 lines
Diff to previous 1.328 (colored)

make(1): actually fix the use-after-free bug and the double-free

The use-after-free bug had been there since 2020-11-22, the double-free
bug since a few minutes.

Revision 1.328 / (download) - annotate - [select for diffs], Mon Dec 7 01:24:41 2020 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.327: +3 -2 lines
Diff to previous 1.327 (colored)

make(1): fix use-after-free in -DDEBUG_SRC mode (since 2020-11-22)

Revision 1.327 / (download) - annotate - [select for diffs], Sun Dec 6 10:49:02 2020 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.326: +28 -32 lines
Diff to previous 1.326 (colored)

make(1): inline macros for debug logging

No changes to the resulting binary, except for the line numbers in
assertions.

Revision 1.326 / (download) - annotate - [select for diffs], Sat Dec 5 18:38:02 2020 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.325: +4 -3 lines
Diff to previous 1.325 (colored)

make(1): define constants for enum zero-values

Revision 1.325 / (download) - annotate - [select for diffs], Sat Dec 5 17:12:02 2020 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.324: +73 -82 lines
Diff to previous 1.324 (colored)

make(1): extract ExpandChildrenRegular from ExpandChildren

Revision 1.324 / (download) - annotate - [select for diffs], Sat Dec 5 16:59:47 2020 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.323: +1328 -1268 lines
Diff to previous 1.323 (colored)

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

ExpandChildren is way too deeply nested.

Revision 1.323 / (download) - annotate - [select for diffs], Sun Nov 29 01:40:26 2020 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.322: +6 -6 lines
Diff to previous 1.322 (colored)

make(1): reduce memory allocation for dirSearchPath

Revision 1.322 / (download) - annotate - [select for diffs], Sun Nov 29 01:30:38 2020 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.321: +22 -22 lines
Diff to previous 1.321 (colored)

make(1): reduce memory allocations in suffix storage

Revision 1.321 / (download) - annotate - [select for diffs], Sun Nov 29 01:24:18 2020 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.320: +11 -16 lines
Diff to previous 1.320 (colored)

make(1): reduce memory allocations in suffix handling

Revision 1.320 / (download) - annotate - [select for diffs], Sun Nov 29 01:19:11 2020 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.319: +8 -8 lines
Diff to previous 1.319 (colored)

make(1): reduce memory allocation in ExpandWildcards for suffixes

Revision 1.319 / (download) - annotate - [select for diffs], Sun Nov 29 01:16:37 2020 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.318: +9 -9 lines
Diff to previous 1.318 (colored)

make(1): reduce memory allocation in ExpandChildren for suffixes

Revision 1.318 / (download) - annotate - [select for diffs], Sun Nov 29 01:12:45 2020 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.317: +11 -11 lines
Diff to previous 1.317 (colored)

make(1): reduce memory allocation in suffix candidate search

Revision 1.317 / (download) - annotate - [select for diffs], Sun Nov 29 01:10:08 2020 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.316: +10 -10 lines
Diff to previous 1.316 (colored)

make(1): reduce memory allocation in suffix rule handling

Revision 1.316 / (download) - annotate - [select for diffs], Sun Nov 29 00:54:43 2020 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.315: +27 -33 lines
Diff to previous 1.315 (colored)

make(1): reduce memory allocation in suffix handling

The function Lst_MoveAll previously freed the source list.  This
function was only used in a few places, and none of them really needed
the allocation.

Revision 1.315 / (download) - annotate - [select for diffs], Sat Nov 28 22:56:01 2020 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.314: +9 -12 lines
Diff to previous 1.314 (colored)

make(1): replace Dir_Destroy with SearchPath_Free

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

Revision 1.314 / (download) - annotate - [select for diffs], Sat Nov 28 22:13:56 2020 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.313: +15 -12 lines
Diff to previous 1.313 (colored)

make(1): rename some Dir functions to SearchPath

These functions have the search path as their main subject.

Revision 1.313 / (download) - annotate - [select for diffs], Sat Nov 28 19:22:32 2020 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.312: +3 -3 lines
Diff to previous 1.312 (colored)

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

Revision 1.312 / (download) - annotate - [select for diffs], Sat Nov 28 19:20:03 2020 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.311: +4 -4 lines
Diff to previous 1.311 (colored)

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

Revision 1.311 / (download) - annotate - [select for diffs], Sat Nov 28 19:16:53 2020 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.310: +3 -3 lines
Diff to previous 1.310 (colored)

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

Revision 1.310 / (download) - annotate - [select for diffs], Sat Nov 28 19:12:28 2020 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.309: +24 -24 lines
Diff to previous 1.309 (colored)

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

Revision 1.309 / (download) - annotate - [select for diffs], Sat Nov 28 18:55:52 2020 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.308: +7 -7 lines
Diff to previous 1.308 (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.308 / (download) - annotate - [select for diffs], Mon Nov 23 20:41:20 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.307: +5 -5 lines
Diff to previous 1.307 (colored)

make(1): align end-of-line comments with tabs

Revision 1.307 / (download) - annotate - [select for diffs], Mon Nov 23 18:07:10 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.306: +10 -16 lines
Diff to previous 1.306 (colored)

make(1): add HashSet type

This makes the code for handling suffixes simpler since it doesn't need
the clumsy API of HashTable_CreateEntry anymore.

Revision 1.306 / (download) - annotate - [select for diffs], Mon Nov 23 14:47:12 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.305: +21 -5 lines
Diff to previous 1.305 (colored)

make(1): fix endless loop when resolving circular suffix rules

Revision 1.305 / (download) - annotate - [select for diffs], Mon Nov 23 14:04:28 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.304: +7 -11 lines
Diff to previous 1.304 (colored)

make(1): make control flow simpler in FindThem

Revision 1.304 / (download) - annotate - [select for diffs], Mon Nov 23 13:52:27 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.303: +5 -10 lines
Diff to previous 1.303 (colored)

make(1): fix DEBUG_SRC logging in FindThem

The node is also removed from the list if it is neither found in the
nodes nor in the file system.  The logging did not reflect this.

Revision 1.303 / (download) - annotate - [select for diffs], Sun Nov 22 22:58:43 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.302: +57 -16 lines
Diff to previous 1.302 (colored)

make(1): add high-level API for CandidateSearcher

This avoids passing invisible void pointers around in Lst_Append.  It
also provides a convenient place to document what it means to "add a
candidate to the searcher".

Revision 1.302 / (download) - annotate - [select for diffs], Sun Nov 22 22:27:19 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.301: +37 -27 lines
Diff to previous 1.301 (colored)

make(1): add CandidateSearcher to resolve transformation rules

Having a simple list of candidates is not enough.  It is currently
possible to construct endless loops with huge memory usage, as
demonstrated in suff-transform-endless.mk.

To fix this, a straight-forward idea is to remember which candidates
have already been searched and to not search them again.

This also fixes a small inconsistency in the code.  Most parameters had
been named slst (the s came from a time when Candidate was named Src),
except for Suff_FindDeps, where the variable was named srcs.  The
confusing thing about this was that the name srcs is used throughout the
file for a different purpose.  Only in FindThem there were two
parameters of the same type, which made this even more confusing.

Revision 1.301 / (download) - annotate - [select for diffs], Sun Nov 22 21:34:34 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.300: +26 -17 lines
Diff to previous 1.300 (colored)

make(1): add more debugging for searching transformation rules

Revision 1.300 / (download) - annotate - [select for diffs], Sun Nov 22 20:29:53 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.299: +5 -2 lines
Diff to previous 1.299 (colored)

make(1): add debug logging for setting and resetting the main target

The suffix code still doesn't behave as expected.  Make sure that at
least setting the main target works as expected.  It does, and the added
debug logging provides further hints for debugging the suffix handling
code.

Revision 1.299 / (download) - annotate - [select for diffs], Sun Nov 22 18:13:52 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.298: +5 -4 lines
Diff to previous 1.298 (colored)

make(1): rename local variable in UpdateTargets

Revision 1.298 / (download) - annotate - [select for diffs], Sun Nov 22 17:20:15 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.297: +34 -28 lines
Diff to previous 1.297 (colored)

make(1): extract FindDepsLib from FindDepsRegularKnown

Revision 1.297 / (download) - annotate - [select for diffs], Sun Nov 22 12:05:20 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.296: +15 -19 lines
Diff to previous 1.296 (colored)

make(1): rename Candidate.pref to prefix

The new name nicely matches the .PREFIX variable.

Revision 1.296 / (download) - annotate - [select for diffs], Sun Nov 22 12:00:27 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.295: +20 -9 lines
Diff to previous 1.295 (colored)

make(1): improve documentation of Candidate fields

Revision 1.295 / (download) - annotate - [select for diffs], Sun Nov 22 11:50:31 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.294: +36 -33 lines
Diff to previous 1.294 (colored)

make(1): extract ExpandMember from FindDepsArchive

Revision 1.294 / (download) - annotate - [select for diffs], Sun Nov 22 11:46:49 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.293: +15 -7 lines
Diff to previous 1.293 (colored)

make(1): extract ExpandAllChildren from FindDepsArchive

Revision 1.293 / (download) - annotate - [select for diffs], Sun Nov 22 11:30:02 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.292: +24 -15 lines
Diff to previous 1.292 (colored)

make(1): extract string handling from Suffix_GetSuffix

Finding a suffix of a string is not the job of the Suffix type.

Revision 1.292 / (download) - annotate - [select for diffs], Sun Nov 22 11:26:50 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.291: +5 -5 lines
Diff to previous 1.291 (colored)

make(1): rename StrIsPrefix to StrTrimPrefix

Only functions returning Boolean should have the word Is in their name.

Revision 1.291 / (download) - annotate - [select for diffs], Sun Nov 22 11:15:43 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.290: +4 -3 lines
Diff to previous 1.290 (colored)

make(1): fix C99-ism in Suffix_GetSuffix

Revision 1.290 / (download) - annotate - [select for diffs], Sun Nov 22 11:11:43 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.289: +3 -3 lines
Diff to previous 1.289 (colored)

make(1): fix type of local variable in FindDepsRegular

The compiler cannot check these since all lists and list nodes are
aliases to each other.

Maybe it's time to add type-generic lists to the code, to delegate these
checks to the compiler.

Revision 1.289 / (download) - annotate - [select for diffs], Sun Nov 22 10:27:56 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.288: +6 -2 lines
Diff to previous 1.288 (colored)

make(1): add comment about missing unit test for .MAIN in suffixes

Revision 1.288 / (download) - annotate - [select for diffs], Sun Nov 22 10:24:52 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.287: +9 -9 lines
Diff to previous 1.287 (colored)

make(1): remove last occurrences of Src

Revision 1.287 / (download) - annotate - [select for diffs], Sun Nov 22 10:22:23 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.286: +8 -7 lines
Diff to previous 1.286 (colored)

make(1): clean up comment about single-suffix inference rules

Revision 1.286 / (download) - annotate - [select for diffs], Sun Nov 22 10:11:23 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.285: +22 -31 lines
Diff to previous 1.285 (colored)

make(1): merge functions for suffix handling

The names of the functions AddSources and AddLevel were not as precise
and guiding as possible.  Merging them into a single function makes the
code indented a little more, but on the other hand provides a function
with an easy to grasp purpose.

Revision 1.285 / (download) - annotate - [select for diffs], Sun Nov 22 09:56:01 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.284: +16 -20 lines
Diff to previous 1.284 (colored)

make(1): clean up comments for Suff_AddInclude and Suff_AddLib

Revision 1.284 / (download) - annotate - [select for diffs], Sun Nov 22 09:48:58 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.283: +8 -2 lines
Diff to previous 1.283 (colored)

make(1): document possible bug in UpdateTarget in suffix handling

Revision 1.283 / (download) - annotate - [select for diffs], Sun Nov 22 09:46:37 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.282: +44 -37 lines
Diff to previous 1.282 (colored)

make(1): rename type SrcList to CandidateList

The variable names will be renamed in a follow-up commit, as necessary.

Revision 1.282 / (download) - annotate - [select for diffs], Sun Nov 22 09:30:22 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.281: +62 -78 lines
Diff to previous 1.281 (colored)

make(1): rename type Src to Candidate

In all this code about sources, targets, parents and children, it's been
way too difficult to decide whether each word 'src' meant a source as
opposed to target, or just a possible source on its own.

Revision 1.281 / (download) - annotate - [select for diffs], Sat Nov 21 23:51:28 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.280: +58 -58 lines
Diff to previous 1.280 (colored)

make(1): remove module name from local functions in Suff module

The module name doesn't provide any useful information.  More often than
not, it creates a wrong impression of a very specific function name; the
function name has to be expressive enough even without the module name.
The word Suff may have even be misleading since not all of the functions
in this module affect suffixes, some also simply work on strings.

Module boundaries are marked by function names of the form Module_Func.
Therefore, local function names don't need to start with the module
name.

Rename the FindDeps functions to list their hierarchical position in the
function name, from broad to narrow.

Revision 1.280 / (download) - annotate - [select for diffs], Sat Nov 21 23:25:29 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.279: +3 -5 lines
Diff to previous 1.279 (colored)

make(1): remove redundant null check in SuffFindCmds

Src.suff is never null.  It is initialized in the constructor and then
never modified again.  It cannot be marked as const though because memory
allocation and initialization are separated in SrcNew.

Revision 1.279 / (download) - annotate - [select for diffs], Sat Nov 21 23:09:07 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.278: +11 -15 lines
Diff to previous 1.278 (colored)

make(1): clean up Suffix_GetSuffix

This eliminates the unspecific variable names p1 and p2 and furthermore
ensures that there is never a pointer that points out of bounds.

The code could have used memcmp or strncmp as well, but since the
suffixes are usuall very short, there is no benefit over a direct loop
comparing individual characters.

Revision 1.278 / (download) - annotate - [select for diffs], Sat Nov 21 22:00:34 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.277: +4 -4 lines
Diff to previous 1.277 (colored)

make(1): fix indentation in SuffixList_Insert

Revision 1.277 / (download) - annotate - [select for diffs], Sat Nov 21 20:55:45 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.276: +8 -10 lines
Diff to previous 1.276 (colored)

make(1): make srclist a local variable

In all current unit tests, the variable srclist was empty both when
entering Suff_FindDeps and when leaving it.  Since that's the only
function that used this variable, it has been converted to a local
variable instead, to limit its scope.

To protect against accidental implementation mistakes, an assertion has
been added to ensure that at the end, everything could be cleaned up
properly.  This assertion was missing before, and if there had really
been a case where the list were non-empty, make would have resolved
completely wrong candidates for the implied sources.

Revision 1.276 / (download) - annotate - [select for diffs], Sat Nov 21 20:20:31 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.275: +10 -9 lines
Diff to previous 1.275 (colored)

make(1): improve local variable name in SuffRemoveSrc

Revision 1.275 / (download) - annotate - [select for diffs], Sat Nov 21 20:16:14 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.274: +4 -4 lines
Diff to previous 1.274 (colored)

make(1): move prototype of SuffFindDeps further down

Just to limit its scope.

Revision 1.274 / (download) - annotate - [select for diffs], Sat Nov 21 20:12:08 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.273: +46 -47 lines
Diff to previous 1.273 (colored)

make(1): move SuffExpandWildcards further up

This avoids an unnecessary forward declaration.

Revision 1.273 / (download) - annotate - [select for diffs], Sat Nov 21 20:04:10 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.272: +14 -3 lines
Diff to previous 1.272 (colored)

make(1): document Suffix and Src

Revision 1.272 / (download) - annotate - [select for diffs], Sat Nov 21 19:40:19 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.271: +5 -5 lines
Diff to previous 1.271 (colored)

make(1): improve comment for Suffix_GetSuffix

Revision 1.271 / (download) - annotate - [select for diffs], Sat Nov 21 19:33:38 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.270: +46 -41 lines
Diff to previous 1.270 (colored)

make(1): rename Suff functions whose subject is a single suffix

The naming scheme Suffix_Func makes these functions easily
distinguishable from those that merely happen to be in the Suff module
but have nothing to do with suffixes, such as SuffStrIsPrefix.

Revision 1.270 / (download) - annotate - [select for diffs], Sat Nov 21 19:21:49 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.269: +9 -8 lines
Diff to previous 1.269 (colored)

make(1): rename type SuffFlags to SuffixFlags

Revision 1.269 / (download) - annotate - [select for diffs], Sat Nov 21 19:18:24 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.268: +33 -33 lines
Diff to previous 1.268 (colored)

make(1): rename SuffList to SuffixList

Revision 1.268 / (download) - annotate - [select for diffs], Sat Nov 21 19:15:06 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.267: +60 -60 lines
Diff to previous 1.267 (colored)

make(1): rename type Suff to Suffix

This avoids confusion with the module suff.c of the same name.

The existing naming convention is that the module's public functions are
named Suff_Func and its private functions are named SuffFunc.  This
collides with the naming convention that a the functions of the type Suff
are called Suff_Func as well.

To resolve this collision, rename Suff to Suffix.  The related types like
SuffList and the affected functions like SuffRef will be renamed in a
follow-up commit.

Revision 1.267 / (download) - annotate - [select for diffs], Sat Nov 21 19:02:58 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.266: +21 -21 lines
Diff to previous 1.266 (colored)

make(1): rename suffNull to nullSuff

This variable is internal to the suff.c module, therefore there is no
need to prefix it with the module name.  The new name follows the naming
convention established by emptySuff.

Revision 1.266 / (download) - annotate - [select for diffs], Sat Nov 21 18:28:34 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.265: +6 -6 lines
Diff to previous 1.265 (colored)

make(1): improve name of local variable in SrcList_Add

Now that nothing in suff.c is named 's' anymore, there is no need for
's2' either.

Revision 1.265 / (download) - annotate - [select for diffs], Sat Nov 21 18:12:55 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.264: +6 -6 lines
Diff to previous 1.264 (colored)

make(1): rename SuffAddSrc to SrcList_Add

The main character in this function is the list of sources, therefore
make it the subject.

Revision 1.264 / (download) - annotate - [select for diffs], Sat Nov 21 18:09:13 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.263: +7 -5 lines
Diff to previous 1.263 (colored)

make(1): improve parameter name in SuffUpdateTarget

Revision 1.263 / (download) - annotate - [select for diffs], Sat Nov 21 18:06:09 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.262: +15 -9 lines
Diff to previous 1.262 (colored)

make(1): document necessary condition in SuffUpdateTarget

Revision 1.262 / (download) - annotate - [select for diffs], Sat Nov 21 17:18:36 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.261: +4 -10 lines
Diff to previous 1.261 (colored)

make(1): in SuffExpandChildren, only expand ${VAr} if needed

Revision 1.261 / (download) - annotate - [select for diffs], Sat Nov 21 13:20:12 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.260: +4 -6 lines
Diff to previous 1.260 (colored)

make(1): clean up reference counting in SuffList_Insert

Revision 1.260 / (download) - annotate - [select for diffs], Sat Nov 21 13:16:37 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.259: +10 -7 lines
Diff to previous 1.259 (colored)

make(1): move reference counting for suffixes to SrcNew

Revision 1.259 / (download) - annotate - [select for diffs], Sat Nov 21 13:11:13 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.258: +27 -22 lines
Diff to previous 1.258 (colored)

make(1): clean up reference counting for suffixes

Revision 1.258 / (download) - annotate - [select for diffs], Sat Nov 21 12:01:16 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.257: +12 -2 lines
Diff to previous 1.257 (colored)

make(1): add explanation for test suff-rebuild

Revision 1.257 / (download) - annotate - [select for diffs], Sat Nov 21 10:36:01 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.256: +4 -2 lines
Diff to previous 1.256 (colored)

make(1): add more debug logging for suffixes

The "Removing suffix" is not covered by the current tests.  It would be
best if that code were unreachable at all, since a reference count of -1
doesn't make sense.

Revision 1.256 / (download) - annotate - [select for diffs], Sat Nov 21 09:53:40 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.255: +3 -2 lines
Diff to previous 1.255 (colored)

make(1): add debug logging when adding a suffix to the global list

Revision 1.255 / (download) - annotate - [select for diffs], Sat Nov 21 09:51:00 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.254: +30 -30 lines
Diff to previous 1.254 (colored)

make(1): rename local variable s to suff

The name s was ambiguous.  It could have meant suffix, src, str, and
probably more.

Revision 1.254 / (download) - annotate - [select for diffs], Sat Nov 21 09:19:46 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.253: +5 -6 lines
Diff to previous 1.253 (colored)

make(1): make debug logging more precise in Suff_EndTransform

Revision 1.253 / (download) - annotate - [select for diffs], Sat Nov 21 09:16:44 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.252: +24 -24 lines
Diff to previous 1.252 (colored)

make(1): flatten Suff_EndTransform

This avoids the duplicate code for testing OP_TRANSFORM.

Revision 1.252 / (download) - annotate - [select for diffs], Sat Nov 21 08:23:36 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.251: +4 -4 lines
Diff to previous 1.251 (colored)

make(1): rename SuffScanTargets to SuffUpdateTarget

The word "scan" no longer applies to this function since that is done by
SuffUpdateTargets instead.

Revision 1.251 / (download) - annotate - [select for diffs], Sat Nov 21 08:01:20 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.250: +6 -6 lines
Diff to previous 1.250 (colored)

make(1): clean up parameter names for SuffScanTargets

The prefix "gs" came from a time when SuffScanTargets was called via
Lst_ForEach, passing it a struct GNodeSuff.  The "gs" had just been the
abbreviation for "GNode + Suff", which was already non-expressive.  On
top of that, the struct had a third field "r", also with an unclear name,
which was not even mentioned in the name of the struct.

For now, just remove the needless prefix since it has absolutely no
meaning anymore.  Maybe it will become clear what the "r" was supposed to
mean, it could be some kind of "result".

Revision 1.250 / (download) - annotate - [select for diffs], Thu Nov 19 21:27:29 2020 UTC (10 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.249: +6 -3 lines
Diff to previous 1.249 (colored)

make(1): mark srclist as a bad global variable

The previous comment "List of sources" didn't tell anything about the
purpose of the variable, it was only useful before July 2020, when its
data type was still Lst, without any type information.

Having a global variable here seems pointless, but all the code about
suffix transformations is so tricky and not well covered by tests that I
don't dare to convert the global variable to a local variable in
Suff_FindDeps.  The change itself would be trivial, but the hidden and
undocumented intentions of the original author probably aren't.

Revision 1.249 / (download) - annotate - [select for diffs], Thu Nov 19 14:42:33 2020 UTC (10 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.248: +4 -4 lines
Diff to previous 1.248 (colored)

make(1): compare pointers against NULL instead of implicit conversion

Revision 1.248 / (download) - annotate - [select for diffs], Thu Nov 19 14:32:25 2020 UTC (10 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.247: +4 -4 lines
Diff to previous 1.247 (colored)

make(1): fix compilation error in -DDEBUG_SRC mode

Revision 1.247 / (download) - annotate - [select for diffs], Mon Nov 16 23:27:41 2020 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.246: +12 -9 lines
Diff to previous 1.246 (colored)

make(1): rename local functions in suffix handling

Name these functions after their main object, which is the suffix list.

Revision 1.246 / (download) - annotate - [select for diffs], Mon Nov 16 23:23:57 2020 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.245: +15 -15 lines
Diff to previous 1.245 (colored)

make(1): merge duplicate calls to SuffInsert

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

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

Revision 1.244 / (download) - annotate - [select for diffs], Mon Nov 16 21:39:22 2020 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.243: +3 -3 lines
Diff to previous 1.243 (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.243 / (download) - annotate - [select for diffs], Mon Nov 16 18:49:54 2020 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.242: +5 -8 lines
Diff to previous 1.242 (colored)

make(1): inline SUFF_DEBUG3 and SUFF_DEBUG4

Each of them was only used a single time, which was not worth an
additional macro.

Revision 1.242 / (download) - annotate - [select for diffs], Mon Nov 16 18:47:03 2020 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.241: +13 -13 lines
Diff to previous 1.241 (colored)

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

Revision 1.241 / (download) - annotate - [select for diffs], Mon Nov 16 18:45:44 2020 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.240: +25 -24 lines
Diff to previous 1.240 (colored)

make(1): improve local variable names in suff.c

The name 's' was used for both 'suff' and 'src', which was unnecessarily
confusing.

Revision 1.240 / (download) - annotate - [select for diffs], Mon Nov 16 18:41:41 2020 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.239: +12 -20 lines
Diff to previous 1.239 (colored)

make(1): remove redundant braces and parentheses from suff.c

Revision 1.239 / (download) - annotate - [select for diffs], Mon Nov 16 18:38:49 2020 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.238: +7 -7 lines
Diff to previous 1.238 (colored)

make(1): use boolean expressions in conditions

Revision 1.238 / (download) - annotate - [select for diffs], Mon Nov 16 18:34:29 2020 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.237: +83 -143 lines
Diff to previous 1.237 (colored)

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

Revision 1.237 / (download) - annotate - [select for diffs], Mon Nov 16 16:15:37 2020 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.236: +8 -3 lines
Diff to previous 1.236 (colored)

make(1): mark Suff.ref as probably unused

Revision 1.236 / (download) - annotate - [select for diffs], Sun Nov 15 22:31:03 2020 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.235: +3 -4 lines
Diff to previous 1.235 (colored)

make(1): clean up coding style in compat, parse, suff

Revision 1.235 / (download) - annotate - [select for diffs], Sun Nov 8 19:53:11 2020 UTC (11 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.234: +4 -4 lines
Diff to previous 1.234 (colored)

make(1): clean up code related to VarEvalFlags

Mention VARE_WANTRES before VARE_UNDEFERR since the latter depends on
the former.

In ApplyModifier_Assign, VARE_KEEP_DOLLAR doesn't have to be removed
from eflags since ParseModifierPart does this already.

In EvalUndefined, testing for VARE_WANTRES is redundant if VARE_UNDEFERR
is already set.

Revision 1.234 / (download) - annotate - [select for diffs], Sun Nov 8 00:28:52 2020 UTC (11 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.233: +9 -9 lines
Diff to previous 1.233 (colored)

make(1): rename Src.children to numChildren

There are several other types that have a field named 'children' that is
a list.  To avoid confusion, rename this one to differentiate them.

Revision 1.233 / (download) - annotate - [select for diffs], Sun Nov 8 00:26:06 2020 UTC (11 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.232: +70 -84 lines
Diff to previous 1.232 (colored)

make(1): clean up local variable names in suffix handling

The file suff.c defines both Src and Suff, which makes the variable name
s ambiguous.

The word 'target' is ambiguous as well since it could mean a GNode or the
target suffix of a transformation.  Therefore, make the variable names
longer but more precise.

The comment about the nil return and the beanhead had been outdated
already in 1993.  There is no nil return anywhere nearby.  The longer
variable names make the rest of the comment redundant.

Revision 1.232 / (download) - annotate - [select for diffs], Sat Nov 7 10:44:53 2020 UTC (11 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.231: +6 -8 lines
Diff to previous 1.231 (colored)

make(1): add pp_skip_hspace to skip horizontal whitespace during parsing

Revision 1.231 / (download) - annotate - [select for diffs], Thu Nov 5 17:27:16 2020 UTC (11 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.230: +3 -3 lines
Diff to previous 1.230 (colored)

make(1): remove redundant parentheses from sizeof operator

The parentheses are only needed if the argument is a type, not an
expression.

Revision 1.230 / (download) - annotate - [select for diffs], Sat Oct 31 11:54:33 2020 UTC (11 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.229: +4 -9 lines
Diff to previous 1.229 (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.229 / (download) - annotate - [select for diffs], Fri Oct 30 20:30:44 2020 UTC (11 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.228: +3 -3 lines
Diff to previous 1.228 (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.228 / (download) - annotate - [select for diffs], Fri Oct 30 15:39:17 2020 UTC (11 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.227: +10 -10 lines
Diff to previous 1.227 (colored)

make(1): fix indentation in source code

Revision 1.227 / (download) - annotate - [select for diffs], Mon Oct 26 20:14:27 2020 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.226: +5 -5 lines
Diff to previous 1.226 (colored)

make(1): convert a few strings to const strings in suff.c

Revision 1.226 / (download) - annotate - [select for diffs], Sun Oct 25 22:13:53 2020 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.225: +5 -7 lines
Diff to previous 1.225 (colored)

make(1): properly terminate debug output with newline

Without this, NetBSD's sed adds the missing newline at the end of the
file, while other sed implementations don't do that.

Revision 1.225 / (download) - annotate - [select for diffs], Sun Oct 25 21:51:49 2020 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.224: +4 -4 lines
Diff to previous 1.224 (colored)

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

Revision 1.224 / (download) - annotate - [select for diffs], Sun Oct 25 17:12:51 2020 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.223: +12 -9 lines
Diff to previous 1.223 (colored)

make(1): add more details to DEBUG_SRC log

Revision 1.223 / (download) - annotate - [select for diffs], Sun Oct 25 10:00:20 2020 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.222: +3 -3 lines
Diff to previous 1.222 (colored)

make(1): replace Dir_CopyDir with Dir_CopyDirSearchPath

Callback functions for the Lst functions do not belong in the public API
of a module.

Revision 1.222 / (download) - annotate - [select for diffs], Sat Oct 24 10:36:23 2020 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.221: +2 -3 lines
Diff to previous 1.221 (colored)

make(1): remove unused Lst_Find and Lst_FindFrom

Revision 1.221 / (download) - annotate - [select for diffs], Sat Oct 24 03:30:25 2020 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.220: +22 -23 lines
Diff to previous 1.220 (colored)

make(1): don't modify GNode name while rebuilding the suffix graph

Revision 1.220 / (download) - annotate - [select for diffs], Sat Oct 24 03:01:19 2020 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.219: +20 -21 lines
Diff to previous 1.219 (colored)

make(1): improve local variable names in SuffFindThem

Revision 1.219 / (download) - annotate - [select for diffs], Fri Oct 23 20:15:19 2020 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.218: +21 -20 lines
Diff to previous 1.218 (colored)

make(1): improve variable names in SuffRebuildGraph

Revision 1.218 / (download) - annotate - [select for diffs], Fri Oct 23 18:36:09 2020 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.217: +3 -3 lines
Diff to previous 1.217 (colored)

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

Revision 1.217 / (download) - annotate - [select for diffs], Thu Oct 22 21:27:24 2020 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.216: +3 -3 lines
Diff to previous 1.216 (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.216 / (download) - annotate - [select for diffs], Thu Oct 22 19:30:37 2020 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.215: +6 -10 lines
Diff to previous 1.215 (colored)

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

Again, no concurrent modification nearby.

Revision 1.215 / (download) - annotate - [select for diffs], Thu Oct 22 19:05:24 2020 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.214: +15 -15 lines
Diff to previous 1.214 (colored)

make(1): rename local variables in SuffFindCmds

Several types have fields named "parents" and "children", which makes an
expression like s->children ambiguous.

Revision 1.214 / (download) - annotate - [select for diffs], Thu Oct 22 18:59:12 2020 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.213: +7 -11 lines
Diff to previous 1.213 (colored)

make(1): migrate Lst_Open to simple iteration in SuffRemoveSrc

During the iteration, the list is modified.  But after the modification,
the iteration stops by returning, therefore the additional complexity of
Lst_Open is not needed in this case.

Revision 1.213 / (download) - annotate - [select for diffs], Thu Oct 22 05:50:02 2020 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.212: +3 -3 lines
Diff to previous 1.212 (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.212 / (download) - annotate - [select for diffs], Wed Oct 21 08:20:13 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.211: +3 -3 lines
Diff to previous 1.211 (colored)

make(1): add suffix number to the debug log

Previously, I had taken that lonely number in the debug log for the
sNum, but it was the reference count.

Revision 1.211 / (download) - annotate - [select for diffs], Wed Oct 21 08:00:06 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.210: +10 -10 lines
Diff to previous 1.210 (colored)

make(1): rename Src.cp to childrenList

Revision 1.210 / (download) - annotate - [select for diffs], Wed Oct 21 07:57:41 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.209: +24 -24 lines
Diff to previous 1.209 (colored)

make(1): replace SuffGNHasName with FindTransformByName

Revision 1.209 / (download) - annotate - [select for diffs], Wed Oct 21 07:42:36 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.208: +30 -43 lines
Diff to previous 1.208 (colored)

make(1): extract code to allocate a Src

Separating this code from the rest of the initialization makes it
obvious that there are inconsistencies in memory handling (owned vs.
shared pointers, reference counts).  It also forces a consistent order
of specifying the fields of a Src.

Revision 1.208 / (download) - annotate - [select for diffs], Wed Oct 21 07:11:50 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.207: +11 -12 lines
Diff to previous 1.207 (colored)

make(1): clean up suffix handling code

Using (name, nameLen) is easier to understand than the unusual (nameLen,
nameEnd).

Revision 1.207 / (download) - annotate - [select for diffs], Wed Oct 21 07:05:52 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.206: +33 -44 lines
Diff to previous 1.206 (colored)

make(1): inline struct SuffSuffGetSuffixArgs in suffix search

Revision 1.206 / (download) - annotate - [select for diffs], Wed Oct 21 06:46:21 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.205: +48 -46 lines
Diff to previous 1.205 (colored)

make(1): reduce indentation in SuffFindNormalDepsPath

Revision 1.205 / (download) - annotate - [select for diffs], Wed Oct 21 06:40:28 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.204: +65 -60 lines
Diff to previous 1.204 (colored)

make(1): extract path search from SuffFindNormalDeps

Revision 1.204 / (download) - annotate - [select for diffs], Wed Oct 21 06:36:10 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.203: +28 -28 lines
Diff to previous 1.203 (colored)

make(1): unindent SuffFindNormalDepsUnknown

Revision 1.203 / (download) - annotate - [select for diffs], Wed Oct 21 06:34:26 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.202: +26 -38 lines
Diff to previous 1.202 (colored)

make(1): clean up SuffFindNormalDepsKnown

Revision 1.202 / (download) - annotate - [select for diffs], Wed Oct 21 06:30:30 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.201: +44 -37 lines
Diff to previous 1.201 (colored)

make(1): extract handling of unknown suffix from SuffFindNormalDeps

Revision 1.201 / (download) - annotate - [select for diffs], Wed Oct 21 06:26:46 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.200: +60 -49 lines
Diff to previous 1.200 (colored)

make(1): extract handling of known suffix from SuffFindNormalDeps

Revision 1.200 / (download) - annotate - [select for diffs], Wed Oct 21 06:12:16 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.199: +3 -5 lines
Diff to previous 1.199 (colored)

make(1): merge duplicate code for -DDEBUG_SRC

Revision 1.199 / (download) - annotate - [select for diffs], Tue Oct 20 23:04:35 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.198: +7 -9 lines
Diff to previous 1.198 (colored)

make(1): remove strange off-by-one feature in SuffSuffGetSuffix

The code worked as intended, yet it was strange to modify cp[1] to
temporarily shorten a string.  Using cp[0] for this purpose is common
style.

Revision 1.198 / (download) - annotate - [select for diffs], Tue Oct 20 21:15:47 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.197: +34 -39 lines
Diff to previous 1.197 (colored)

make(1): improve debug messages for suff.c

Especially for the null suffix, the previous message was hard to read.
Who would guess that in "inserting (0)", there is an empty string before
the parenthesis?  The new format uses quotes to make the suffixes
clearly visible.

While here, improve some local variable names.  In a file that defines
both Suff and Src, using s for a variable is just too ambiguous.  The
variable name l can easily be confused with a 1, so name it list
instead.

Revision 1.197 / (download) - annotate - [select for diffs], Tue Oct 20 20:55:35 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.196: +4 -12 lines
Diff to previous 1.196 (colored)

make(1): inline SuffSuffIsPrefix into SuffParseTransform

Revision 1.196 / (download) - annotate - [select for diffs], Tue Oct 20 20:51:15 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.195: +32 -52 lines
Diff to previous 1.195 (colored)

make(1): untangle SuffParseTransform

That function was probably not meant to be a brain-twister, but the
convoluted loop combined with Lst_Find/Lst_FindFrom and the deeply
indented second pass for the single suffix made the code harder to
understand than necessary.

No functional change intended, that's why I had to split and enable the
test suffixes.mk first.

Revision 1.195 / (download) - annotate - [select for diffs], Mon Oct 19 21:57:37 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.194: +20 -20 lines
Diff to previous 1.194 (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.194 / (download) - annotate - [select for diffs], Mon Oct 19 21:38:10 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.193: +6 -8 lines
Diff to previous 1.193 (colored)

make(1): use consistent formatting for DEBUG_SRC

No trailing whitespace anymore, %p instead of %lx.

Revision 1.193 / (download) - annotate - [select for diffs], Mon Oct 19 21:33:09 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.192: +11 -7 lines
Diff to previous 1.192 (colored)

make(1): remove void pointers from DEBUG_SRC debugging code

This debugging code is completely broken.  Part of the output goes to
debug_file, the other part goes to stdout.  The spacing in the output is
inconsistent.  The printf directives vary between %p and %lx.

All these inconsistencies have already been there in June 2020, before
the big refactoring started.

Revision 1.192 / (download) - annotate - [select for diffs], Mon Oct 19 21:23:07 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.191: +9 -8 lines
Diff to previous 1.191 (colored)

make(1): remove void pointers from SuffRebuildGraph

Revision 1.191 / (download) - annotate - [select for diffs], Mon Oct 19 21:17:35 2020 UTC (11 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.190: +31 -23 lines
Diff to previous 1.190 (colored)

make(1): remove void pointers from suffix debug printing

Revision 1.190 / (download) - annotate - [select for diffs], Sun Oct 18 17:41:06 2020 UTC (12 months ago) by rillig
Branch: MAIN
Changes since 1.189: +29 -40 lines
Diff to previous 1.189 (colored)

make(1): extract duplicate code from SuffAddSrc into separate function

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

make(1): add tags to enum types

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

Revision 1.188 / (download) - annotate - [select for diffs], Sun Oct 18 17:12:43 2020 UTC (12 months ago) by rillig
Branch: MAIN
Changes since 1.187: +11 -11 lines
Diff to previous 1.187 (colored)

make(1): improve parameter names for suffix functions

Both gs_gnp and gnp were terrible variable names that didn't give the
slightest clue about the variable's purpose.

Revision 1.187 / (download) - annotate - [select for diffs], Sun Oct 18 17:06:14 2020 UTC (12 months ago) by rillig
Branch: MAIN
Changes since 1.186: +20 -17 lines
Diff to previous 1.186 (colored)

make(1): extract UpdateTargets from Suff_AddSuffix

Revision 1.186 / (download) - annotate - [select for diffs], Sun Oct 18 17:00:22 2020 UTC (12 months ago) by rillig
Branch: MAIN
Changes since 1.185: +24 -28 lines
Diff to previous 1.185 (colored)

make(1): inline struct SuffScanTargetsArgs into SuffScanTargets

Revision 1.185 / (download) - annotate - [select for diffs], Sun Oct 18 16:01:44 2020 UTC (12 months ago) by rillig
Branch: MAIN
Changes since 1.184: +14 -17 lines
Diff to previous 1.184 (colored)

make(1): rename struct GNodeSuff to SuffScanTargetsArgs

Revision 1.184 / (download) - annotate - [select for diffs], Sun Oct 18 15:53:47 2020 UTC (12 months ago) by rillig
Branch: MAIN
Changes since 1.183: +19 -31 lines
Diff to previous 1.183 (colored)

make(1): inline struct LstSrc into SuffAddSrc

The variable names are still confusing.  There was no useful
documentation on the struct, and the code in SuffAddSrc is highly
redundant.  Maybe the next few refactorings will shed light on this part
of the code.

Revision 1.183 / (download) - annotate - [select for diffs], Sun Oct 18 15:40:54 2020 UTC (12 months ago) by rillig
Branch: MAIN
Changes since 1.182: +10 -13 lines
Diff to previous 1.182 (colored)

make(1): remove void pointers from SuffAddSrc

Revision 1.182 / (download) - annotate - [select for diffs], Sun Oct 18 15:31:43 2020 UTC (12 months ago) by rillig
Branch: MAIN
Changes since 1.181: +3 -5 lines
Diff to previous 1.181 (colored)

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

Revision 1.181 / (download) - annotate - [select for diffs], Sun Oct 18 14:09:39 2020 UTC (12 months ago) by rillig
Branch: MAIN
Changes since 1.180: +4 -8 lines
Diff to previous 1.180 (colored)

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

Since sufflist is not modified during iteration, there is no need for
the extra complexity of Lst_Open.

Revision 1.180 / (download) - annotate - [select for diffs], Sun Oct 18 13:02:10 2020 UTC (12 months ago) by rillig
Branch: MAIN
Changes since 1.179: +25 -25 lines
Diff to previous 1.179 (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.179 / (download) - annotate - [select for diffs], Sat Oct 17 21:32:30 2020 UTC (12 months ago) by rillig
Branch: MAIN
Changes since 1.178: +3 -3 lines
Diff to previous 1.178 (colored)

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

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

make(1): fix indentation

Revision 1.177 / (download) - annotate - [select for diffs], Mon Oct 5 21:37:07 2020 UTC (12 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.176: +4 -4 lines
Diff to previous 1.176 (colored)

make(1): prepare job.c, main.c, parse.c, suff.c for WARNS=6

In job.c, GCC 5 complains about the macro FILENO that it has type
unsigned int, which is then passed as the argument of dup2, which
expects a simple int.  Maybe this workaround from 1995 is not necessary
anymore, or maybe it is but can be restricted to the few affected
platforms.

This leaves meta.c and the filemon files to be converted.  I didn't do
them since they are not well covered by the unit tests.

Revision 1.176 / (download) - annotate - [select for diffs], Mon Oct 5 19:27:47 2020 UTC (12 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.175: +4 -4 lines
Diff to previous 1.175 (colored)

make(1): revert previous commit

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

Revision 1.175 / (download) - annotate - [select for diffs], Mon Oct 5 19:24:29 2020 UTC (12 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.174: +2 -2 lines
Diff to previous 1.174 (colored)

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

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

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

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

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

Revision 1.174 / (download) - annotate - [select for diffs], Sat Oct 3 21:52:50 2020 UTC (12 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.173: +4 -4 lines
Diff to previous 1.173 (colored)

make(1): clean up #include sections

Revision 1.173 / (download) - annotate - [select for diffs], Mon Sep 28 23:13:57 2020 UTC (12 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.172: +7 -7 lines
Diff to previous 1.172 (colored)

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

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

Revision 1.172 / (download) - annotate - [select for diffs], Mon Sep 28 22:23:35 2020 UTC (12 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.171: +25 -25 lines
Diff to previous 1.171 (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.171 / (download) - annotate - [select for diffs], Mon Sep 28 20:46:11 2020 UTC (12 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.170: +6 -13 lines
Diff to previous 1.170 (colored)

make(1): make debugging code shorter

Revision 1.170 / (download) - annotate - [select for diffs], Sun Sep 27 21:35:16 2020 UTC (12 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.169: +115 -113 lines
Diff to previous 1.169 (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.169 / (download) - annotate - [select for diffs], Sat Sep 26 17:15:20 2020 UTC (12 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.168: +9 -10 lines
Diff to previous 1.168 (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.168 / (download) - annotate - [select for diffs], Sat Sep 26 16:00:12 2020 UTC (12 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.167: +9 -9 lines
Diff to previous 1.167 (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.167 / (download) - annotate - [select for diffs], Fri Sep 25 19:50:04 2020 UTC (12 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.166: +9 -9 lines
Diff to previous 1.166 (colored)

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

Revision 1.166 / (download) - annotate - [select for diffs], Fri Sep 25 18:58:12 2020 UTC (12 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.165: +69 -100 lines
Diff to previous 1.165 (colored)

make(1): in FindSuffByName, return the suffix instead of a list node

None of the callers was interested in the list node.

Revision 1.165 / (download) - annotate - [select for diffs], Fri Sep 25 17:55:19 2020 UTC (12 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.164: +20 -34 lines
Diff to previous 1.164 (colored)

make(1): migrate suff.c from Lst_ForEachUntil to Lst_ForEach

Revision 1.164 / (download) - annotate - [select for diffs], Fri Sep 25 17:14:32 2020 UTC (12 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.163: +17 -17 lines
Diff to previous 1.163 (colored)

make(1): convert int to size_t for string lengths

Just for formal reasons.  There is no practical scenario in which any
filename suffix would grow larger than a few kilocharacters.

Revision 1.163 / (download) - annotate - [select for diffs], Fri Sep 25 16:28:29 2020 UTC (12 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.162: +4 -4 lines
Diff to previous 1.162 (colored)

make(1): don't use reserved names in type names

Revision 1.162 / (download) - annotate - [select for diffs], Fri Sep 25 16:27:15 2020 UTC (12 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.161: +22 -16 lines
Diff to previous 1.161 (colored)

make(1): replace Lst_Find with FindSuffByName

Revision 1.161 / (download) - annotate - [select for diffs], Fri Sep 25 15:54:51 2020 UTC (12 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.160: +12 -11 lines
Diff to previous 1.160 (colored)

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

The tags prevent the structs from accidentally becoming compatible
types.

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

Revision 1.160 / (download) - annotate - [select for diffs], Thu Sep 24 08:02:32 2020 UTC (12 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.159: +3 -19 lines
Diff to previous 1.159 (colored)

make(1): remove redundant function prototypes in suff.c

Revision 1.159 / (download) - annotate - [select for diffs], Thu Sep 24 07:11:29 2020 UTC (12 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.158: +18 -18 lines
Diff to previous 1.158 (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.158 / (download) - annotate - [select for diffs], Tue Sep 22 20:19:46 2020 UTC (12 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.157: +4 -3 lines
Diff to previous 1.157 (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.157 / (download) - annotate - [select for diffs], Tue Sep 22 04:05:41 2020 UTC (12 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.156: +98 -94 lines
Diff to previous 1.156 (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.156 / (download) - annotate - [select for diffs], Sun Sep 13 18:27:39 2020 UTC (13 months ago) by rillig
Branch: MAIN
Changes since 1.155: +6 -4 lines
Diff to previous 1.155 (colored)

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

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

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

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

Revision 1.155 / (download) - annotate - [select for diffs], Sun Sep 13 15:15:51 2020 UTC (13 months ago) by rillig
Branch: MAIN
Changes since 1.154: +4 -14 lines
Diff to previous 1.154 (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.154 / (download) - annotate - [select for diffs], Sun Sep 13 06:15:29 2020 UTC (13 months ago) by rillig
Branch: MAIN
Changes since 1.153: +5 -5 lines
Diff to previous 1.153 (colored)

make(1): remove #endif comments for very short blocks

Revision 1.153 / (download) - annotate - [select for diffs], Sat Sep 12 19:41:20 2020 UTC (13 months ago) by rillig
Branch: MAIN
Changes since 1.152: +4 -4 lines
Diff to previous 1.152 (colored)

make(1): reword variable invocation to variable expression

Variables are a passive thing.  They cannot be invoked, they can only be
evaluated.

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

make(1): rename Var_ParsePP back to Var_Parse

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

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

make(1): fix API for Targ_PrintCmd

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

Revision 1.150 / (download) - annotate - [select for diffs], Sat Sep 12 15:21:25 2020 UTC (13 months ago) by rillig
Branch: MAIN
Changes since 1.149: +6 -13 lines
Diff to previous 1.149 (colored)

make(1): fix prototype of Suff_EndTransform

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

make(1): move PrintAddr to where it belongs

Revision 1.148 / (download) - annotate - [select for diffs], Sat Sep 12 14:41:00 2020 UTC (13 months ago) by rillig
Branch: MAIN
Changes since 1.147: +7 -7 lines
Diff to previous 1.147 (colored)

make(1): fix inconsistent code indentation

Revision 1.147 / (download) - annotate - [select for diffs], Fri Sep 11 04:36:12 2020 UTC (13 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.146: +10 -10 lines
Diff to previous 1.146 (colored)

make(1): rename GNodeSuff.gn to gnp

It was confusing to have a field called "gn" that was not a pointer to a
GNode, but a double-pointer to GNode instead.

Revision 1.146 / (download) - annotate - [select for diffs], Fri Sep 11 04:32:39 2020 UTC (13 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.145: +4 -4 lines
Diff to previous 1.145 (colored)

make(1): replace *a->b with a->b[0]

This allows the code to be read strictly from left to right.  In most
places this style was already used.

Revision 1.145 / (download) - annotate - [select for diffs], Tue Sep 8 05:26:21 2020 UTC (13 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.144: +18 -10 lines
Diff to previous 1.144 (colored)

make(1): fix off-by-one error in SuffExpandChildren

In suff.c r1.144 from yesterday, in the line "cp += nested_p - cp", I
accidentally removed the "- 1".  Since these "- 1" lines lead to slow
execution, each branch now increments the pointer separately by the
actually needed amount.

Fixing this bug posed way more new questions than it answered, and it
revealed an inconsistency in the parser about how characters are to be
escaped, and missing details in the documentation of Var_Parse, as well
as a parse error that unexpectedly doesn't stop make from continuing.

Revision 1.144 / (download) - annotate - [select for diffs], Mon Sep 7 07:15:26 2020 UTC (13 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.143: +7 -7 lines
Diff to previous 1.143 (colored)

make(1): migrate SuffExpandChildren to Var_ParsePP

Revision 1.143 / (download) - annotate - [select for diffs], Sat Sep 5 06:46:12 2020 UTC (13 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.142: +4 -4 lines
Diff to previous 1.142 (colored)

make(1): remove trailing whitespace in -dg1 debug output

Revision 1.142 / (download) - annotate - [select for diffs], Mon Aug 31 16:44:25 2020 UTC (13 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.141: +7 -4 lines
Diff to previous 1.141 (colored)

make(1): fix compilation for -DNDEBUG and -O3

The -O3 option of GCC 5.5 is unsure about whether s and t are always
defined, since SuffParseTransform only defines them if it returns TRUE.

Therefore assert that it does.  When compiled with -NDEBUG, this would
result in an unused variable, therefore use it using the well-known
cast-to-void pattern.

Revision 1.141 / (download) - annotate - [select for diffs], Mon Aug 31 05:56:02 2020 UTC (13 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.140: +4 -4 lines
Diff to previous 1.140 (colored)

make(1): fix unbalanced Lst_Open/Lst_Close in SuffFindCmds

This bug had been there since the initial import of make, on 1993-03-21.
It just never broke the build because of the missing assertion.

https://mail-index.netbsd.org/tech-toolchain/2020/08/30/msg003847.html

The error message "cd: can't cd to include" that I got when I first
applied the fix was unrelated.  It was caused by an extra directory
"include" in src/tools/compat that didn't belong there.  With that
directory removed, running "./build.sh -j8 tools" succeeds as expected.

Revision 1.140 / (download) - annotate - [select for diffs], Sun Aug 30 18:26:41 2020 UTC (13 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.139: +52 -83 lines
Diff to previous 1.139 (colored)

make(1): add debug macros to suff.c

This reduces the visual space that the debugging statements need.

Revision 1.139 / (download) - annotate - [select for diffs], Sun Aug 30 14:11:42 2020 UTC (13 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.138: +4 -4 lines
Diff to previous 1.138 (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.138 / (download) - annotate - [select for diffs], Sun Aug 30 11:15:05 2020 UTC (13 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.137: +27 -27 lines
Diff to previous 1.137 (colored)

make(1): rename Lst_Datum to LstNode_Datum

Revision 1.137 / (download) - annotate - [select for diffs], Sun Aug 30 11:12:06 2020 UTC (13 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.136: +10 -10 lines
Diff to previous 1.136 (colored)

make(1): rename Lst_Memeber to Lst_FindDatum

The new name nicely aligns with Lst_Find and Lst_FindFrom.

Revision 1.136 / (download) - annotate - [select for diffs], Sat Aug 29 13:38:48 2020 UTC (13 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.135: +4 -4 lines
Diff to previous 1.135 (colored)

make(1): trust that Var_Parse never returns NULL

That function is quite long, but all its return paths lead either to the
expanded variable expression, or to var_Error or varNoError.

Revision 1.135 / (download) - annotate - [select for diffs], Sat Aug 29 13:16:54 2020 UTC (13 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.134: +5 -4 lines
Diff to previous 1.134 (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.134 / (download) - annotate - [select for diffs], Sat Aug 29 12:01:46 2020 UTC (13 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.133: +124 -378 lines
Diff to previous 1.133 (colored)

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

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

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

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

Revision 1.133 / (download) - annotate - [select for diffs], Sat Aug 29 11:24:54 2020 UTC (13 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.132: +4 -4 lines
Diff to previous 1.132 (colored)

make(1): add bmake_strsedup for duplicating a substring

Revision 1.132 / (download) - annotate - [select for diffs], Sat Aug 29 11:13:43 2020 UTC (13 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.131: +6 -13 lines
Diff to previous 1.131 (colored)

make(1): merge duplicate code for bmake_strldup

Revision 1.131 / (download) - annotate - [select for diffs], Sat Aug 29 10:41:12 2020 UTC (13 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.130: +10 -10 lines
Diff to previous 1.130 (colored)

make(1): rename LstNode functions to match their type

Revision 1.130 / (download) - annotate - [select for diffs], Sat Aug 29 10:12:06 2020 UTC (13 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.129: +21 -21 lines
Diff to previous 1.129 (colored)

make(1): rename Lst_FindB back to Lst_Find

The migration from "comparison function" to "match function" is done,
the "B" in the names is no longer needed.

Revision 1.129 / (download) - annotate - [select for diffs], Sat Aug 29 10:06:23 2020 UTC (13 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.128: +50 -124 lines
Diff to previous 1.128 (colored)

make(1): migrate remaining Lst_Find to Lst_FindB

While here, rename SuffSuffIsSuffix to SuffSuffGetSuffix since a
function named "is" should return a boolean, not a string pointer.

Revision 1.128 / (download) - annotate - [select for diffs], Fri Aug 28 19:21:00 2020 UTC (13 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.127: +13 -17 lines
Diff to previous 1.127 (colored)

make(1): rename SuffixCmpData to SuffSuffIsSuffixArgs

The new name makes the comment above that struct redundant.

Revision 1.127 / (download) - annotate - [select for diffs], Fri Aug 28 17:27:21 2020 UTC (13 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.126: +8 -44 lines
Diff to previous 1.126 (colored)

make(1): clean up suffix handling

Revision 1.126 / (download) - annotate - [select for diffs], Fri Aug 28 06:37:21 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.125: +7 -5 lines
Diff to previous 1.125 (colored)

make(1): fix assertion failure in suffix handling

Found by running ./build.sh, in the very early stage.
Fixed by restoring the previous behavior of returning NULL for invalid
arguments.

Revision 1.125 / (download) - annotate - [select for diffs], Fri Aug 28 04:48:57 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.124: +156 -156 lines
Diff to previous 1.124 (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.124 / (download) - annotate - [select for diffs], Fri Aug 28 04:28:45 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.123: +8 -8 lines
Diff to previous 1.123 (colored)

make(1): migrate Lst_Find to Lst_FindS

Revision 1.123 / (download) - annotate - [select for diffs], Fri Aug 28 04:14:31 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.122: +6 -6 lines
Diff to previous 1.122 (colored)

make(1): migrate Lst_First to Lst_FirstS

Revision 1.122 / (download) - annotate - [select for diffs], Fri Aug 28 03:35:45 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.121: +15 -26 lines
Diff to previous 1.121 (colored)

make(1): print suffix flags in the standard way

This changes the output (it is now SUFF_NULL instead of just NULL), and
the order of the flags in the output is reversed.

Revision 1.121 / (download) - annotate - [select for diffs], Thu Aug 27 19:15:35 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.120: +16 -17 lines
Diff to previous 1.120 (colored)

make(1): migrate Lst_IsEmpty to Lst_IsEmptyS

Revision 1.120 / (download) - annotate - [select for diffs], Thu Aug 27 07:03:48 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.119: +5 -5 lines
Diff to previous 1.119 (colored)

make(1): migrate Lst_Last to Lst_LastS

Revision 1.119 / (download) - annotate - [select for diffs], Thu Aug 27 07:00:29 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.118: +8 -8 lines
Diff to previous 1.118 (colored)

make(1): migrate Lst_Succ to Lst_SuccS

Revision 1.118 / (download) - annotate - [select for diffs], Thu Aug 27 06:53:57 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.117: +13 -13 lines
Diff to previous 1.117 (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.117 / (download) - annotate - [select for diffs], Wed Aug 26 23:08:26 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.116: +23 -23 lines
Diff to previous 1.116 (colored)

make(1): merge duplicate code for creating a new suffix

Revision 1.116 / (download) - annotate - [select for diffs], Wed Aug 26 22:55:46 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.115: +36 -39 lines
Diff to previous 1.115 (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.115 / (download) - annotate - [select for diffs], Tue Aug 25 16:50:02 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.114: +5 -4 lines
Diff to previous 1.114 (colored)

make(1): fix obvious bugs in -DCLEANUP mode

The outdated type name FreeProc had been renamed to LstFreeProc.
Casting the function free to it is not necessary since the type of this
function is already exactly the correct type.  Anything else would be
undefined behavior anyway.

The uninitialized sufflist in Suff_ClearSuffixes was ok until now
because the Lst functions had silently skipped any calls with invalid
arguments.  This silent skipping is a good argument to have strict
argument validation since it detects these unintended control flows.

Revision 1.114 / (download) - annotate - [select for diffs], Sun Aug 23 16:58:02 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.113: +21 -21 lines
Diff to previous 1.113 (colored)

make(1): reverse order of the Lst_Find parameters

The other callbacks all have (function, param), only the Lst_Find had
(param, function), which was inconsistent.

Revision 1.113 / (download) - annotate - [select for diffs], Sun Aug 23 06:54:01 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.112: +9 -14 lines
Diff to previous 1.112 (colored)

make(1): unroll loop in SuffFindArchiveDeps

The compiler had unrolled this loop anyway, and for humans it is more
readable as well.

The comments "must be first" and "must be second" came from a time when
the variables were stored in a linked list instead of a hash table.
Maybe this "must" was about performance back then.  Anyway, the tests
run fine with either order, and there is absolutely no evidence that the
order of these variables could have any effect.

Revision 1.112 / (download) - annotate - [select for diffs], Sat Aug 22 22:57:53 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.111: +4 -4 lines
Diff to previous 1.111 (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.111 / (download) - annotate - [select for diffs], Sat Aug 22 22:41:42 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.110: +5 -5 lines
Diff to previous 1.110 (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.110 / (download) - annotate - [select for diffs], Sat Aug 22 22:00:50 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.109: +4 -4 lines
Diff to previous 1.109 (colored)

make(1): make Lst_Prev stricter regarding null pointers

Revision 1.109 / (download) - annotate - [select for diffs], Sat Aug 22 21:42:38 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.108: +3 -6 lines
Diff to previous 1.108 (colored)

make(1): clean up headers

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

Revision 1.108 / (download) - annotate - [select for diffs], Sat Aug 22 18:44:22 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.107: +4 -4 lines
Diff to previous 1.107 (colored)

make(1): convert GNode type constants to enum

This allows debuggers to print symbolic names for the type flags.

The names of these constants need to be revised.  These flags probably
started as the 3 dependency operators (:, !, ::), and at that time, the
prefix OP_ made sense.  The other flags are not related to the type of
the dependency operator and could have been placed in GNode.flags as
well.

Revision 1.107 / (download) - annotate - [select for diffs], Sat Aug 22 15:43:32 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.106: +12 -10 lines
Diff to previous 1.106 (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.106 / (download) - annotate - [select for diffs], Sat Aug 22 15:17:09 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.105: +28 -28 lines
Diff to previous 1.105 (colored)

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

Revision 1.105 / (download) - annotate - [select for diffs], Sat Aug 22 14:54:48 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.104: +6 -6 lines
Diff to previous 1.104 (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.104 / (download) - annotate - [select for diffs], Sat Aug 22 14:39:12 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.103: +6 -6 lines
Diff to previous 1.103 (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.103 / (download) - annotate - [select for diffs], Sat Aug 22 13:28:20 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.102: +10 -10 lines
Diff to previous 1.102 (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.102 / (download) - annotate - [select for diffs], Sat Aug 22 11:35:00 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.101: +21 -21 lines
Diff to previous 1.101 (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.101 / (download) - annotate - [select for diffs], Sat Aug 22 08:01:34 2020 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.100: +4 -4 lines
Diff to previous 1.100 (colored)

make(1): remove form feeds in the code

Revision 1.100 / (download) - annotate - [select for diffs], Fri Aug 21 04:42:02 2020 UTC (13 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.99: +13 -19 lines
Diff to previous 1.99 (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.99 / (download) - annotate - [select for diffs], Fri Aug 21 04:09:12 2020 UTC (13 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.98: +7 -7 lines
Diff to previous 1.98 (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.98 / (download) - annotate - [select for diffs], Fri Aug 21 03:36:03 2020 UTC (13 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.97: +10 -10 lines
Diff to previous 1.97 (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.97 / (download) - annotate - [select for diffs], Fri Aug 21 02:20:48 2020 UTC (13 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.96: +29 -29 lines
Diff to previous 1.96 (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.96 / (download) - annotate - [select for diffs], Tue Aug 11 18:44:52 2020 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.95: +11 -8 lines
Diff to previous 1.95 (colored)

make(1): convert Suff.flags from #define to enum

This increases debugging support since the debugger can now display
symbolic names instead of an integer bit mask.

Revision 1.95 / (download) - annotate - [select for diffs], Mon Aug 10 19:53:19 2020 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.94: +5 -5 lines
Diff to previous 1.94 (colored)

make(1): replace str_concat with str_concat2 and str_concat3

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

Revision 1.94 / (download) - annotate - [select for diffs], Mon Aug 10 19:30:30 2020 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.93: +5 -5 lines
Diff to previous 1.93 (colored)

make(1): fix parameter name of str_concat

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

Revision 1.93 / (download) - annotate - [select for diffs], Sat Aug 1 14:47:49 2020 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.92: +7 -7 lines
Diff to previous 1.92 (colored)

make(1): use consistent indentation in source code

Tabs for multiples of 8, then spaces.

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

Revision 1.92 / (download) - annotate - [select for diffs], Sat Aug 1 09:55:00 2020 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.91: +4 -4 lines
Diff to previous 1.91 (colored)

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

Revision 1.91 / (download) - annotate - [select for diffs], Tue Jul 28 16:42:22 2020 UTC (14 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.90: +4 -4 lines
Diff to previous 1.90 (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.90 / (download) - annotate - [select for diffs], Sun Jul 26 20:21:31 2020 UTC (14 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.89: +4 -4 lines
Diff to previous 1.89 (colored)

make(1): make return value of Var_Parse constant

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

Revision 1.89 / (download) - annotate - [select for diffs], Sun Jul 19 12:26:17 2020 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.88: +5 -5 lines
Diff to previous 1.88 (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.88 / (download) - annotate - [select for diffs], Fri Jul 3 08:02:55 2020 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.87: +21 -21 lines
Diff to previous 1.87 (colored)

make(1): remove redundant parentheses around return values

Revision 1.87 / (download) - annotate - [select for diffs], Thu Jul 2 15:47:38 2020 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.86: +20 -20 lines
Diff to previous 1.86 (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.84.2.1 / (download) - annotate - [select for diffs], Wed Apr 26 02:53:35 2017 UTC (4 years, 5 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.84: +15 -14 lines
Diff to previous 1.84 (colored) next main 1.85 (colored)

Sync with HEAD

Revision 1.84.4.1 / (download) - annotate - [select for diffs], Fri Apr 21 16:54:14 2017 UTC (4 years, 5 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.84: +15 -14 lines
Diff to previous 1.84 (colored) next main 1.85 (colored)

Sync with HEAD

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

Assert archive member syntax.  Cite who guarantees it.

Revision 1.85 / (download) - annotate - [select for diffs], Sun Apr 16 19:53:58 2017 UTC (4 years, 6 months ago) by riastradh
Branch: MAIN
Changes since 1.84: +7 -14 lines
Diff to previous 1.84 (colored)

Use, don't kludge, MAKE_ATTR_UNUSED.

CID 1300234
CID 1300237
CID 1300238
CID 1300245
CID 1300255
CID 1300267
CID 1300284

Revision 1.84 / (download) - annotate - [select for diffs], Thu Jun 30 05:34:04 2016 UTC (5 years, 3 months ago) by dholland
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, localcount-20160914, bouyer-socketcan-base
Branch point for: pgoyette-localcount, bouyer-socketcan
Changes since 1.83: +13 -13 lines
Diff to previous 1.83 (colored)

Fix DEBUG_SRC build. Partly from PR 51191.

Revision 1.83 / (download) - annotate - [select for diffs], Thu Jun 30 05:31:00 2016 UTC (5 years, 3 months ago) by dholland
Branch: MAIN
Changes since 1.82: +15 -7 lines
Diff to previous 1.82 (colored)

Cleanse an old mangy way of avoiding an unused variable warning.
PR 51191 from David Binderman.

Revision 1.82 / (download) - annotate - [select for diffs], Thu Jun 30 05:28:23 2016 UTC (5 years, 3 months ago) by dholland
Branch: MAIN
Changes since 1.81: +4 -4 lines
Diff to previous 1.81 (colored)

Fix botched logic; PR 51191 from David Binderman.

Revision 1.81 / (download) - annotate - [select for diffs], Tue Mar 15 18:30:14 2016 UTC (5 years, 7 months ago) by matthias
Branch: MAIN
Changes since 1.80: +6 -5 lines
Diff to previous 1.80 (colored)

Another small change to make archive member rules work. With this change
archive member rules seem to work as expected again.

Revision 1.80 / (download) - annotate - [select for diffs], Tue Mar 15 06:25:14 2016 UTC (5 years, 7 months ago) by matthias
Branch: MAIN
Changes since 1.79: +14 -5 lines
Diff to previous 1.79 (colored)

dynamic dependencies for library member targets are working again.

Revision 1.79 / (download) - annotate - [select for diffs], Mon Mar 14 07:42:15 2016 UTC (5 years, 7 months ago) by matthias
Branch: MAIN
Changes since 1.78: +8 -3 lines
Diff to previous 1.78 (colored)

make $@ an alias for $! in archive member rules (compatibility with
other makes).

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

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

Revision 1.77 / (download) - annotate - [select for diffs], Sun Jan 17 17:45:21 2016 UTC (5 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.76: +5 -7 lines
Diff to previous 1.76 (colored)

remove free NULL checks (Tilman Sauerbeck)

Revision 1.76 / (download) - annotate - [select for diffs], Sat Jan 9 00:55:17 2016 UTC (5 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.75: +5 -5 lines
Diff to previous 1.75 (colored)

Preserve $$ in := assignments..

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

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

Revision 1.75 / (download) - annotate - [select for diffs], Sun Dec 20 22:44:10 2015 UTC (5 years, 9 months ago) by sjg
Branch: MAIN
Changes since 1.74: +18 -19 lines
Diff to previous 1.74 (colored)

Suff_ClearSuffixes() needs to re-initialize suffNull,
otherwise its children retain old suffixes.
Have Suff_Init() call Suff_ClearSuffixes() for consistency.

Revision 1.74 / (download) - annotate - [select for diffs], Sun Oct 11 04:51:24 2015 UTC (6 years ago) by sjg
Branch: MAIN
Changes since 1.73: +5 -5 lines
Diff to previous 1.73 (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.73 / (download) - annotate - [select for diffs], Sun Sep 7 20:55:34 2014 UTC (7 years, 1 month ago) by joerg
Branch: MAIN
Changes since 1.72: +1449 -1647 lines
Diff to previous 1.72 (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.72 / (download) - annotate - [select for diffs], Wed Aug 27 08:50:38 2014 UTC (7 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.71: +14 -11 lines
Diff to previous 1.71 (colored)

Make .INVISIBLE nodes be ignored by suffix transformations.

Revision 1.71 / (download) - annotate - [select for diffs], Sat Aug 23 15:05:40 2014 UTC (7 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.70: +1642 -1447 lines
Diff to previous 1.70 (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.69.2.1 / (download) - annotate - [select for diffs], Thu May 22 11:42:46 2014 UTC (7 years, 4 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.69: +96 -95 lines
Diff to previous 1.69 (colored) next main 1.70 (colored)

sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.69.8.1 / (download) - annotate - [select for diffs], Sun Jun 23 06:29:00 2013 UTC (8 years, 3 months ago) by tls
Branch: tls-maxphys
Changes since 1.69: +96 -95 lines
Diff to previous 1.69 (colored) next main 1.70 (colored)

resync from head

Revision 1.70 / (download) - annotate - [select for diffs], Sat May 18 13:13:34 2013 UTC (8 years, 5 months ago) by sjg
Branch: MAIN
CVS Tags: yamt-pagecache-base9, 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
Changes since 1.69: +96 -95 lines
Diff to previous 1.69 (colored)

We cannot skip all Suff processing for .PHONY targets,
else, srcs which are wildcards do not get expanded as needed.

Revision 1.69 / (download) - annotate - [select for diffs], Thu Sep 29 23:38:04 2011 UTC (10 years ago) by sjg
Branch: MAIN
CVS Tags: yamt-pagecache-tag8, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, dholland-make-base, agc-symver-base, agc-symver
Branch point for: yamt-pagecache, tls-maxphys
Changes since 1.68: +15 -6 lines
Diff to previous 1.68 (colored)

Make sure .PHONY targets get .TARGET set.
This wasn't happening when a dependency of .END.
Set .PREFIX too and add a unit-test.

PR: 43534

Revision 1.68 / (download) - annotate - [select for diffs], Thu Jun 30 20:09:42 2011 UTC (10 years, 3 months ago) by wiz
Branch: MAIN
Changes since 1.67: +4 -4 lines
Diff to previous 1.67 (colored)

dependant -> dependent

Revision 1.67 / (download) - annotate - [select for diffs], Fri Jan 23 21:58:28 2009 UTC (12 years, 8 months ago) by dsl
Branch: MAIN
CVS Tags: matt-premerge-20091211, matt-mips64-premerge-20101231, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Changes since 1.66: +23 -25 lines
Diff to previous 1.66 (colored)

Sprinkle some const.
In particular for Lst_Find() and Lst_FindFrom().
Remove some unneeded casts and some now-undeeded UNCONST().

Revision 1.66 / (download) - annotate - [select for diffs], Fri Jan 23 21:26:30 2009 UTC (12 years, 8 months ago) by dsl
Branch: MAIN
Changes since 1.65: +28 -28 lines
Diff to previous 1.65 (colored)

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

Revision 1.65 / (download) - annotate - [select for diffs], Sat Dec 13 15:19:29 2008 UTC (12 years, 10 months ago) by dsl
Branch: MAIN
Changes since 1.64: +59 -59 lines
Diff to previous 1.64 (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.64 / (download) - annotate - [select for diffs], Mon Oct 6 22:09:21 2008 UTC (13 years ago) by joerg
Branch: MAIN
CVS Tags: netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2
Changes since 1.63: +18 -18 lines
Diff to previous 1.63 (colored)

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

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

Revision 1.63 / (download) - annotate - [select for diffs], Fri Feb 15 21:29:50 2008 UTC (13 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-pf42, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, mjf-devfs2-base, mjf-devfs2, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-nbase, hpcarm-cleanup-base
Changes since 1.62: +23 -23 lines
Diff to previous 1.62 (colored)

back all changes out until I fix it properly.

Revision 1.62 / (download) - annotate - [select for diffs], Thu Feb 14 22:11:20 2008 UTC (13 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: christos-broken
Changes since 1.61: +26 -26 lines
Diff to previous 1.61 (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.61 / (download) - annotate - [select for diffs], Fri Nov 17 22:07:39 2006 UTC (14 years, 11 months ago) by dsl
Branch: MAIN
CVS Tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-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, netbsd-4, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-base, matt-armv6, hpcarm-cleanup, cube-autoconf-base, cube-autoconf
Changes since 1.60: +11 -3 lines
Diff to previous 1.60 (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.60 / (download) - annotate - [select for diffs], Sat Nov 11 21:21:17 2006 UTC (14 years, 11 months ago) by dsl
Branch: MAIN
Changes since 1.59: +6 -6 lines
Diff to previous 1.59 (colored)

Point a few diagnostic printfs (the ones that got away) to debug_file
instead of stdout.

Revision 1.59 / (download) - annotate - [select for diffs], Fri Oct 27 21:00:19 2006 UTC (14 years, 11 months ago) by dsl
Branch: MAIN
Changes since 1.58: +65 -65 lines
Diff to previous 1.58 (colored)

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

Revision 1.58 / (download) - annotate - [select for diffs], Wed Oct 25 20:17:40 2006 UTC (14 years, 11 months ago) by dsl
Branch: MAIN
Changes since 1.57: +6 -6 lines
Diff to previous 1.57 (colored)

Rename Lst_Append() to Lst_InsertAfter() and Lst_Insert() to Lst_InsertBefore()
to better explain their actions.

Revision 1.57 / (download) - annotate - [select for diffs], Wed Oct 25 20:05:59 2006 UTC (14 years, 11 months ago) by dsl
Branch: MAIN
Changes since 1.56: +4 -4 lines
Diff to previous 1.56 (colored)

Fix previous - need to add a lstPrev()

Revision 1.56 / (download) - annotate - [select for diffs], Wed Oct 25 19:44:10 2006 UTC (14 years, 11 months ago) by dsl
Branch: MAIN
Changes since 1.55: +158 -156 lines
Diff to previous 1.55 (colored)

Only do dynamic dependecy expansion once, and follow by a single filename
globbing.
The old behaviour was the perform variable expansion and globbing on the
output of both the variable expansion and globbing.  Which allows some very
strange behaviour if, for example, globbed filenames contain $ symbols.
Unconditionally add new nodes from these expansions even if the names are
already children.  The .WAIT code needs the order of children preserved.

Revision 1.55 / (download) - annotate - [select for diffs], Sun Oct 15 08:38:22 2006 UTC (15 years ago) by dsl
Branch: MAIN
Changes since 1.54: +58 -58 lines
Diff to previous 1.54 (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.54 / (download) - annotate - [select for diffs], Thu Jun 29 22:02:06 2006 UTC (15 years, 3 months ago) by rillig
Branch: MAIN
CVS Tags: abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.53: +4 -4 lines
Diff to previous 1.53 (colored)

Fixed gcc warnings about signed vs. unsigned in comparisons.

Revision 1.53 / (download) - annotate - [select for diffs], Fri Mar 31 21:58:08 2006 UTC (15 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: chap-midi-nbase, chap-midi-base, chap-midi
Changes since 1.52: +7 -8 lines
Diff to previous 1.52 (colored)

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

Revision 1.52 / (download) - annotate - [select for diffs], Sun Jan 8 12:59:52 2006 UTC (15 years, 9 months ago) by dsl
Branch: MAIN
Changes since 1.51: +14 -3 lines
Diff to previous 1.51 (colored)

Don't (try to) use files marked .OPTIONAL as implicit sources.
There existance hasn't been verified at the point the implicit rules are
checked.

Revision 1.51 / (download) - annotate - [select for diffs], Mon Aug 8 16:42:54 2005 UTC (16 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.50: +32 -32 lines
Diff to previous 1.50 (colored)

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

Revision 1.50 / (download) - annotate - [select for diffs], Fri Aug 5 00:53:18 2005 UTC (16 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.49: +9 -9 lines
Diff to previous 1.49 (colored)

More KNF cleanups from Max Okumoto

Revision 1.49 / (download) - annotate - [select for diffs], Mon Jul 25 22:55:58 2005 UTC (16 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.48: +59 -59 lines
Diff to previous 1.48 (colored)

Whitespace KNF cleanup from Max Okumoto

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

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

Revision 1.47 / (download) - annotate - [select for diffs], Wed Dec 29 01:55:25 2004 UTC (16 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.46: +25 -14 lines
Diff to previous 1.46 (colored)

Add comments in the pmake style, and factor out a local variable.
No functional change.

Revision 1.46 / (download) - annotate - [select for diffs], Wed Dec 29 00:43:02 2004 UTC (16 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.45: +45 -33 lines
Diff to previous 1.45 (colored)

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

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

Revision 1.38.2.1 / (download) - annotate - [select for diffs], Fri Jul 23 15:03:58 2004 UTC (17 years, 3 months ago) by tron
Branch: netbsd-1-6
Changes since 1.38: +9 -9 lines
Diff to previous 1.38 (colored) next main 1.39 (colored)

Apply patch (requested by dbj in ticket 1724):
Fix problems when building the netbsd-1-6 branch with GCC 3.3.3.

Revision 1.44.2.1 / (download) - annotate - [select for diffs], Mon May 10 15:41:59 2004 UTC (17 years, 5 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.44: +4 -4 lines
Diff to previous 1.44 (colored) next main 1.45 (colored)

Pull up revision 1.45 (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.45 / (download) - annotate - [select for diffs], Fri May 7 00:04:40 2004 UTC (17 years, 5 months ago) by ross
Branch: MAIN
Changes since 1.44: +4 -4 lines
Diff to previous 1.44 (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.44 / (download) - annotate - [select for diffs], Fri Feb 13 17:56:17 2004 UTC (17 years, 8 months ago) by wiz
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.43: +4 -4 lines
Diff to previous 1.43 (colored)

Spell the plural of suffix "suffixes", not "suffices".
Inspired by PR 24400 by Todd Vierling.

Revision 1.43 / (download) - annotate - [select for diffs], Sun Jan 11 17:24:25 2004 UTC (17 years, 9 months ago) by dsl
Branch: MAIN
Changes since 1.42: +52 -50 lines
Diff to previous 1.42 (colored)

Reindent search loop in SuffFindCmds using 'continue' and 'break' instead
of netsted ifs.  No logic change.

Revision 1.42 / (download) - annotate - [select for diffs], Thu Aug 7 11:14:57 2003 UTC (18 years, 2 months ago) by agc
Branch: MAIN
Changes since 1.41: +33 -3 lines
Diff to previous 1.41 (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.41 / (download) - annotate - [select for diffs], Mon Jul 14 18:19:13 2003 UTC (18 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.40: +7 -5 lines
Diff to previous 1.40 (colored)

Pass WARNS=3

Revision 1.40 / (download) - annotate - [select for diffs], Thu Dec 5 15:56:52 2002 UTC (18 years, 10 months ago) by scw
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.39: +9 -9 lines
Diff to previous 1.39 (colored)

Lst exp -> Lst explist, to avoid warnings about gcc-current's
builtin exp() function.

Revision 1.39 / (download) - annotate - [select for diffs], Sat Jun 15 18:24:57 2002 UTC (19 years, 4 months ago) by wiz
Branch: MAIN
Changes since 1.38: +169 -143 lines
Diff to previous 1.38 (colored)

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

Revision 1.38 / (download) - annotate - [select for diffs], Mon Feb 4 17:24:57 2002 UTC (19 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001
Branch point for: netbsd-1-6
Changes since 1.37: +5 -5 lines
Diff to previous 1.37 (colored)

Remove OP_NOSUFF, fix OP_MADE in compat mode [from pk], and make the OP_MADE
comment reflect reality.

Revision 1.37 / (download) - annotate - [select for diffs], Sun Feb 3 21:41:44 2002 UTC (19 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.36: +5 -5 lines
Diff to previous 1.36 (colored)

Bring down the number of stat(2) system calls from 682 to 294. This change
adds a .NOSUFF directive that has been applied to targets that have been
already made, and are not supposed to have suffix rules applied to them.

Revision 1.36 / (download) - annotate - [select for diffs], Sun Jan 27 01:50:55 2002 UTC (19 years, 8 months ago) by reinoud
Branch: MAIN
Changes since 1.35: +3 -4 lines
Diff to previous 1.35 (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.35 / (download) - annotate - [select for diffs], Wed Nov 14 19:27:40 2001 UTC (19 years, 11 months ago) by tv
Branch: MAIN
Changes since 1.34: +4 -4 lines
Diff to previous 1.34 (colored)

Fix a very old and annoying bug: Adding suffixes to sufflist wasn't setting
a refCount of 1 to indicate its presence on sufflist.  Hence suffixes were
being removed by Suff_EndTransform() and being freed before all the
referential links were removed.  This resulted in a malloc warning on 1.5.x:
  make in free(): warning: chunk is already free.

This could be reproduced with the following simple Makefile passed to
"make -r":
=====
.SUFFIXES: .l .c
.l.c:
foo:

Revision 1.34 / (download) - annotate - [select for diffs], Mon Aug 20 12:00:55 2001 UTC (20 years, 2 months ago) by wiz
Branch: MAIN
Changes since 1.33: +4 -4 lines
Diff to previous 1.33 (colored)

precede, not preceed.

Revision 1.33 / (download) - annotate - [select for diffs], Tue Jun 12 23:36:18 2001 UTC (20 years, 4 months ago) by sjg
Branch: MAIN
Changes since 1.32: +17 -17 lines
Diff to previous 1.32 (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.32 / (download) - annotate - [select for diffs], Tue May 8 15:15:53 2001 UTC (20 years, 5 months ago) by aymeric
Branch: MAIN
Changes since 1.31: +31 -26 lines
Diff to previous 1.31 (colored)

Fix core dump triggered by a .DEFAULT target with no commands.
Bug reported privately by Nicolas Ollinger <nollinge@ens-lyon.fr>.

You can trigger this bug prior to updating your sources with for example:
% cat > Makefile <<EOF
.DEFAULT:
a
EOF
% make

Revision 1.28.2.1 / (download) - annotate - [select for diffs], Fri Jun 23 16:39:44 2000 UTC (21 years, 4 months ago) by minoura
Branch: minoura-xpg4dl
Changes since 1.28: +12 -17 lines
Diff to previous 1.28 (colored) next main 1.29 (colored)

Sync w/ netbsd-1-5-base.

Revision 1.31 / (download) - annotate - [select for diffs], Sun Jun 11 07:39:53 2000 UTC (21 years, 4 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: +12 -17 lines
Diff to previous 1.30 (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:34 2000 UTC (21 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.29: +14 -9 lines
Diff to previous 1.29 (colored)

Back out last night's optimization for now.

Revision 1.29 / (download) - annotate - [select for diffs], Sat Jun 10 21:44:09 2000 UTC (21 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.28: +12 -17 lines
Diff to previous 1.28 (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.28 / (download) - annotate - [select for diffs], Sat Jan 22 19:28:11 2000 UTC (21 years, 9 months ago) by mycroft
Branch: MAIN
CVS Tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Changes since 1.27: +5 -4 lines
Diff to previous 1.27 (colored)

Don't apply suffix rules for .PHONY targets.  (gmake doesn't do this either.)

Revision 1.27 / (download) - annotate - [select for diffs], Thu Sep 16 00:54:15 1999 UTC (22 years, 1 month 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.26: +4 -4 lines
Diff to previous 1.26 (colored)

Some minor cleanup of :: tests.

Revision 1.26 / (download) - annotate - [select for diffs], Wed Sep 15 10:47:44 1999 UTC (22 years, 1 month ago) by mycroft
Branch: MAIN
Changes since 1.25: +5 -24 lines
Diff to previous 1.25 (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.25 / (download) - annotate - [select for diffs], Wed Sep 15 08:43:22 1999 UTC (22 years, 1 month ago) by mycroft
Branch: MAIN
Changes since 1.24: +11 -3 lines
Diff to previous 1.24 (colored)

Don't bother iterating through all the data structures to free(3) everything
right before exiting.
(The code is still present, `#ifdef CLEANUP', in case someone needs it...)

Revision 1.24 / (download) - annotate - [select for diffs], Wed Sep 15 03:59:44 1999 UTC (22 years, 1 month ago) by mycroft
Branch: MAIN
Changes since 1.23: +31 -29 lines
Diff to previous 1.23 (colored)

Avoid using Lst_Member() in SuffExpandChildren(), by avoiding Lst_ForEach() and
passing in the LstNode of the child being inspected.  Shaves off another few %,
particularly when there are long child lists containing $ expansions (e.g. in
libc).

Revision 1.23 / (download) - annotate - [select for diffs], Sun Nov 1 03:07:34 1998 UTC (22 years, 11 months ago) by itohy
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.22: +4 -3 lines
Diff to previous 1.22 (colored)

Reduced memory leaks.
I found some more leaks, but are not in inside of iterations.

Revision 1.22 / (download) - annotate - [select for diffs], Sun Nov 1 03:05:03 1998 UTC (22 years, 11 months ago) by itohy
Branch: MAIN
Changes since 1.21: +40 -19 lines
Diff to previous 1.21 (colored)

If the target name is shorter than the suffix,
the previous garbage bytes may be read.
Example: "make n" --- target = n, suffix = .ln

Changing interface of SuffSuffIsSuffix() is required to fix this bug.

Revision 1.21 / (download) - annotate - [select for diffs], Fri Sep 18 20:20:52 1998 UTC (23 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.20: +7 -5 lines
Diff to previous 1.20 (colored)

PR/6162: Greg A. Woods: pmake does not add suffix rules if gnodes have children.
	 This is traditional make behavior (Solaris make does the same), but
	 GNU does not. Lets see what breaks.

Revision 1.20 / (download) - annotate - [select for diffs], Sat Jul 4 21:53:11 1998 UTC (23 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.19: +10 -4 lines
Diff to previous 1.19 (colored)

Fix access to freed memory; pointed out by Todd Miller.

Revision 1.19 / (download) - annotate - [select for diffs], Thu Jul 2 23:30:18 1998 UTC (23 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.18: +14 -5 lines
Diff to previous 1.18 (colored)

PR/5690: Wolfgang Rupprecht: deleting a suffix that has 0 source references
	 causes core-dump. Fix: when an unused suffix gets removed, delete
	 it from the suffix list.

Revision 1.18 / (download) - annotate - [select for diffs], Sun Sep 28 03:31:11 1997 UTC (24 years ago) by lukem
Branch: MAIN
CVS Tags: netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002, netbsd-1-3-PATCH001, netbsd-1-3-BETA, netbsd-1-3
Changes since 1.17: +6 -2 lines
Diff to previous 1.17 (colored)

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

Revision 1.17 / (download) - annotate - [select for diffs], Tue Jul 1 21:17:39 1997 UTC (24 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.16: +4 -2 lines
Diff to previous 1.16 (colored)

Add WARNS=1
RCSID police

Revision 1.16 / (download) - annotate - [select for diffs], Thu May 8 21:24:50 1997 UTC (24 years, 5 months ago) by gwr
Branch: MAIN
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored)

Add the new .NOPATH feature which can be used to disable .PATH search
for particular targets, i.e. .depend, objects, etc.  (from Christos).

Revision 1.15 / (download) - annotate - [select for diffs], Tue May 6 22:06:58 1997 UTC (24 years, 5 months ago) by mycroft
Branch: MAIN
Changes since 1.14: +45 -43 lines
Diff to previous 1.14 (colored)

Don't do a suffix search for a .PHONY target.

Revision 1.14 / (download) - annotate - [select for diffs], Fri May 2 14:24:32 1997 UTC (24 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.13: +134 -82 lines
Diff to previous 1.13 (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.11.4.1 / (download) - annotate - [select for diffs], Sun Jan 26 05:51:52 1997 UTC (24 years, 8 months ago) by rat
Branch: netbsd-1-2
CVS Tags: netbsd-1-2-PATCH001
Changes since 1.11: +51 -51 lines
Diff to previous 1.11 (colored) next main 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:17 1996 UTC (24 years, 9 months ago) by tls
Branch: WFJ-920714, CSRG
CVS Tags: lite-2
Changes since 1.1.1.1: +424 -148 lines
Diff to previous 1.1.1.1 (colored)

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

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

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

Revision 1.11 / (download) - annotate - [select for diffs], Thu Nov 2 23:55:08 1995 UTC (25 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-BETA
Branch point for: netbsd-1-2
Changes since 1.10: +20 -9 lines
Diff to previous 1.10 (colored)

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

	    foo: bar baz

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

Revision 1.10 / (download) - annotate - [select for diffs], Mon Sep 25 02:46:30 1995 UTC (26 years, 1 month 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.9: +2 -12 lines
Diff to previous 1.9 (colored)

Revert previous suffix fix. If the .a suffix is present and a .c.a rule is
there, then the rule should be applied. This is the correct behavior.

Revision 1.9 / (download) - annotate - [select for diffs], Fri Sep 22 00:42:10 1995 UTC (26 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.8: +15 -4 lines
Diff to previous 1.8 (colored)

Don't apply the default suffix rules for nodes that are not in our
current directory because we could be building things outside our
directory that were not meant to be build... Fixes PR/1488

Revision 1.8 / (download) - annotate - [select for diffs], Wed Jun 14 15:19:59 1995 UTC (26 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.7: +7 -2 lines
Diff to previous 1.7 (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.7 / (download) - annotate - [select for diffs], Sat Feb 4 23:44:43 1995 UTC (26 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.6: +16 -3 lines
Diff to previous 1.6 (colored)

str.c: Don't free NULL; does not work with non posix frees.
var.c: Minor memory leak plugged.
suff.c: Don't add extra sources on the null suffix if it has dependency
	lines or commands attached to it [POSIX says so]

Revision 1.6 / (download) - annotate - [select for diffs], Mon Jun 6 22:45:44 1994 UTC (27 years, 4 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.5: +353 -150 lines
Diff to previous 1.5 (colored)

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

Revision 1.5 / (download) - annotate - [select for diffs], Wed Mar 23 00:52:14 1994 UTC (27 years, 7 months ago) by jtc
Branch: MAIN
Changes since 1.4: +34 -2 lines
Diff to previous 1.4 (colored)

Fixes from Christos Zoulas:
The following two patches fix a couple of problems with make(1)

1. Null Suffixes were not being copied, but they were being free'd
   This caused rules of the form:

   .c:
	${CC} ...

   to access invalid memory and potentially core dump..
   [That was always broken; I did not break that one :-)]

2. My recent fixes to parse ${VAR:%.foo=%.bar} handled the null string
   case incorrectly (${VAR:=.c} was broken).

Revision 1.4 / (download) - annotate - [select for diffs], Sat Mar 5 00:35:11 1994 UTC (27 years, 7 months ago) by cgd
Branch: MAIN
Changes since 1.3: +62 -35 lines
Diff to previous 1.3 (colored)

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

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

Include appropriate header files to bring prototypes into scope.

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

Add RCS identifiers.

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

initial import of 386bsd-0.1 sources

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

Initial revision

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




CVSweb <webmaster@jp.NetBSD.org>