The NetBSD Project

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

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

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.329 / (download) - annotate - [select for diffs], Sun Mar 10 02:53:37 2024 UTC (2 weeks, 4 days ago) by sjg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.328: +2 -1 lines
Diff to previous 1.328 (colored)

make: record exit status in GNode

SetErrorVars can now set .ERROR_EXIT which allows
a .ERROR target to ignore the case of .ERROR_EXIT == 6
which means failure happened elsewhere.

Reviewed by:

Revision 1.328 / (download) - annotate - [select for diffs], Fri Mar 1 16:41:42 2024 UTC (3 weeks, 6 days ago) by sjg
Branch: MAIN
Changes since 1.327: +2 -2 lines
Diff to previous 1.327 (colored)

make: export target scope values

Pass target scope to Var_ReexportVars so that a target process
will see the correct values in its env.
We must then mark any Global scope variable as unexported
so targets without local value get the Global one.

Revision 1.327 / (download) - annotate - [select for diffs], Sun Dec 17 09:02:26 2023 UTC (3 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.326: +2 -2 lines
Diff to previous 1.326 (colored)

make: clean up unused return value of str2Lst_Append

No functional change.

Revision 1.326 / (download) - annotate - [select for diffs], Thu Nov 2 04:50:44 2023 UTC (4 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.325: +1 -2 lines
Diff to previous 1.325 (colored)

make: inline a single-line cross-file function

No functional change.

Revision 1.325 / (download) - annotate - [select for diffs], Sun Sep 10 11:52:29 2023 UTC (6 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.324: +3 -3 lines
Diff to previous 1.324 (colored)

make: remove redundant 'extern' from function declaration

Revision 1.324 / (download) - annotate - [select for diffs], Sat Jun 24 07:02:24 2023 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.323: +2 -2 lines
Diff to previous 1.323 (colored)

make: remove redundant 'extern' in function declaration

No binary change.

Revision 1.323 / (download) - annotate - [select for diffs], Tue Jun 20 09:25:33 2023 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.322: +10 -2 lines
Diff to previous 1.322 (colored)

make: allow targets to be used as multiple-inclusion guards

This style is used by FreeBSD, among others.

Revision 1.322 / (download) - annotate - [select for diffs], Mon Jun 19 12:53:57 2023 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.321: +4 -1 lines
Diff to previous 1.321 (colored)

make: if a makefile is protected by a guard, only include it once

"looks reasonable" sjg@

Revision 1.321 / (download) - annotate - [select for diffs], Fri Jun 16 07:12:46 2023 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.320: +3 -3 lines
Diff to previous 1.320 (colored)

make: remove parameter names from function declarations

No binary change.

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

make: shorten function names, clean up comments

No functional change.

Revision 1.319 / (download) - annotate - [select for diffs], Tue Mar 28 14:39:31 2023 UTC (12 months ago) by rillig
Branch: MAIN
Changes since 1.318: +4 -1 lines
Diff to previous 1.318 (colored)

make: declare all common symbols in headers, unexport others

No functional change.

Revision 1.318 / (download) - annotate - [select for diffs], Thu Mar 9 07:06:43 2023 UTC (12 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.317: +3 -2 lines
Diff to previous 1.317 (colored)

make: document how read-only variables can be made read-write

Revision 1.317 / (download) - annotate - [select for diffs], Sat Feb 18 11:16:09 2023 UTC (13 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.316: +9 -1 lines
Diff to previous 1.316 (colored)

make: fix parsing of unevaluated subexpressions with unbalanced '{}'

Since var.c 1.323 from 2020-07-26, modifiers containing unbalanced
braces or parentheses were parsed differently, depending on whether they
were relevant or not.

For example, the expression '${VAR:...}' is enclosed with braces. When
this expression has a modifier ':S,},}},g' that would double each '}' in
that expression, the parser got confused:

If the expression was relevant, the modifier was parsed as usual, taking
into account that the 3 '}' in the modifier are ordinary characters.

If the expression was irrelevant, the parser only counted the '{' and
the '}', without taking into account that a '}' might be escaped by a
'\' or be an ordinary character.  Parsing therefore stopped at the first
'}', assuming it would finish the expression '${VAR:S,}'.

This parsing mode of only counting balanced '{' and '}' makes sense for
the modifier ':@var@...@', which expands each word of the expression
using the template from the '...'.  These templates tend to be simple
enough that counting the '{' and '}' suffices.

Revision 1.316 / (download) - annotate - [select for diffs], Wed Feb 15 06:52:58 2023 UTC (13 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.315: +1 -8 lines
Diff to previous 1.315 (colored)

make: inline macros for variable names

The variable name '.MAKEOVERRIDES' was already used in the non-macro
form.

No binary change.

Revision 1.315 / (download) - annotate - [select for diffs], Wed Feb 15 06:31:51 2023 UTC (13 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.314: +1 -2 lines
Diff to previous 1.314 (colored)

make: inline macro for variable name ".MAKE.EXPORTED"

The variable name is distinctive enough to be searched directly in the
code instead of having a named constant for it.

No binary change.

Revision 1.314 / (download) - annotate - [select for diffs], Tue Feb 14 21:56:47 2023 UTC (13 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.313: +1 -25 lines
Diff to previous 1.313 (colored)

make: remove redundant type VarParseResult

No functional change.

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

make: clean up calls to Var_Subst

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

No functional change.

Revision 1.312 / (download) - annotate - [select for diffs], Tue Feb 14 21:08:00 2023 UTC (13 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.311: +2 -2 lines
Diff to previous 1.311 (colored)

make: reduce complexity of evaluating expressions

No functional change.

Revision 1.311 / (download) - annotate - [select for diffs], Thu Jan 26 20:48:17 2023 UTC (14 months ago) by sjg
Branch: MAIN
Changes since 1.310: +2 -1 lines
Diff to previous 1.310 (colored)

make: some variables should be read-only

Make variables like .newline and .MAKE.{GID,PID,PPID,UID} read-only.

Reviewed by: rillig

Revision 1.310 / (download) - annotate - [select for diffs], Mon Jan 23 23:01:52 2023 UTC (14 months ago) by sjg
Branch: MAIN
Changes since 1.309: +2 -1 lines
Diff to previous 1.309 (colored)

make: .[NO]READONLY for control of read-only variables

Reviewed by: rillig

Revision 1.309 / (download) - annotate - [select for diffs], Thu Jan 19 21:33:06 2023 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.308: +1 -2 lines
Diff to previous 1.308 (colored)

make: inline macro for variable name

This fixes the inconsistency of using the macro name in one place and
its value in another place (since 2010).

No binary change.

Revision 1.308 / (download) - annotate - [select for diffs], Mon Oct 10 21:17:25 2022 UTC (17 months, 2 weeks ago) by rillig
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10
Changes since 1.307: +2 -2 lines
Diff to previous 1.307 (colored)

make: change return type of unlink_file back to int

As unlink_file is a wrapper around unlink, use the same encoding for the
possible return values as in the wrapped function.  This consistency is
more important than expressing all possible return values in the return
type 'bool'.

https://mail-index.netbsd.org/tech-toolchain/2022/10/06/msg004155.html

No functional change.

Revision 1.307 / (download) - annotate - [select for diffs], Sat Sep 24 16:13:48 2022 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.306: +4 -4 lines
Diff to previous 1.306 (colored)

make: clean up tracking of depth of nested .if directives

The variable cond_min_depth was redundant.  It was only accessed while
parsing the makefiles.  Merging it into struct IncludedFile removes the
possible confusion between cond_min_depth and including_cond_min_depth.

No functional change.

Revision 1.306 / (download) - annotate - [select for diffs], Sat Sep 24 10:26:31 2022 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.305: +4 -4 lines
Diff to previous 1.305 (colored)

make: fix variable and function names relating to .if nesting

The previous names were confusing since they suggested that cond_depth
instead of cond_min_depth would be saved and restored.

No functional change.

Revision 1.305 / (download) - annotate - [select for diffs], Fri Sep 23 22:58:15 2022 UTC (18 months ago) by sjg
Branch: MAIN
Changes since 1.304: +2 -2 lines
Diff to previous 1.304 (colored)

Cond_reset_depth just use cond_min_depth

To avoid errors from unclosed conditionals on .break
it is sufficient to just set cond_depth = cond_min_depth.

Patch from rillig

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

make: add .break to terminate .for loop early

When .break is encountered within a .for loop
it causes immediate termination.

Outside of a .for loop .break causes a parse error.

Reviewed by: christos

Revision 1.303 / (download) - annotate - [select for diffs], Sun Jun 12 13:37:32 2022 UTC (21 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.302: +2 -2 lines
Diff to previous 1.302 (colored)

make: reorganize Parse_Error

Determining the location where the error occurred is now done by
ParseVErrorInternal.  This frees the remaining code from keeping the
filename and the line number together.  It also makes Parse_Error short
enough that it might be worth providing a separate function for each of
the 3 log levels.

No functional change.

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

make: allow to randomize build order of targets

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

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

Revision 1.301 / (download) - annotate - [select for diffs], Sat May 7 08:01:20 2022 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.300: +2 -2 lines
Diff to previous 1.300 (colored)

make: rename Compat_Run to Compat_MakeAll

No functional change.

Revision 1.300 / (download) - annotate - [select for diffs], Mon Apr 18 15:06:27 2022 UTC (23 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.299: +12 -1 lines
Diff to previous 1.299 (colored)

make: only switch to POSIX mode if '.POSIX:' is the first line

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html
says that in order to make a makefile POSIX-conforming, its first
non-comment line must be the special dependency line '.POSIX:' without
any source dependencies.

Previously, make switched to POSIX mode even if such a line occurred
anywhere else, which was allowed by POSIX but was deep in the
"unspecified behavior" area.  For NetBSD make, there is no big
difference since it doesn't ship any <posix.mk> file, this change mainly
affects the bmake distribution.

Previously, makefiles that contain '.POSIX:' somewhere in the middle
could fail due to <posix.mk> resetting .SUFFIXES, among other things.

Suggested by Simon J. Gerraty, who also reviewed an earlier version of
this change.

Revision 1.299 / (download) - annotate - [select for diffs], Sat Mar 26 14:02:40 2022 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.298: +2 -2 lines
Diff to previous 1.298 (colored)

make: prefer 'long long' over 'long' on 32-bit C99 platforms

When sorting the words of an expression numerically using the modifier
':On' (added on 2021-07-30), use 64-bit numbers even on 32-bit
platforms.  A typical use case is comparing file sizes.

When tracing the execution of jobs, fix an integer overflow after 2038.
32-bit platforms that use a pre-C99 compiler still have this problem.

No change to the test suite since most tests simply skip any potential
differences between 32-bit platforms and 64-bit platforms (see
varmod-order-numeric.mk) or already account for both variants (see
varmod-localtime.mk).

Revision 1.298 / (download) - annotate - [select for diffs], Sat Feb 5 00:26:21 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.297: +6 -2 lines
Diff to previous 1.297 (colored)

make: improve C90 support

Do not use inline functions, remove trailing comma in enum declaration,
do not use 'long long' for printing a timestamp.  This re-introduces the
Year 2038 Problem for pre-C99 compilers when printing the trace log, but
that is a seldom used feature.

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

make: use unsigned int for line numbers everywhere

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

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

No functional change.

Revision 1.296 / (download) - annotate - [select for diffs], Mon Jan 31 20:49:27 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.295: +3 -3 lines
Diff to previous 1.295 (colored)

make: make DEBUG0 simpler

All arguments to DEBUG0 are string literals, and none of them contains a
'%', which makes them safe to pass to printf directly.  Any accidental
'%' would be caught by the compiler.

No functional change.

Revision 1.295 / (download) - annotate - [select for diffs], Sun Jan 30 13:21:08 2022 UTC (2 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.294: +2 -2 lines
Diff to previous 1.294 (colored)

Make the GNode lineno unsigned to fix lint warning in var.c calling
PrintLocation()

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

make: for recursive variables in commands, print location

Print the approximate location based on the last command that has been
defined for the target.  It would be possible to get more detailed
location information by counting the number of commands of the target,
but that would get messy due to .USEBEFORE, .USE and .DEFAULT, and
still, this is an edge case, so don't waste too much code for it now.
Having this hint about the location is more helpful than just a plain
"Variable X is recursive" without any further details.

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

make: print stack trace on fatal errors

The only fatal error that occurs while the makefiles are read in is the
one about recursive variables, which didn't give any hint about the
location before.

If a recursive variable is detected while evaluating the commands of a
target to be made, there is no location information, as before.

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

make: inline functions that have a single call site

No functional change.

Revision 1.291 / (download) - annotate - [select for diffs], Thu Jan 27 06:02:59 2022 UTC (2 years, 2 months ago) by sjg
Branch: MAIN
Changes since 1.290: +2 -1 lines
Diff to previous 1.290 (colored)

Allow local variable assignments in dependency lines

The variable is set in the context of the target.
This syntax has been supported by gmake for ~ever.
If necessary a makefile can set .MAKE.TARGET_LOCAL_VARIABLES=false
to disable this.

Expose GetBooleanExpr so parse.c can use it.

Revision 1.290 / (download) - annotate - [select for diffs], Sun Jan 23 22:12:16 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.289: +255 -3 lines
Diff to previous 1.289 (colored)

make: merge nonints.h into make.h

No functional change.

Revision 1.289 / (download) - annotate - [select for diffs], Sat Jan 15 19:13:08 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.288: +3 -1 lines
Diff to previous 1.288 (colored)

make: use islower for parsing directives

None of the directives has an uppercase letter, so there is no need to
test for it.

No functional change.

Revision 1.288 / (download) - annotate - [select for diffs], Sun Jan 9 18:59:27 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.287: +12 -1 lines
Diff to previous 1.287 (colored)

make: extract low-level character operations into utility function

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

No functional change.

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

make: merge duplicate variables for the main target

No functional change.

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

make: rename and inline Targ_Precious

No functional change.

Revision 1.285 / (download) - annotate - [select for diffs], Fri Jan 7 13:56:09 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.284: +2 -2 lines
Diff to previous 1.284 (colored)

make: rename IFile and its fields to match their actual content

For lines that use backslash continuation, the human-readable line
number does not equal the number of raw lines that have been read from
the file.

The big comment in PrintStackTrace has become outdated, it still
referred to first_lineno.  Due to the bugs documented in
opt-debug-parse.mk, that function needs to be redone completely.

No functional change.

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

make: merge duplicate types CondEvalResult and CondResult

No binary change.

Revision 1.283 / (download) - annotate - [select for diffs], Wed Dec 29 05:01:35 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.282: +4 -7 lines
Diff to previous 1.282 (colored)

make: merge duplicate enum constants for CondEvalResult and CondResult

No binary change.

Revision 1.282 / (download) - annotate - [select for diffs], Wed Dec 29 04:41:38 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.281: +6 -3 lines
Diff to previous 1.281 (colored)

make: merge types CondResult and CondEvalResult

No functional change.

Revision 1.281 / (download) - annotate - [select for diffs], Tue Dec 28 14:22:51 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.280: +3 -4 lines
Diff to previous 1.280 (colored)

make: do not treat .USEBEFORE as candidate for the main target

A .USE target is not a candidate, so .USEBEFORE shouldn't either.

Since make.h 1.36 from 2001-07-03.  In that commit, OP_USEBEFORE should
have been added to OP_NOTARGET.

Revision 1.280 / (download) - annotate - [select for diffs], Tue Dec 28 14:06:42 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.279: +9 -3 lines
Diff to previous 1.279 (colored)

make: extract OP_NOTARGET into separate function

No binary change, except for line numbers in assertions.

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

make: remove unnecessary words from command line options

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

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

No functional change.

Revision 1.278 / (download) - annotate - [select for diffs], Wed Dec 15 13:03:33 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.277: +5 -5 lines
Diff to previous 1.277 (colored)

make: amend leftover cleanups from the previous commits

No functional change.

Revision 1.277 / (download) - annotate - [select for diffs], Wed Dec 15 12:58:01 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.276: +156 -83 lines
Diff to previous 1.276 (colored)

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

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

No functional change.

Revision 1.276 / (download) - annotate - [select for diffs], Wed Dec 15 12:08:25 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.275: +2 -2 lines
Diff to previous 1.275 (colored)

make: remove redundant comments for multiple-inclusion guards

Revision 1.275 / (download) - annotate - [select for diffs], Wed Dec 15 11:58:40 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.274: +21 -21 lines
Diff to previous 1.274 (colored)

make: remove space after ':' in bit-field declarations

As seen in /usr/share/misc/style.

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

make: mark several functions whose result must be used

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

No binary change.

Revision 1.273 / (download) - annotate - [select for diffs], Wed Dec 15 09:29:55 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.272: +7 -1 lines
Diff to previous 1.272 (colored)

make: prevent memory leaks from buffers

The warning about unused function results would have prevented the
memory leak that was fixed in cond.c 1.303 from 2021-12-13.

Revision 1.272 / (download) - annotate - [select for diffs], Mon Dec 13 22:26:21 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.271: +23 -25 lines
Diff to previous 1.271 (colored)

make: convert debugging flags from enum to bit-field

This gets rid of the magic numbers, making it possible to add another
debug flag without renumbering the others.

No functional change.

Revision 1.271 / (download) - annotate - [select for diffs], Mon Dec 13 05:25:04 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.270: +2 -3 lines
Diff to previous 1.270 (colored)

make: fix memory leak for filenames in .for loops (since 2013-06-18)

Previously, each time a .for directive pushed its buffer on the input
file stack, the current filename was duplicated.  This was a waste of
memory.

The name of a file is typically only used while it is read in.  There is
one situation when the filename is needed for longer, which is when a
target is defined.

Since .for loops are implemented as a special form of included files,
each .for loop duplicated the current filename as well.

$ cat << EOF > for.mk
.for i in 1 2 3 4 5 6 7 8 9 0
.for i in 1 2 3 4 5 6 7 8 9 0
.for i in 1 2 3 4 5 6 7 8 9 0
.for i in 1 2 3 4 5 6 7 8 9 0
.for i in 1 2 3 4 5 6 7 8 9 0
.for i in 1 2 3 4 5 6 7 8 9 0
.for i in 1 2 3 4 5 6 7 8 9 0
.endfor
.endfor
.endfor
.endfor
.endfor
.endfor
.endfor

all:
	@ps -o rsz -p ${.MAKE.PID}
EOF

$ make-2021.12.13.03.55.16 -r -f for.mk
  RSZ
10720

$ ./make -r -f for.mk
 RSZ
1716

The difference is 8 MB, which amounts to 1 million .for loops.

Revision 1.270 / (download) - annotate - [select for diffs], Sun Nov 28 23:12:51 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.269: +2 -2 lines
Diff to previous 1.269 (colored)

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

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

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

No functional change.

Revision 1.269 / (download) - annotate - [select for diffs], Sun Nov 28 20:11:45 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.268: +2 -2 lines
Diff to previous 1.268 (colored)

make: fix leftover typo from previous refactoring

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

make: convert GNodeFlags from enum into bit-fields

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

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

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

No functional change.

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

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

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

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

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

No functional change.

Revision 1.266 / (download) - annotate - [select for diffs], Sat Nov 27 22:04:02 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.265: +2 -2 lines
Diff to previous 1.265 (colored)

make: remove CONSTCOND comments, lint no longer needs them

Revision 1.265 / (download) - annotate - [select for diffs], Sun Sep 12 09:51:14 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.264: +16 -9 lines
Diff to previous 1.264 (colored)

make: error out if a pre-C99 platform defines bool in some cases

On NetBSD/amd64 9.99.88, when compiling make in C90 mode, make.h defined
its own boolean type as an alias for unsigned int.  Not plain int since
that would make the value of bit-fields -1 instead of 1.

This worked fine for all files except main.c, which includes
<sys/sysctl.h>, which in turn includes <stdbool.h> unconditionally, even
in C90 mode.  This meant that in main.c, sizeof(bool) was 1, while in
all other files it was 4.

This in turn led to a segmentation fault when ParseDependencySourceMain
tried to access opts.create.  Since parse.c assumed sizeof(bool) == 4,
it computed an offset outside of struct CmdOpts, which was defined in
main.c with sizeof(bool) == 1.

Rather than risking these segmentation faults, prevent building make on
platforms like these and suggest a proper workaround.

Revision 1.264 / (download) - annotate - [select for diffs], Sat Jul 31 09:30:17 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.263: +15 -11 lines
Diff to previous 1.263 (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.263 / (download) - annotate - [select for diffs], Mon Jun 21 10:33:11 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.262: +3 -1 lines
Diff to previous 1.262 (colored)

make: document where to find tests for the dependency lines

Revision 1.262 / (download) - annotate - [select for diffs], Wed Apr 14 17:39:11 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
CVS Tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.261: +2 -1 lines
Diff to previous 1.261 (colored)

make: let the compiler decide whether to inline string functions

On x86_64, this reduces the binary size by 2 kB.

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

make: add types Substring and LazyBuf

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

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

No functional change.

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

make: rename a few functions to be more descriptive

No functional change.

Revision 1.259 / (download) - annotate - [select for diffs], Sat Apr 3 15:22:23 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.258: +2 -2 lines
Diff to previous 1.258 (colored)

make: revert accidental change from the previous commit

The definition of MAKE_GNUC_PREREQ was not supposed to be changed.  This
change only slipped accidentally, the test for __STDC_VERSION__ was only
supposed to be for UNCONST.

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

make: backport to C90

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

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

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

No functional change.

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

make: use C99 bool type instead of defining its own

No functional change.

Revision 1.256 / (download) - annotate - [select for diffs], Fri Feb 5 19:19:17 2021 UTC (3 years, 1 month ago) by sjg
Branch: MAIN
Changes since 1.255: +2 -2 lines
Diff to previous 1.255 (colored)

Avoid strdup in mkTempFile

Require caller to pass a buffer and size if they
want the tempfile not unlinked.

Add Job_TempFile to handle blocking signals around
call to mkTempFile, so that meta_open_filemon can use it
in jobs mode.

Revision 1.255 / (download) - annotate - [select for diffs], Fri Feb 5 05:42:39 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.254: +2 -2 lines
Diff to previous 1.254 (colored)

make: improve documentation about variable scopes

In an experiment, I tried to separate the concepts of a GNode and a
variable scope.  The global variables SCOPE_GLOBAL, SCOPE_INTERNAL and
SCOPE_CMDLINE are implemented as GNode even though they only need the
members 'name' and 'vars'.  All their other members are unused.
Therefore it seemed natural to extract this part of the GNode into a
separate type called Scope.

The resulting code was harder to read though since it had split the
namespace of the functions into several parts that were not obviously
related: The Var_ functions, the Scope_ functions, and the short-cut
Global_ functions.  Because of this, I threw away the experiment.

All that is left are a few updated comments.

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

make: rename Var_ValueDirect to GNode_ValueDirect

Revision 1.253 / (download) - annotate - [select for diffs], Thu Feb 4 21:42:46 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.252: +2 -2 lines
Diff to previous 1.252 (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.252 / (download) - annotate - [select for diffs], Thu Feb 4 21:33:13 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.251: +10 -7 lines
Diff to previous 1.251 (colored)

make: rename some VAR constants to SCOPE

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

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

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

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

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

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

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

make: remove unused INTERNAL flag

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

Revision 1.250 / (download) - annotate - [select for diffs], Mon Feb 1 21:32:54 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.249: +7 -5 lines
Diff to previous 1.249 (colored)

make: clean up comments

Revision 1.249 / (download) - annotate - [select for diffs], Mon Feb 1 21:09:25 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.248: +10 -10 lines
Diff to previous 1.248 (colored)

make: indent preprocessor directives consistently

As seen in share/misc/style.

Revision 1.248 / (download) - annotate - [select for diffs], Mon Feb 1 21:04:10 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.247: +2 -8 lines
Diff to previous 1.247 (colored)

make: always use vfork, never fork

Before compat.c 1.217, job.c 1.390 and main.c 1.504 from 2020-12-27, the
exported make variables were exported from each freshly forked child
process.  There was no practical difference though between exporting the
variables from the parent process or the child process since these two
processes share the same address space, except that the forked process
is very limited in what it may actually do.  This limitation was
violated on a regular basis.

When an exported variable referred to a variable that used the :sh
variable modifier, this led to a fork from within vfork, which is not
allowed.  Since 2020-12-27, exporting the variables is done from the
main process, which prevents this situation from ever occurring.

Since that day, there is no need anymore to distinguish between vfork
and fork, which removes any need for the macro.

Revision 1.247 / (download) - annotate - [select for diffs], Mon Feb 1 20:51:17 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.246: +11 -11 lines
Diff to previous 1.246 (colored)

make: use bit shifts in enum constants for GNodeFlags

Same as in the other enum bit sets.  This makes it easier to spot the
gap between bit 6 and bit 12.

Revision 1.246 / (download) - annotate - [select for diffs], Sun Jan 24 20:11:55 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.245: +4 -2 lines
Diff to previous 1.245 (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.245 / (download) - annotate - [select for diffs], Thu Jan 21 14:30:01 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.244: +5 -2 lines
Diff to previous 1.244 (colored)

make(1): merge duplicate code in Parse_MainName

Revision 1.244 / (download) - annotate - [select for diffs], Tue Jan 19 20:51:46 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.243: +2 -2 lines
Diff to previous 1.243 (colored)

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

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

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

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

Revision 1.242 / (download) - annotate - [select for diffs], Sun Jan 10 21:20:46 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.241: +2 -2 lines
Diff to previous 1.241 (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.241 / (download) - annotate - [select for diffs], Wed Dec 30 10:03:16 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.240: +33 -17 lines
Diff to previous 1.240 (colored)

make(1): format multi-line comments

Revision 1.240 / (download) - annotate - [select for diffs], Mon Dec 28 00:46:24 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.239: +1 -16 lines
Diff to previous 1.239 (colored)

make(1): replace global preserveUndefined with VARE_KEEP_UNDEF

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

Converting the global variable into a flag had to prerequisites:

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

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

Revision 1.239 / (download) - annotate - [select for diffs], Wed Dec 23 14:05:32 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.238: +2 -2 lines
Diff to previous 1.238 (colored)

make(1): fix lint warnings for constant condition in DEBUG calls

Revision 1.238 / (download) - annotate - [select for diffs], Wed Dec 23 14:03:13 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.237: +10 -12 lines
Diff to previous 1.237 (colored)

make(1): fix MAKE_RCSID for lint mode

Previously, running lint mode didn't define MAKE_RCSID at all, which
resulted in a syntax error.

While here, reduced the indentation and nesting of the preprocessor
directives.

Revision 1.237 / (download) - annotate - [select for diffs], Wed Dec 23 13:50:54 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.236: +2 -2 lines
Diff to previous 1.236 (colored)

make(1): rename CmdOpts.lint to strict

When running lint(1) on the code, it defines the preprocessor macro
"lint" to 1, which generated a syntax error in the declaration "Boolean
lint", as that became "Boolean 1".

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

make(1): fix return type of macro DEBUG

This macro was supposed to return a boolean expression all the time, it
just hadn't been implemented this way.  This resulted in wrong output
for the test sh-flags, in compilation modes -DUSE_UCHAR_BOOLEAN and
-DUSE_CHAR_BOOLEAN, since in ParseCommandFlags, the expression
DEBUG(LOUD) didn't fit into a boolean.

Revision 1.235 / (download) - annotate - [select for diffs], Fri Dec 18 18:17:45 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.234: +7 -3 lines
Diff to previous 1.234 (colored)

make(1): support using C99 bool for Boolean

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

make(1): constify progname

Revision 1.233 / (download) - annotate - [select for diffs], Fri Dec 11 23:00:59 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.232: +3 -3 lines
Diff to previous 1.232 (colored)

make(1): clean up comments for command line options

Revision 1.232 / (download) - annotate - [select for diffs], Sun Dec 6 10:33:42 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.231: +13 -18 lines
Diff to previous 1.231 (colored)

make(1): clean up macros for debug logging

Using a do-while loop prevents compiler warnings about possible dangling
else.  It also removes the unnecessary negation.

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

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

Revision 1.230 / (download) - annotate - [select for diffs], Sun Nov 29 09:27:40 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.229: +8 -8 lines
Diff to previous 1.229 (colored)

make(1): use space instead of tab for preprocessor directives

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

make(1): reduce memory allocation for dirSearchPath

Revision 1.228 / (download) - annotate - [select for diffs], Sat Nov 28 23:39:58 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.227: +2 -2 lines
Diff to previous 1.227 (colored)

make(1): reduce memory allocation for CmdOpts.create

Revision 1.227 / (download) - annotate - [select for diffs], Sat Nov 28 23:35:44 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.226: +2 -2 lines
Diff to previous 1.226 (colored)

make(1): reduce memory allocation in CmdOpts.variables

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

make(1): reduce memory allocation in CmdOpts.makefiles

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

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

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

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

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

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

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

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

Revision 1.221 / (download) - annotate - [select for diffs], Sat Nov 28 18:55:52 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.220: +2 -2 lines
Diff to previous 1.220 (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.220 / (download) - annotate - [select for diffs], Sat Nov 28 09:45:01 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.219: +9 -1 lines
Diff to previous 1.219 (colored)

make(1): allow multiple RCS IDs in all-in-one mode

Revision 1.219 / (download) - annotate - [select for diffs], Tue Nov 24 20:17:17 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.218: +332 -313 lines
Diff to previous 1.218 (colored)

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

Revision 1.218 / (download) - annotate - [select for diffs], Tue Nov 24 19:33:13 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.217: +22 -1 lines
Diff to previous 1.217 (colored)

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

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

Revision 1.217 / (download) - annotate - [select for diffs], Tue Nov 24 18:17:45 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.216: +7 -1 lines
Diff to previous 1.216 (colored)

make(1): fix error handling for dependency of .END in -k mode

Fix one bug, find 4 new ones.  All these bugs have been around since
2005-05-08, when dependencies on the .BEGIN, .END and .INTERRUPT nodes
were implemented.  Before that, checking gn->made == ERROR was
appropriate, but adding the dependencies made ABORTED a new possible
error value from Compat_Make.

Revision 1.216 / (download) - annotate - [select for diffs], Tue Nov 24 17:42:31 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.215: +37 -12 lines
Diff to previous 1.215 (colored)

make(1): document the enum GNodeMade

Given only the state names and their individual documentation, it is
hard to see the full picture.  To make this easier, provide typical
examples of the ways that a GNode takes through these states.

Revision 1.215 / (download) - annotate - [select for diffs], Mon Nov 23 20:41:20 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.214: +7 -6 lines
Diff to previous 1.214 (colored)

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

Revision 1.214 / (download) - annotate - [select for diffs], Sun Nov 22 21:34:34 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.213: +3 -2 lines
Diff to previous 1.213 (colored)

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

Revision 1.213 / (download) - annotate - [select for diffs], Sun Nov 22 10:48:11 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.212: +9 -9 lines
Diff to previous 1.212 (colored)

make(1): renumber the flags in GNodeType

In plain C, bit 31 of an enum is not guaranteed to play well with binary
operators.  Bit 23 was unused until now, so shift them all down.

The order of the bits is only used in Targ_PrintType.

Revision 1.212 / (download) - annotate - [select for diffs], Sat Nov 21 19:15:06 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.211: +2 -2 lines
Diff to previous 1.211 (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.211 / (download) - annotate - [select for diffs], Sat Nov 21 18:41:57 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.210: +2 -2 lines
Diff to previous 1.210 (colored)

make(1): rename GNode.context to vars

Especially in the variables module, the expression 'ctxt->context' looked
redundant.  Having a GNode as a context sounds ok, but a context of a
context just doesn't make sense.

Revision 1.210 / (download) - annotate - [select for diffs], Mon Nov 16 21:53:10 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.209: +2 -1 lines
Diff to previous 1.209 (colored)

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

Revision 1.209 / (download) - annotate - [select for diffs], Sun Nov 15 12:02:44 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.208: +3 -1 lines
Diff to previous 1.208 (colored)

make(1): clean up make.h, meta.c, parse.c, str.c

The main changes are in the comments, which have been shortened and
corrected.

Some local variables changed their names.

In ParseErrorInternal, the scope of va_start is now narrower.

In ParseDoDependency, the type of tOp has been fixed.

ParseGetLine doesn't take flags anymore but instead a parsing mode.
Previously, the flags had not been combined anyway.

At the beginning of Parse_File, fatals is already guaranteed to be 0, and
even if not, it would be wrong to just discard the fatal errors.

Revision 1.208 / (download) - annotate - [select for diffs], Sat Nov 14 17:39:59 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.207: +2 -2 lines
Diff to previous 1.207 (colored)

make(1): remove redundant parameter from str2Lst_Append

Revision 1.207 / (download) - annotate - [select for diffs], Sat Nov 14 15:58:01 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.206: +2 -2 lines
Diff to previous 1.206 (colored)

make(1): rename DEFAULT to defaultNode

In C, uppercase names are typically used for constants, and this is not
a constant.

Revision 1.206 / (download) - annotate - [select for diffs], Thu Nov 12 23:35:21 2020 UTC (3 years, 4 months ago) by sjg
Branch: MAIN
Changes since 1.205: +2 -2 lines
Diff to previous 1.205 (colored)

Pass a writable flag to Main_SetObjdir to control writable check

For curdir and an explicit .OBJDIR target, we allow for
the directory to be read-only.
During InitObjdir we otherwise default to requiring objdir to be
writable - this can be controlled by env variable
MAKE_OBJDIR_CHECK_WRITABLE

Add unit-tests/objdir-writable

Reviewed by: christos rillig

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

make(1): use consistent definition for MAKE_INLINE

Revision 1.204 / (download) - annotate - [select for diffs], Sun Nov 8 23:38:02 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.203: +9 -7 lines
Diff to previous 1.203 (colored)

make(1): move lint option away from the debug flags

The lint option affects much more than a typical debug flag.  Not only
does it produce additional diagnostics, it also changes the control flow
and fixes the traditional error handling in a few places.

No functional change.

Revision 1.203 / (download) - annotate - [select for diffs], Sun Nov 8 23:30:59 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.202: +16 -16 lines
Diff to previous 1.202 (colored)

make(1): sort debug flags alphabetically

DEBUG_FOR had been accidentally left at the end of the list.

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

make(1): fix documentation of preserveUndefined

Since it is a global variable and not a VarEvalFlags, it affects nested
subexpressions as well, and there is no way to escape it.

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

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

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

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

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

make(1): rename Make_OODate to GNode_IsOODate

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

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

make(1): rename Make_TimeStamp to GNode_UpdateYoungestChild

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

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

Revision 1.197 / (download) - annotate - [select for diffs], Sat Nov 7 10:44:53 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.196: +8 -1 lines
Diff to previous 1.196 (colored)

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

Revision 1.196 / (download) - annotate - [select for diffs], Fri Nov 6 22:39:10 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.195: +8 -1 lines
Diff to previous 1.195 (colored)

make(1): merge duplicate code for skipping horizontal whitespace

Revision 1.195 / (download) - annotate - [select for diffs], Fri Nov 6 22:37:07 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.194: +15 -15 lines
Diff to previous 1.194 (colored)

make(1): move name of inline functions to the beginning of the line

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

make(1): rename dieQuietly to shouldDieQuietly

It was too confusing to have a function named die that doesn't actually
die.  Plus, the return type int didn't give any clue about what the
function actually returns.

Revision 1.193 / (download) - annotate - [select for diffs], Fri Nov 6 21:12:19 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.192: +5 -1 lines
Diff to previous 1.192 (colored)

make(1): document DEBUG_LINT

Revision 1.192 / (download) - annotate - [select for diffs], Fri Nov 6 21:09:06 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.191: +19 -20 lines
Diff to previous 1.191 (colored)

make(1): sort and renumber debug flags

Revision 1.191 / (download) - annotate - [select for diffs], Fri Nov 6 20:24:08 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.190: +7 -4 lines
Diff to previous 1.190 (colored)

make(1): document progname

Revision 1.190 / (download) - annotate - [select for diffs], Fri Nov 6 20:20:00 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.189: +31 -29 lines
Diff to previous 1.189 (colored)

make(1): clean up comments in make.h

Revision 1.189 / (download) - annotate - [select for diffs], Thu Nov 5 00:40:31 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.188: +7 -4 lines
Diff to previous 1.188 (colored)

make(1): extend documentation for GNodeType constants

Revision 1.188 / (download) - annotate - [select for diffs], Wed Nov 4 13:40:20 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.187: +9 -11 lines
Diff to previous 1.187 (colored)

make(1): group GNode fields by topic, document ParseErrorLevel

Revision 1.187 / (download) - annotate - [select for diffs], Wed Nov 4 13:31:58 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.186: +6 -5 lines
Diff to previous 1.186 (colored)

make(1): align comments on a few commonly used variables

Revision 1.186 / (download) - annotate - [select for diffs], Wed Nov 4 13:29:42 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.185: +8 -3 lines
Diff to previous 1.185 (colored)

make(1): move declaration of parseIncPath from main.c to make.h

Revision 1.185 / (download) - annotate - [select for diffs], Wed Nov 4 13:22:15 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.184: +2 -2 lines
Diff to previous 1.184 (colored)

make(1): rename MAKEFILE_PREFERENCE for consistency

The names of the other special variables are all prefixed with MAKE_.

Revision 1.184 / (download) - annotate - [select for diffs], Wed Nov 4 13:04:56 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.183: +1 -8 lines
Diff to previous 1.183 (colored)

make(1): remove unused names DTARGET, FPREFIX, etc.

Revision 1.183 / (download) - annotate - [select for diffs], Wed Nov 4 04:49:32 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.182: +7 -6 lines
Diff to previous 1.182 (colored)

make(1): negate discardUndefined to preserveUndefined

Revision 1.182 / (download) - annotate - [select for diffs], Wed Nov 4 03:37:51 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.181: +13 -5 lines
Diff to previous 1.181 (colored)

make(1): rename oldVars to discardUndefined

While here, moved all the documentation about this variable into a
single place.

Revision 1.181 / (download) - annotate - [select for diffs], Wed Nov 4 03:13:46 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.180: +3 -3 lines
Diff to previous 1.180 (colored)

make(1): add missing enum tag for GNodeMade

Revision 1.180 / (download) - annotate - [select for diffs], Wed Nov 4 02:57:42 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.179: +6 -2 lines
Diff to previous 1.179 (colored)

make(1): document that "old-style" variables are older than 1993

Revision 1.179 / (download) - annotate - [select for diffs], Sun Nov 1 17:47:26 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.178: +2 -2 lines
Diff to previous 1.178 (colored)

make(1): negate NoExecute to GNode_ShouldExecute

Revision 1.178 / (download) - annotate - [select for diffs], Sat Oct 31 11:54:33 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.177: +16 -1 lines
Diff to previous 1.177 (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.177 / (download) - annotate - [select for diffs], Fri Oct 30 17:10:48 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.176: +2 -2 lines
Diff to previous 1.176 (colored)

make(1): clean up comments and local variables in var.c

Revision 1.176 / (download) - annotate - [select for diffs], Fri Oct 30 07:19:30 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.175: +3 -3 lines
Diff to previous 1.175 (colored)

make(1): rename VAR_CMD to VAR_CMDLINE

Since make has to do with both the command line and child commands, the
former name was confusing.

Revision 1.175 / (download) - annotate - [select for diffs], Wed Oct 28 03:21:25 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.174: +2 -2 lines
Diff to previous 1.174 (colored)

make(1): rename defIncPath to defSysIncPath

There are two variables, parseIncPath and sysIncPath, which made the
name defIncPath ambiguous.

Revision 1.174 / (download) - annotate - [select for diffs], Tue Oct 27 07:03:55 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.173: +4 -1 lines
Diff to previous 1.173 (colored)

make(1): move debugVflag to CmdOpts

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

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

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

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

Revision 1.172 / (download) - annotate - [select for diffs], Sun Oct 25 21:51:49 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.171: +8 -2 lines
Diff to previous 1.171 (colored)

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

Revision 1.171 / (download) - annotate - [select for diffs], Sat Oct 24 20:51:49 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.170: +1 -8 lines
Diff to previous 1.170 (colored)

make(1): remove macros MIN and MAX

These macros typically evaluate one of their arguments twice.  Until
2020-08-31, they had not parenthesized their arguments properly.  They
are only used in a few places, therefore it doesn't hurt much to have
them expanded.

Revision 1.170 / (download) - annotate - [select for diffs], Sat Oct 24 20:29:40 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.169: +28 -25 lines
Diff to previous 1.169 (colored)

make(1): convert macros for debug flags into enum

Revision 1.169 / (download) - annotate - [select for diffs], Sat Oct 24 03:45:02 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.168: +7 -5 lines
Diff to previous 1.168 (colored)

make(1): remove lengthy comments from archive handling

The relevant information is already documented on OP_ARCHV, but only
since a few weeks.

Revision 1.168 / (download) - annotate - [select for diffs], Fri Oct 23 20:14:50 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.167: +3 -3 lines
Diff to previous 1.167 (colored)

make(1): fix typos in comments

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

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

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

make(1): rename GNode.cmgn to youngestChild

The name is longer than before but also clearer.

Revision 1.165 / (download) - annotate - [select for diffs], Fri Oct 23 19:11:30 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.164: +8 -4 lines
Diff to previous 1.164 (colored)

make(1): add test for the '::' dependency operator

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

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

Revision 1.163 / (download) - annotate - [select for diffs], Fri Oct 23 18:10:39 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.162: +3 -6 lines
Diff to previous 1.162 (colored)

make(1): merge duplicate documentation for OP_NOP

Revision 1.162 / (download) - annotate - [select for diffs], Fri Oct 23 18:05:35 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.161: +4 -2 lines
Diff to previous 1.161 (colored)

make(1): only define TRUE and FALSE if necessary

For -DUSE_ENUM_BOOLEAN, the macros are not necessary.

Revision 1.161 / (download) - annotate - [select for diffs], Fri Oct 23 17:59:25 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.160: +7 -1 lines
Diff to previous 1.160 (colored)

make(1): allow compilation with Boolean implemented as char

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

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

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

make(1): add tags to enum types

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

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

make(1): remove underscore from Hash_Table and Hash_Entry

For consistency with the other type names, such as GNodeListNode.

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

make(1): convert NoExecute to non-inline

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

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

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

Revision 1.156 / (download) - annotate - [select for diffs], Mon Oct 5 22:15:45 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.155: +2 -2 lines
Diff to previous 1.155 (colored)

make(1): enable format string truncation warnings for parse.c

No node is ever going to have a million or more cohorts.  And even if
there were, this name is only used for printing informational messages.

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

make(1): revert previous commit

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

Revision 1.154 / (download) - annotate - [select for diffs], Mon Oct 5 19:24:29 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.153: +11 -34 lines
Diff to previous 1.153 (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.153 / (download) - annotate - [select for diffs], Mon Oct 5 15:14:24 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.152: +20 -11 lines
Diff to previous 1.152 (colored)

make(1): replace GNode macros with inline functions

Curiously, this affects the size of the generated code: it gets smaller
than before.

Revision 1.152 / (download) - annotate - [select for diffs], Sat Oct 3 21:19:54 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.151: +15 -1 lines
Diff to previous 1.151 (colored)

make(1): use consistent pattern for parsing whitespace

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

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

make(1): remove the inline attribute from debug_printf

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

Revision 1.150 / (download) - annotate - [select for diffs], Mon Sep 28 22:23:35 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.149: +18 -7 lines
Diff to previous 1.149 (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.149 / (download) - annotate - [select for diffs], Mon Sep 28 20:46:11 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.148: +25 -1 lines
Diff to previous 1.148 (colored)

make(1): make debugging code shorter

Revision 1.148 / (download) - annotate - [select for diffs], Sun Sep 27 21:35:16 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.147: +35 -33 lines
Diff to previous 1.147 (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.147 / (download) - annotate - [select for diffs], Sat Sep 26 16:00:12 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.146: +1 -13 lines
Diff to previous 1.146 (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.146 / (download) - annotate - [select for diffs], Thu Sep 24 07:37:42 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.145: +2 -2 lines
Diff to previous 1.145 (colored)

make(1): migrate MakeTimeStamp and MakeUnmark to Lst_ForEach

Revision 1.145 / (download) - annotate - [select for diffs], Wed Sep 23 03:06:38 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.144: +4 -2 lines
Diff to previous 1.144 (colored)

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

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

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

Revision 1.144 / (download) - annotate - [select for diffs], Tue Sep 22 04:05:41 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.143: +11 -8 lines
Diff to previous 1.143 (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.143 / (download) - annotate - [select for diffs], Mon Sep 21 17:44:25 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.142: +13 -8 lines
Diff to previous 1.142 (colored)

make(1): add specific typedefs for lists

These typedefs are only intended to help human readers, they do not
provide any type-safety.  They also make the pointers explicit, which
had been hidden before by the typedef for Lst and LstNode.  Typing a few
'*' is less work than finding out which of the many types are pointers
and which aren't.

In meta.c, the variable "ln" served two completely different purposes,
which have been split again.  Register allocation is the job of the
compiler, not of the human source code reader.

Revision 1.142 / (download) - annotate - [select for diffs], Sun Sep 13 15:15:51 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.141: +10 -1 lines
Diff to previous 1.141 (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.141 / (download) - annotate - [select for diffs], Sun Sep 13 13:50:27 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.140: +2 -2 lines
Diff to previous 1.140 (colored)

make(1): clean up API for evaluating conditions

There was no need to make struct If publicly visible.

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

The former function names had not been distinctive.

Revision 1.140 / (download) - annotate - [select for diffs], Sun Sep 13 06:15:29 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.139: +3 -3 lines
Diff to previous 1.139 (colored)

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

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

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

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

Revision 1.138 / (download) - annotate - [select for diffs], Fri Sep 11 05:37:40 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.137: +2 -2 lines
Diff to previous 1.137 (colored)

make(1): add missing space in source code

Revision 1.137 / (download) - annotate - [select for diffs], Wed Sep 2 23:42:58 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.136: +5 -3 lines
Diff to previous 1.136 (colored)

make(1): document the value restrictions for Boolean variables

The previous lenient rule came from the sprite.h header that was not
specific to make.  To avoid confusion, only the expected values should
be stored in a Boolean variable.  To help find obvious violations and
inconsistencies, there are different possibilities for the Boolean type,
during development.

In C there is no way to actually enforce this restriction at runtime.
It would be possible in C++, but the code is not ready to be compiled
with a C++ compiler.

Revision 1.136 / (download) - annotate - [select for diffs], Wed Sep 2 04:08:54 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.135: +1 -3 lines
Diff to previous 1.135 (colored)

make(1): reduce number of stat fields returned by cached_stat

Only st_mtime and st_mode are actually filled, the remaining fields had
been set to zero.  To prevent these from ever being accessed, a custom
struct make_stat replaces the previously used struct stat.

The fields in struct make_stat are intentionally named different from
the fields in struct stat because NetBSD and some other operating
systems define st_mtime as a macro, and that would not work in a field
declaration.

Revision 1.135 / (download) - annotate - [select for diffs], Wed Sep 2 03:28:12 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.134: +4 -3 lines
Diff to previous 1.134 (colored)

make(1): use proper types in API of cached_stat and cached_lstat

Revision 1.134 / (download) - annotate - [select for diffs], Mon Aug 31 06:21:07 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.133: +3 -3 lines
Diff to previous 1.133 (colored)

make(1): parenthesize macro arguments

Just in case anyone wants to use them for copy-and-paste.

The invocations of these macros are left cautious since the
system-provided definition of these macros may have forgotten the
parentheses as well.

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

make(1): rename GNode.iParents to implicitParents

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

Revision 1.132 / (download) - annotate - [select for diffs], Sat Aug 29 12:20:17 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.131: +1 -19 lines
Diff to previous 1.131 (colored)

make(1): remove ReturnStatus, SUCCESS and FAILURE

These are used in so few places now that it is easier to use a simple
Boolean for them.

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

make(1): add another Boolean variant to check during development

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

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

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

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

make(1): clean up targ.c

The main part is removing redundant or outdated information from
comments.  In a few places, the expression cond ? TRUE : FALSE has been
simplified.

Revision 1.128 / (download) - annotate - [select for diffs], Fri Aug 28 03:35:45 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.127: +2 -1 lines
Diff to previous 1.127 (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.127 / (download) - annotate - [select for diffs], Wed Aug 26 23:00:47 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.126: +32 -2 lines
Diff to previous 1.126 (colored)

make(1): remove header sprite.h

Make is independent of the Sprite operating system.

Revision 1.126 / (download) - annotate - [select for diffs], Mon Aug 24 20:15:51 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.125: +2 -1 lines
Diff to previous 1.125 (colored)

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

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

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

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

Revision 1.125 / (download) - annotate - [select for diffs], Sun Aug 23 17:04:21 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.124: +1 -2 lines
Diff to previous 1.124 (colored)

make(1): remove unused declarations from header files

Revision 1.124 / (download) - annotate - [select for diffs], Sun Aug 23 08:26:03 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.123: +2 -2 lines
Diff to previous 1.123 (colored)

make(1): use proper data type for GNode.type

Theoretically this should show the enum constant names when displaying
the field in the debugger.  This only happens for GNode.flags though,
but not for GNode.type.  Not sure what the exact cause is.

Revision 1.123 / (download) - annotate - [select for diffs], Sat Aug 22 21:42:38 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.122: +2 -1 lines
Diff to previous 1.122 (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.122 / (download) - annotate - [select for diffs], Sat Aug 22 19:27:22 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.121: +3 -3 lines
Diff to previous 1.121 (colored)

make(1): remove wrong comment about possible Y2038 problem

The "time" that is mentioned is not clock time but a sequence number.

Revision 1.121 / (download) - annotate - [select for diffs], Sat Aug 22 18:47:31 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.120: +1 -2 lines
Diff to previous 1.120 (colored)

make(1): remove unused variable jobServer

Revision 1.120 / (download) - annotate - [select for diffs], Sat Aug 22 18:44:22 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.119: +84 -62 lines
Diff to previous 1.119 (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.119 / (download) - annotate - [select for diffs], Sat Aug 22 18:20:31 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.118: +98 -94 lines
Diff to previous 1.118 (colored)

make(1): restructure GNode types and documentation

Having a numbered list above the type was not helpful since the numbers
didn't serve any purpose, they just consumed screen space.

Several of these list items didn't have an obvious relationship to the
struct fields.  It's better to have just a rough introduction as the
type level documentation, leaving the details to the individual fields.

Converting the types and flags and other constants into separate types
and defining them outside the struct leaves more space to see the
relationship of the struct fields.

Limiting the documentation of each field to a single line, as suggested
by the end-of-line comments, reduces clarity since several of the fields
need way more documentation to be properly understood.

Revision 1.118 / (download) - annotate - [select for diffs], Thu Aug 20 17:13:05 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.117: +1 -3 lines
Diff to previous 1.117 (colored)

make(1): remove unused function declarations

Revision 1.117 / (download) - annotate - [select for diffs], Thu Aug 20 17:06:26 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.116: +2 -2 lines
Diff to previous 1.116 (colored)

make(1): fix wrong or outdated comments

Revision 1.116 / (download) - annotate - [select for diffs], Thu Aug 13 03:54:57 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.115: +4 -4 lines
Diff to previous 1.115 (colored)

make(1): follow naming conventions for multiple-inclusion guards

This avoids undefined behavior.

Revision 1.115 / (download) - annotate - [select for diffs], Tue Aug 11 18:44:52 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.114: +2 -2 lines
Diff to previous 1.114 (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.114 / (download) - annotate - [select for diffs], Mon Aug 10 19:30:30 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.113: +1 -13 lines
Diff to previous 1.113 (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.113 / (download) - annotate - [select for diffs], Sat Aug 1 18:02:37 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.112: +6 -4 lines
Diff to previous 1.112 (colored)

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

Revision 1.112 / (download) - annotate - [select for diffs], Fri Jul 31 20:22:10 2020 UTC (3 years, 7 months ago) by sjg
Branch: MAIN
Changes since 1.111: +3 -1 lines
Diff to previous 1.111 (colored)

Add -dL for LINT

When parsing variable assignments other than := and if
value contains '$' attempt Var_Subst the same as for :=,
if the value does not parse correctly, we get a fatal error
including file an line number.

This can greatly help with finding the cause of problems.

Reviewed by: christos

Revision 1.111 / (download) - annotate - [select for diffs], Tue Jul 21 21:13:24 2020 UTC (3 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.110: +3 -1 lines
Diff to previous 1.110 (colored)

make(1): clean up various things in var.c

Revision 1.110 / (download) - annotate - [select for diffs], Sat Jul 18 21:37:38 2020 UTC (3 years, 8 months ago) by sjg
Branch: MAIN
Changes since 1.109: +2 -1 lines
Diff to previous 1.109 (colored)

Add -dh for DEBUG_HASH

Allow tracking of max chain length, to see how well the hash
tables are working.
Pull the actual hash operation into a marco so it can be
easily changed - for experimenting.

The current hash, is pretty good.

Reviewed by: christos

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

make(1): add more type safety for enums

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

Revision 1.108 / (download) - annotate - [select for diffs], Fri Jun 19 21:17:48 2020 UTC (3 years, 9 months ago) by sjg
Branch: MAIN
Changes since 1.107: +2 -1 lines
Diff to previous 1.107 (colored)

Avoid unnecessary noise when sub-make or sibling dies

When analyzing a build log, the first 'stopped' output
from make, is the end of interesting output.

Normally when a build fails deep down in a parallel build
the log ends with many blockes of error output from make,
with all but the fist being unhelpful.

We add a function dieQuietly() which will return true
if we should supress the error output from make.
If the failing node was a sub-make, we want to die quietly.

Also when we read an abort token we call dieQuietly telling we
want to die quietly.

This behavior is suppressed by -dj or
setting .MAKE.DIE_QUIETLY=no

Reviewed by: christos

Revision 1.107 / (download) - annotate - [select for diffs], Fri Apr 3 03:35:16 2020 UTC (3 years, 11 months ago) by sjg
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406
Changes since 1.106: +1 -5 lines
Diff to previous 1.106 (colored)

Revert arraycount

Revision 1.106 / (download) - annotate - [select for diffs], Fri Apr 3 03:32:28 2020 UTC (3 years, 11 months ago) by sjg
Branch: MAIN
Changes since 1.105: +5 -1 lines
Diff to previous 1.105 (colored)

CHECK_VALID_META is too agressive for CMD check.

An empty CMD is perfectly valid.
So using CHECK_VALID_META results in too much rebuilding.

Revision 1.105 / (download) - annotate - [select for diffs], Mon Mar 30 02:41:06 2020 UTC (3 years, 11 months ago) by sjg
Branch: MAIN
Changes since 1.104: +2 -2 lines
Diff to previous 1.104 (colored)

make: fix -fno-common build

debug was declared extern, but debug_file was not; correct this and define
debug_file in main.c (as debug is) to fix the -fno-common build.

-fno-common will become the default with GCC10/LLVM11.

Patch from kevans at freebsd

Revision 1.104 / (download) - annotate - [select for diffs], Mon Feb 12 21:38:09 2018 UTC (6 years, 1 month ago) by sjg
Branch: MAIN
CVS Tags: phil-wifi-base, phil-wifi-20191119, phil-wifi-20190609, 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, netbsd-9-base, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, is-mlppp-base, is-mlppp
Branch point for: phil-wifi, netbsd-9
Changes since 1.103: +2 -1 lines
Diff to previous 1.103 (colored)

Do not treat .info as warning for -W

Reported by: lwhsu at FreeBSD.org

Revision 1.103 / (download) - annotate - [select for diffs], Thu Jul 20 19:29:54 2017 UTC (6 years, 8 months ago) by sjg
Branch: MAIN
Changes since 1.102: +7 -1 lines
Diff to previous 1.102 (colored)

Make compat.c handle SIGINT etc more like job.c

If there is a running child, pass the signal on, and
wait for it to exit before we self-terminate.

Reviewed by: christos

Revision 1.102 / (download) - annotate - [select for diffs], Wed Dec 7 15:00:46 2016 UTC (7 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, perseant-stdc-iso10646-base, perseant-stdc-iso10646, 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, matt-nb8-mediatek-base, matt-nb8-mediatek, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: netbsd-8
Changes since 1.101: +2 -2 lines
Diff to previous 1.101 (colored)

Refactor and simplify objdir setting code.

Revision 1.101 / (download) - annotate - [select for diffs], Fri Aug 26 23:28:39 2016 UTC (7 years, 7 months ago) by dholland
Branch: MAIN
CVS Tags: pgoyette-localcount-20161104, localcount-20160914
Changes since 1.100: +2 -1 lines
Diff to previous 1.100 (colored)

Add a .DELETE_ON_ERROR: magic target that causes *failed* targets as
well as *interrupted* targets to be deleted. The name and behavior of
the variable matches gmake.

Also fix a glitch in newline output on error in compat mode that I
discovered while doing it.

Closes PR 51376.

Revision 1.100 / (download) - annotate - [select for diffs], Tue Jun 7 00:40:00 2016 UTC (7 years, 9 months ago) by sjg
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726
Branch point for: pgoyette-localcount
Changes since 1.99: +3 -1 lines
Diff to previous 1.99 (colored)

Extend the mtimes cache used by dir.c so it can be used by others.

We store both st_mtime and st_mode, since some callers care about the
later.

Reviewed by: christos

Revision 1.99 / (download) - annotate - [select for diffs], Fri Jun 3 01:21:59 2016 UTC (7 years, 9 months ago) by sjg
Branch: MAIN
Changes since 1.98: +2 -1 lines
Diff to previous 1.98 (colored)

Add cached_realpath()

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

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

Reviewed by: christos

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

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

Revision 1.97 / (download) - annotate - [select for diffs], Sun Jan 17 15:32:38 2016 UTC (8 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.96: +6 -1 lines
Diff to previous 1.96 (colored)

provide missing FD_CLOEXEC for the havenots.

Revision 1.96 / (download) - annotate - [select for diffs], Mon Sep 21 21:50:16 2015 UTC (8 years, 6 months ago) by pooka
Branch: MAIN
Changes since 1.95: +10 -1 lines
Diff to previous 1.95 (colored)

Add more compat defs for code compiled for !NetBSD targets.

At least GNU Hurd lacks MAXHOSTNAMELEN/MAXPATHLEN/PATH_MAX, so make sure
those have some arbitrary semi-sane values.

from Robert Millan in PR misc/50166, with some modifications from myself

Revision 1.95 / (download) - annotate - [select for diffs], Sun Sep 7 20:55:34 2014 UTC (9 years, 6 months ago) by joerg
Branch: MAIN
Changes since 1.94: +2 -40 lines
Diff to previous 1.94 (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.94 / (download) - annotate - [select for diffs], Sat Aug 23 15:05:40 2014 UTC (9 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.93: +41 -3 lines
Diff to previous 1.93 (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.93 / (download) - annotate - [select for diffs], Wed Jul 16 15:33:41 2014 UTC (9 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, 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.92: +2 -1 lines
Diff to previous 1.92 (colored)

PR/48367: David A. Holland: Mark possible submake nodes so that we can
avoid closing the job pipe on exec for them in order to make recursive
makes work in parallel.

Revision 1.92 / (download) - annotate - [select for diffs], Wed Sep 4 15:38:26 2013 UTC (10 years, 6 months ago) by sjg
Branch: MAIN
CVS Tags: yamt-pagecache-base9, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Changes since 1.91: +5 -1 lines
Diff to previous 1.91 (colored)

Add VAR_INTERNAL as a context for variables set by make itself,
which should not override those set by makefiles.
Currently MAKEFILE is the only variable affected.

Reviewed by: christos

Revision 1.91 / (download) - annotate - [select for diffs], Tue Jun 18 20:06:09 2013 UTC (10 years, 9 months ago) by sjg
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Changes since 1.90: +4 -1 lines
Diff to previous 1.90 (colored)

Use a #define for the variable name we put in environment to pass .MAKE.LEVEL
in case we don't want to use gmake's MAKELEVEL in a different way.

Revision 1.90 / (download) - annotate - [select for diffs], Mon Feb 25 01:57:14 2013 UTC (11 years, 1 month ago) by dholland
Branch: MAIN
CVS Tags: agc-symver-base, agc-symver
Changes since 1.89: +2 -2 lines
Diff to previous 1.89 (colored)

Fix obvious typo.

Revision 1.89 / (download) - annotate - [select for diffs], Tue Jun 12 19:21:51 2012 UTC (11 years, 9 months ago) by joerg
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, dholland-make-base
Branch point for: tls-maxphys
Changes since 1.88: +18 -11 lines
Diff to previous 1.88 (colored)

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

Revision 1.88 / (download) - annotate - [select for diffs], Mon Jun 4 20:34:20 2012 UTC (11 years, 9 months ago) by sjg
Branch: MAIN
Changes since 1.87: +2 -1 lines
Diff to previous 1.87 (colored)

Var_UnExport() and setenv() can both realloc environ.
Use a common variable (savedEnv) to track that to avoid wasting memory.
Also, if providing setenv and unsetenv, do getenv too to ensure a consistent
set.

Revision 1.87 / (download) - annotate - [select for diffs], Fri Sep 16 15:38:04 2011 UTC (12 years, 6 months ago) by joerg
Branch: MAIN
CVS Tags: yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus
Branch point for: yamt-pagecache
Changes since 1.86: +5 -1 lines
Diff to previous 1.86 (colored)

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

Revision 1.86 / (download) - annotate - [select for diffs], Wed May 4 20:38:32 2011 UTC (12 years, 10 months ago) by sjg
Branch: MAIN
CVS Tags: cherry-xenmp-base, cherry-xenmp
Changes since 1.85: +2 -1 lines
Diff to previous 1.85 (colored)

Add .MAKE.META.BAILIWICK - to identify the scope of make's control.
meta_oodate: if a file that was written or linked within our bailiwick,
but outside of .OBJDIR is missing, add it to missingFiles.
If we get to the end of the .meta file without seeing it [re]moved,
then consider the target out-of-date.

Revision 1.85 / (download) - annotate - [select for diffs], Sun Feb 20 23:12:09 2011 UTC (13 years, 1 month ago) by joerg
Branch: MAIN
CVS Tags: bouyer-quota2-nbase
Changes since 1.84: +2 -1 lines
Diff to previous 1.84 (colored)

Use the current directory at start time for .PARSEDIR, if the filename
contains no /.

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

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

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

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

Revision 1.82 / (download) - annotate - [select for diffs], Fri Apr 23 00:18:50 2010 UTC (13 years, 11 months ago) by sjg
Branch: MAIN
Changes since 1.81: +8 -1 lines
Diff to previous 1.81 (colored)

On darwin at least, vfork() fails in child of vfork().
It probably shouldn't work anyway, so avoid this.
We use the macro vFork() - a function seems to cause problems
and is unnecessary overhead.

Revision 1.81 / (download) - annotate - [select for diffs], Thu Apr 22 19:11:17 2010 UTC (13 years, 11 months ago) by sjg
Branch: MAIN
Changes since 1.80: +2 -1 lines
Diff to previous 1.80 (colored)

Just because $TMPDIR is set does not mean it is valid.
Add a central function for creating temp files so we have one place to
audit.

Reviewed by: dh

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

Add:

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

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

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

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

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

Fix:

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

Revision 1.79 / (download) - annotate - [select for diffs], Tue Sep 8 17:29:20 2009 UTC (14 years, 6 months ago) by sjg
Branch: MAIN
CVS Tags: matt-premerge-20091211
Changes since 1.78: +2 -1 lines
Diff to previous 1.78 (colored)

Reviewed by: apb

Use .MAKE.LEVEL to track recursion.
The first instance of make will have .MAKE.LEVEL 0, which
can be handy for excluding rules which should not apply
in a sub-make.
gmake and freebsd's make have a similar mechanism, but each
uses a different variable to track it.  Since we cannot be
compatible with both, we allow the makefiles to cope if they want
by handling the export of .MAKE.LEVEL+1 in Var_Set().

Revision 1.78 / (download) - annotate - [select for diffs], Sat Jan 24 14:43:28 2009 UTC (15 years, 2 months ago) by dsl
Branch: MAIN
CVS Tags: jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend
Changes since 1.77: +2 -2 lines
Diff to previous 1.77 (colored)

Fixes to includes of make_malloc.h to that it actually builds when
USE_EMALLOC is undefined.
Fixes earlier fixes :-)

Revision 1.77 / (download) - annotate - [select for diffs], Sat Jan 24 11:59:39 2009 UTC (15 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.76: +2 -5 lines
Diff to previous 1.76 (colored)

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

Revision 1.76 / (download) - annotate - [select for diffs], Sat Dec 13 15:19:29 2008 UTC (15 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.75: +2 -7 lines
Diff to previous 1.75 (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.75 / (download) - annotate - [select for diffs], Sun Dec 7 04:50:15 2008 UTC (15 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.74: +16 -15 lines
Diff to previous 1.74 (colored)

add debug flag for cwd.

Revision 1.74 / (download) - annotate - [select for diffs], Fri Feb 15 21:29:50 2008 UTC (16 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-pf42, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, mjf-devfs2-base, mjf-devfs2, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-nbase, hpcarm-cleanup-base
Changes since 1.73: +3 -3 lines
Diff to previous 1.73 (colored)

back all changes out until I fix it properly.

Revision 1.73 / (download) - annotate - [select for diffs], Thu Feb 14 22:11:20 2008 UTC (16 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: christos-broken
Changes since 1.72: +4 -4 lines
Diff to previous 1.72 (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.72 / (download) - annotate - [select for diffs], Sat Jan 19 06:52:15 2008 UTC (16 years, 2 months ago) by sjg
Branch: MAIN
Changes since 1.71: +3 -2 lines
Diff to previous 1.71 (colored)

Implement -dl (aka LOUD) to override '@' at the start of script lines.
Based on supplied patch.

PR: 37202

Revision 1.71 / (download) - annotate - [select for diffs], Fri Dec 21 20:32:24 2007 UTC (16 years, 3 months ago) by dsl
Branch: MAIN
CVS Tags: matt-armv6-base
Changes since 1.70: +3 -1 lines
Diff to previous 1.70 (colored)

If make can't find a rule to create a file it needs to satisfy a rule
that came from .depend then just output a message and contine.

Revision 1.70 / (download) - annotate - [select for diffs], Mon Oct 8 20:26:36 2007 UTC (16 years, 5 months ago) by sjg
Branch: MAIN
CVS Tags: cube-autoconf-base, cube-autoconf
Changes since 1.69: +4 -3 lines
Diff to previous 1.69 (colored)

Use .MAKE.MAKEFILES to track all the makefiles that have been read
so they can be used in dependency rules.

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

Add the ability to .export variables to the environment.

Revision 1.68 / (download) - annotate - [select for diffs], Mon Oct 1 22:14:11 2007 UTC (16 years, 6 months ago) by sjg
Branch: MAIN
Changes since 1.67: +2 -1 lines
Diff to previous 1.67 (colored)

Add the ability to tweak the token output before targets in job mode.
Eg.
.MAKE.JOB.PREFIX=${.newline}---${.MAKE:T}[${.MAKE.PID}]
would produce
---make[1234] target ---

Revision 1.67 / (download) - annotate - [select for diffs], Mon Jan 1 21:48:43 2007 UTC (17 years, 2 months ago) by dsl
Branch: MAIN
CVS Tags: matt-mips64-base, matt-mips64, hpcarm-cleanup
Branch point for: matt-armv6
Changes since 1.66: +1 -12 lines
Diff to previous 1.66 (colored)

Remove the (now redundant) MAKE_BSIZE, BUF_DEF_SIZE from buf.c is used instead.

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

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

Revision 1.65 / (download) - annotate - [select for diffs], Mon Dec 4 21:34:47 2006 UTC (17 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.64: +2 -2 lines
Diff to previous 1.64 (colored)

There really is no point calling estrdup() to get a copy of the makefile name
into every 'gnode' (aka target), instead just copy a pointer to the string
and avoid freeing the original name when we close the file.
I can't imagine any makefile set where this gives a larger footprint!

Revision 1.64 / (download) - annotate - [select for diffs], Fri Nov 17 22:07:39 2006 UTC (17 years, 4 months ago) by dsl
Branch: MAIN
CVS Tags: netbsd-4-base
Branch point for: netbsd-4
Changes since 1.63: +22 -22 lines
Diff to previous 1.63 (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.63 / (download) - annotate - [select for diffs], Sun Oct 15 08:38:22 2006 UTC (17 years, 5 months ago) by dsl
Branch: MAIN
Changes since 1.62: +2 -1 lines
Diff to previous 1.62 (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.62 / (download) - annotate - [select for diffs], Mon Oct 9 14:36:41 2006 UTC (17 years, 5 months ago) by dsl
Branch: MAIN
Changes since 1.61: +1 -5 lines
Diff to previous 1.61 (colored)

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

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

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

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

More programs using efun.

Revision 1.59 / (download) - annotate - [select for diffs], Fri Mar 10 15:53:55 2006 UTC (18 years ago) by christos
Branch: MAIN
CVS Tags: chap-midi-nbase, chap-midi-base, chap-midi, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.58: +1 -1 lines
Diff to previous 1.58 (colored)

PR/33049: OKANO Takayoshi: Fix the spelling of NetBSD RCS tags.

Revision 1.58 / (download) - annotate - [select for diffs], Sun Feb 26 22:45:46 2006 UTC (18 years, 1 month ago) by apb
Branch: MAIN
Changes since 1.57: +17 -9 lines
Diff to previous 1.57 (colored)

Make ".WAIT" apply recursively to all children of nodes on the right
hand side of the .WAIT, except when the recursive interpretation would
cause a cycle in the dependency graph.

Discussed in tech-toolchain.  Reviewed by christos, sjg.

Revision 1.57 / (download) - annotate - [select for diffs], Sun Jan 22 19:54:55 2006 UTC (18 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.56: +1 -0 lines
Diff to previous 1.56 (colored)

Make .NOTPARALLEL stop the job engine issuing more than one token (instead
of trying to de-jobify the make.
You can now put .NOTPARALLEL in a submake of a recursive make (where it is
using a job-token pipe from the outer make and have it only run a single job.
You can also specify .NOTPARRALEL in the root makefile of a large recursive
make and have the submakes run multiple commands.
Add some diagnostics printfs (enabled with -dp) to the parser.

Revision 1.56 / (download) - annotate - [select for diffs], Sat Dec 24 20:52:20 2005 UTC (18 years, 3 months ago) by perry
Branch: MAIN
Changes since 1.55: +0 -6 lines
Diff to previous 1.55 (colored)

Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.

Revision 1.55 / (download) - annotate - [select for diffs], Fri Jun 17 19:25:20 2005 UTC (18 years, 9 months ago) by jmc
Branch: MAIN
Changes since 1.54: +1 -0 lines
Diff to previous 1.54 (colored)

Add new debugging option '-dn' which will leave the scripts fed into make on
-j jobs in /tmp for debugging purposes. Add a note to the man page that
this could cause problems if run a lot (due to the number of files created)

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

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

Revision 1.53 / (download) - annotate - [select for diffs], Sun May 1 01:25:36 2005 UTC (18 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.52: +2 -1 lines
Diff to previous 1.52 (colored)

Don't accept dependencies for .BEGIN, .END, and .INTERRUPT since they
don't make sense or work anyway.

Revision 1.52 / (download) - annotate - [select for diffs], Thu Jul 15 09:01:29 2004 UTC (19 years, 8 months ago) by yamt
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.51: +11 -1 lines
Diff to previous 1.51 (colored)

define __GNUC_PREREQ__ if it isn't available on host.

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

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

Revision 1.50 / (download) - annotate - [select for diffs], Sun Dec 7 20:30:28 2003 UTC (20 years, 3 months ago) by dsl
Branch: MAIN
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-base, 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-0, netbsd-2
Changes since 1.49: +2 -1 lines
Diff to previous 1.49 (colored)

Add a -Dg3 which outputs the 'input graph' only on error exit.
Lets you see the wood for the trees...

Revision 1.49 / (download) - annotate - [select for diffs], Sat Sep 27 21:29:37 2003 UTC (20 years, 6 months ago) by sjg
Branch: MAIN
Changes since 1.48: +8 -1 lines
Diff to previous 1.48 (colored)

Implement :[] modifier to allow picking a range of words out of a variable.
Also :tW and a W flag to :C and :S to allow treating value as a single word.
Add unit tests for the above, and fix some corner cases.
Based on patches supplied by Alan Barrett <apb@cequrux.com>

Revision 1.48 / (download) - annotate - [select for diffs], Wed Sep 10 18:04:23 2003 UTC (20 years, 6 months ago) by jmmv
Branch: MAIN
Changes since 1.47: +2 -1 lines
Diff to previous 1.47 (colored)

Add the 'e' debug flag (i.e., '-d e'):  when enabled, show the "target
failed" and "command failed" messages added recently.  These introduce
too much noise when debugging some kind of problems, specially in pkgsrc.

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

Pass WARNS=3

Revision 1.45 / (download) - annotate - [select for diffs], Fri Mar 14 05:19:43 2003 UTC (21 years ago) by thorpej
Branch: MAIN
Changes since 1.44: +4 -1 lines
Diff to previous 1.44 (colored)

Add a -X option, which prevents make(1) from putting variables
set on the command line into the environment individually.  This
can be useful on systems which have a tight limit on the size
of the argument space.

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

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

Revision 1.43 / (download) - annotate - [select for diffs], Wed Mar 20 18:10:30 2002 UTC (22 years ago) by pk
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6
Changes since 1.42: +5 -1 lines
Diff to previous 1.42 (colored)

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

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

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

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

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

Make_HandleUse() no longer has a return value,

Revision 1.41 / (download) - annotate - [select for diffs], Mon Feb 4 17:24:56 2002 UTC (22 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.40: +3 -4 lines
Diff to previous 1.40 (colored)

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

Revision 1.40 / (download) - annotate - [select for diffs], Sun Feb 3 21:41:44 2002 UTC (22 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.39: +3 -2 lines
Diff to previous 1.39 (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.39 / (download) - annotate - [select for diffs], Wed Oct 31 03:59:42 2001 UTC (22 years, 5 months ago) by tv
Branch: MAIN
Changes since 1.38: +2 -1 lines
Diff to previous 1.38 (colored)

Overhaul the initialization and handling of .OBJDIR:

* Replace chdir_verify_path() with Main_SetObjdir(), which can be called
  externally, and can take a "const char *".  (There's a lot of non-const
  "char *" passing around in var.c of what should be const strings....)

* Rewrite the initial "find my .OBJDIR" code to make use of the new
  function.  This still functions as it had in the past, but the comment
  above this block was changed to reflect reality:  if MAKEOBJDIRPREFIX
  or MAKEOBJDIR are set in the environment, then *only that value* is
  tried; make does not fall back to obj.MACHINE, obj, and /usr/obj/`pwd`
  as it would without these env vars set.

* Add a new special target, .OBJDIR:, which when parsed will cause make to
  change to a new object directory and reset .OBJDIR, and PWD in the
  environment.  This will allow some makefiles (mainly, src/tools)
  to override the default objdir semantics in order to add custom logic.

Revision 1.38 / (download) - annotate - [select for diffs], Wed Oct 31 01:15:57 2001 UTC (22 years, 5 months ago) by tv
Branch: MAIN
Changes since 1.37: +3 -2 lines
Diff to previous 1.37 (colored)

Allow "-m" to be used in a .MAKEFLAGS: special target and get it to work.
(This splits out the "default system include paths" into its own Lst
variable, and uses it only if sysIncPath is empty.  This allows sysIncPath
to be filled in by the Makefile itself.)

Revision 1.37 / (download) - annotate - [select for diffs], Sun Sep 16 16:34:43 2001 UTC (22 years, 6 months ago) by wiz
Branch: MAIN
Changes since 1.36: +2 -2 lines
Diff to previous 1.36 (colored)

Spell 'occurred' with two 'r's.

Revision 1.36 / (download) - annotate - [select for diffs], Tue Jul 3 18:08:51 2001 UTC (22 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.35: +2 -1 lines
Diff to previous 1.35 (colored)

add .USEBEFORE Attribute

Revision 1.35 / (download) - annotate - [select for diffs], Sat Jun 9 05:22:47 2001 UTC (22 years, 9 months ago) by sjg
Branch: MAIN
Changes since 1.34: +3 -1 lines
Diff to previous 1.34 (colored)

Modify handling of command line variable assignments and their exporting
via MAKEFLAGS.  Instead of appending them directly to .MAKEFLAGS, put
them in .MAKEOVERRIDES (and ensure they are quoted).  This is now done
in Var_Set when it exports VAR_CMD's.
Use ExportMAKEFLAGS() to export MAKEFLAGS, using the combined content
of .MAKEFLAGS and .MAKEOVERRIDES (with duplicate supression).
If .MAKEFLAGS is assigned to in a Makefile, ExportMAKEFLAGS is called again.
This allows a line like:
.MAKEOVERRIDES=
to effectively stop the exporting of the command line vars in MAKEFLAGS.

Revision 1.34 / (download) - annotate - [select for diffs], Fri Jun 1 20:33:37 2001 UTC (22 years, 10 months ago) by sjg
Branch: MAIN
Changes since 1.33: +3 -1 lines
Diff to previous 1.33 (colored)

A number of semi-related changes.
1. make -dx turns on DEBUG_SHELL which causes sh -x to be used where
   possible.
2. PrintOnError() is now called when make is stopping due to an error.
   This routine reports the curdir and the value of any variables listed
   in MAKE_PRINT_VAR_ON_ERROR.
3. Variables set via command line, are propagated to child-makes via
   MAKEFLAGS.  This behaviour appears to be necessary for POSIX (according
   to the GNU folk anyway).
4. Do not reset MAKEFILE when reading ".depend" as this rather eliminates the
   usefulness of ${MAKEFILE}.
5. Added ${.newline} as a simple means of being able to include \n in the
   result of a :@ loop expansion.
6. Set ${MAKE_VERSION} if defined.  Need to come up with a useful value.

Reviewed: christos

Revision 1.33 / (download) - annotate - [select for diffs], Sun Jan 14 05:34:06 2001 UTC (23 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.32: +3 -1 lines
Diff to previous 1.32 (colored)

- make the second list of commands override the first like gmake does
- remember where the first command definition occured so that we can debug
  things.

Revision 1.32 / (download) - annotate - [select for diffs], Wed Jan 10 15:54:00 2001 UTC (23 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.31: +6 -1 lines
Diff to previous 1.31 (colored)

PR/11800: Chris Demetriou: Add -W flag to exit on parse warnings.
While I am here, s/make:.*"/%s:\1", progname/

Revision 1.31 / (download) - annotate - [select for diffs], Mon Jan 1 15:50:23 2001 UTC (23 years, 3 months ago) by sommerfeld
Branch: MAIN
Changes since 1.30: +3 -1 lines
Diff to previous 1.30 (colored)

Missing bit of last change

Revision 1.30 / (download) - annotate - [select for diffs], Sat Dec 30 02:05:21 2000 UTC (23 years, 3 months ago) by sommerfeld
Branch: MAIN
Changes since 1.29: +4 -1 lines
Diff to previous 1.29 (colored)

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

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

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

Revision 1.29 / (download) - annotate - [select for diffs], Sun Jun 11 07:39:53 2000 UTC (23 years, 9 months ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5
Changes since 1.28: +2 -1 lines
Diff to previous 1.28 (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.28 / (download) - annotate - [select for diffs], Sat Jun 10 22:28:33 2000 UTC (23 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.27: +0 -1 lines
Diff to previous 1.27 (colored)

Back out last night's optimization for now.

Revision 1.27 / (download) - annotate - [select for diffs], Sat Jun 10 21:44:08 2000 UTC (23 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.26: +2 -1 lines
Diff to previous 1.26 (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.26 / (download) - annotate - [select for diffs], Thu Jun 1 04:16:39 2000 UTC (23 years, 10 months ago) by mycroft
Branch: MAIN
Changes since 1.25: +2 -1 lines
Diff to previous 1.25 (colored)

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

Revision 1.25 / (download) - annotate - [select for diffs], Thu May 4 18:27:53 2000 UTC (23 years, 10 months ago) by drochner
Branch: MAIN
CVS Tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

make cleaner C for more picky compilers

Revision 1.24 / (download) - annotate - [select for diffs], Thu Apr 20 11:23:26 2000 UTC (23 years, 11 months ago) by sjg
Branch: MAIN
Changes since 1.23: +3 -1 lines
Diff to previous 1.23 (colored)

Changes to make MAKEOBJDIRPREFIX useful.

Firstly, we ignore getenv("PWD") if MAKEOBJDIRPREFIX is set so that we always
get the same value for .CURDIR regardless of how make was invoked.

Second, when executing a command we check if it is ${.MAKE} or ${.MAKE:T}
without a preceeding chdir, if so we insert a chdir(${.CURDIR}) so that
the Makefile will be found by the child make.  Note that this behaviour is
dissabled if MAKEOBJDIRPREFIX is not set or if NOCHECKMAKECHDIR is set.
See the comments in main.c for more detail.

With these two changes, one can successfully build usr/src using MAKEOBJDIRPREFIX
allowing the src to be mounted from a CD-ROM.

Revision 1.23 / (download) - annotate - [select for diffs], Thu Sep 16 19:57:54 1999 UTC (24 years, 6 months ago) by kim
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, comdex-fall-1999-base, comdex-fall-1999
Changes since 1.22: +6 -1 lines
Diff to previous 1.22 (colored)

Make this compile on Solaris...

Revision 1.22 / (download) - annotate - [select for diffs], Wed Sep 15 02:56:34 1999 UTC (24 years, 6 months ago) by mycroft
Branch: MAIN
Changes since 1.21: +3 -2 lines
Diff to previous 1.21 (colored)

Replace the linear variable list in the GNode with a hash table.  Gives a
small (~10% on my machine) speedup building libc.
Changes by: perry (+ bug fix and minor change by me)
Reviewed by: mycroft sommerfeld

Revision 1.21 / (download) - annotate - [select for diffs], Wed Nov 11 19:37:06 1998 UTC (25 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, netbsd-1-4
Changes since 1.20: +6 -4 lines
Diff to previous 1.20 (colored)

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

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

Revision 1.20 / (download) - annotate - [select for diffs], Sun Oct 18 14:23:48 1998 UTC (25 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.19: +8 -6 lines
Diff to previous 1.19 (colored)

Only define const and volatile when __STDC__ is not defined (for BOOTSTRAP)

Revision 1.19 / (download) - annotate - [select for diffs], Thu May 21 17:19:46 1998 UTC (25 years, 10 months ago) by tv
Branch: MAIN
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

Make a MAKE_BOOTSTRAP case work on NetBSD, too, for cross-compile cases

Revision 1.18 / (download) - annotate - [select for diffs], Tue Sep 23 21:15:08 1997 UTC (26 years, 6 months ago) by fair
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: +3 -3 lines
Diff to previous 1.17 (colored)

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

Revision 1.17 / (download) - annotate - [select for diffs], Thu May 8 21:24:46 1997 UTC (26 years, 10 months ago) by gwr
Branch: MAIN
Changes since 1.16: +2 -1 lines
Diff to previous 1.16 (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.16 / (download) - annotate - [select for diffs], Fri May 2 14:24:28 1997 UTC (26 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.15: +3 -1 lines
Diff to previous 1.15 (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.15 / (download) - annotate - [select for diffs], Mon Mar 10 21:20:00 1997 UTC (27 years ago) by christos
Branch: MAIN
Changes since 1.14: +3 -1 lines
Diff to previous 1.14 (colored)

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

Revision 1.14 / (download) - annotate - [select for diffs], Thu Feb 20 16:51:49 1997 UTC (27 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.13: +3 -1 lines
Diff to previous 1.13 (colored)

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

Revision 1.13 / (download) - annotate - [select for diffs], Tue Dec 31 18:02:22 1996 UTC (27 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.12: +3 -2 lines
Diff to previous 1.12 (colored)

BSD did not traditionally have <sys/cdefs.h>; use BSD4_4 instead and include
<sys/param.h> to grab it.

Revision 1.12 / (download) - annotate - [select for diffs], Tue Dec 31 17:55:02 1996 UTC (27 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.11: +17 -9 lines
Diff to previous 1.11 (colored)

define const and volatile for non __STDC__

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

Protect __P from being multiply defined (for systems that already define it)

Revision 1.9 / (download) - annotate - [select for diffs], Wed Mar 6 00:15:21 1996 UTC (28 years ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-BETA
Branch point for: netbsd-1-2
Changes since 1.8: +3 -1 lines
Diff to previous 1.8 (colored)

Fix PR/2118; apply sysincludes patch.

Revision 1.8 / (download) - annotate - [select for diffs], Sun Feb 4 22:20:53 1996 UTC (28 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

fix pr/1421 and pr/1997

Revision 1.7 / (download) - annotate - [select for diffs], Sat Dec 16 05:03:11 1995 UTC (28 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.6: +2 -1 lines
Diff to previous 1.6 (colored)

- Added .WAIT to synchronize between sources like other pmake variants.
- Updated documentation to include .ORDER .PARALLEL .NO_PARALLEL .NONPARALLEL

Revision 1.6 / (download) - annotate - [select for diffs], Wed Jun 14 15:19:43 1995 UTC (28 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Changes since 1.5: +6 -4 lines
Diff to previous 1.5 (colored)

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

Revision 1.5 / (download) - annotate - [select for diffs], Mon May 9 06:36:21 1994 UTC (29 years, 10 months ago) by glass
Branch: MAIN
CVS Tags: netbsd-1-0-base, netbsd-1-0-RELEASE, netbsd-1-0-PATCH1, netbsd-1-0-PATCH06, netbsd-1-0-PATCH05, netbsd-1-0-PATCH04, netbsd-1-0-PATCH03, netbsd-1-0-PATCH02, netbsd-1-0-PATCH0, netbsd-1-0
Changes since 1.4: +7 -1 lines
Diff to previous 1.4 (colored)

bootstrap improvements

Revision 1.4 / (download) - annotate - [select for diffs], Sun Apr 17 03:09:51 1994 UTC (29 years, 11 months ago) by glass
Branch: MAIN
Changes since 1.3: +3 -1 lines
Diff to previous 1.3 (colored)

bootstrap changes

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

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

Revision 1.2 / (download) - annotate - [select for diffs], Sun Aug 1 18:12:00 1993 UTC (30 years, 8 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 / (download) - annotate - [select for diffs], Sun Mar 21 09:45:37 1993 UTC (31 years 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>