#
acecf207 |
| 23-Jun-2023 |
rillig <rillig@NetBSD.org> |
make: warn about malformed patterns in ':M', ':N' and '.if make(...)'
These patterns shouldn't occur in practice, as their results are tricky to predict. Generate a warning for now, and maybe an er
make: warn about malformed patterns in ':M', ':N' and '.if make(...)'
These patterns shouldn't occur in practice, as their results are tricky to predict. Generate a warning for now, and maybe an error later.
Reviewed by sjg@.
show more ...
|
#
15e29204 |
| 22-Jun-2023 |
rillig <rillig@NetBSD.org> |
make: clean up comments related to pattern matching
|
#
71e9c21d |
| 24-Jan-2023 |
sjg <sjg@NetBSD.org> |
make: .SYSPATH: to add dirs to sysIncPath
.SYSPATH: with no sources will clear sysIncPath otherwise sources are added
Reviewed by: rillig
|
#
c30004d8 |
| 07-May-2022 |
rillig <rillig@NetBSD.org> |
make: fix grammar in comment of DirFindDot
|
#
2bf5716a |
| 04-Feb-2022 |
rillig <rillig@NetBSD.org> |
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
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.
show more ...
|
#
01d09bed |
| 30-Jan-2022 |
christos <christos@NetBSD.org> |
Make the GNode lineno unsigned to fix lint warning in var.c calling PrintLocation()
|
#
028fbff8 |
| 15-Dec-2021 |
rillig <rillig@NetBSD.org> |
make: use consistent indentation for statements and continuations
No binary change, except for line numbers in assertions in suff.c.
|
#
9c984aeb |
| 28-Nov-2021 |
rillig <rillig@NetBSD.org> |
make: eliminate CachedStatsFlags
Having two boolean flags as parameters should be easier to understand than bit manipulations. The variable names now match more directly.
No functional change.
|
#
13cde673 |
| 28-Nov-2021 |
rillig <rillig@NetBSD.org> |
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
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.
show more ...
|
#
f97ee5a1 |
| 21-Sep-2021 |
rillig <rillig@NetBSD.org> |
make: remove unnecessary const from parameters
These were leftovers from earlier refactorings, when extracting code to separate functions.
No functional change.
|
#
ffabfdae |
| 04-Apr-2021 |
rillig <rillig@NetBSD.org> |
make: remove filler word 'Do' from function names for parsing
No functional change, except for debug logging.
|
#
4ec8d01b |
| 03-Apr-2021 |
rillig <rillig@NetBSD.org> |
make: use C99 bool type instead of defining its own
No functional change.
|
#
7ade2e5b |
| 05-Feb-2021 |
rillig <rillig@NetBSD.org> |
make: add const to SearchPath_Print
|
#
2e255660 |
| 05-Feb-2021 |
rillig <rillig@NetBSD.org> |
make: add shortcut Global_Delete for deleting a global variable
|
#
7aff596c |
| 04-Feb-2021 |
rillig <rillig@NetBSD.org> |
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 vari
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.
show more ...
|
#
202781ed |
| 03-Feb-2021 |
rillig <rillig@NetBSD.org> |
make: replace Global_AppendExpand with Global_Append
All callers with a variable name that is guaranteed to not contain a dollar sign have been converted to call Global_Append instead of the previou
make: replace Global_AppendExpand with Global_Append
All callers with a variable name that is guaranteed to not contain a dollar sign have been converted to call Global_Append instead of the previous Global_AppendExpand. After that, Global_AppendExpand was unused, therefore it was effectively just renamed.
show more ...
|
#
290f2cf8 |
| 03-Feb-2021 |
rillig <rillig@NetBSD.org> |
make: use shortcut functions Global_SetExpand and Global_AppendExpand
There are many places where global variables are set or appended to. To reduce clutter and code size, encode the VAR_GLOBAL in
make: use shortcut functions Global_SetExpand and Global_AppendExpand
There are many places where global variables are set or appended to. To reduce clutter and code size, encode the VAR_GLOBAL in the function name.
The word Expand in the function names says that the variable name is expanded. In most of the cases, this is not necessary, but there are no corresponding functions Global_Set or Global_Append yet.
Encoding the information whether the name is expanded or not in the function name will make inconsistencies obvious in future manual code reviews. Letting the compiler check this by using different types for unexpanded and expanded variable names is probably not worth the effort. There are still a few bugs to be fixed, such as in SetVar, which expands the variable name twice in a row.
show more ...
|
#
5d616341 |
| 30-Jan-2021 |
rillig <rillig@NetBSD.org> |
make(1): split Buf_Destroy into Buf_Done and Buf_DoneData
In all cases except one, the boolean argument to Buf_Destroy was constant. Removing that argument by splitting the function into two separa
make(1): split Buf_Destroy into Buf_Done and Buf_DoneData
In all cases except one, the boolean argument to Buf_Destroy was constant. Removing that argument by splitting the function into two separate functions makes the intention clearer on the call site. It also removes the possibility for using the return value of Buf_Done, which would have made no sense.
The function Buf_Done now pairs with Buf_Init, just as in HashTable and Lst.
Even though Buf_Done is essentially a no-op, it is kept as a function, both for symmetry with Buf_Init and for clearing the Buffer members after use (this will be done only in CLEANUP mode, in a follow-up commit).
show more ...
|
#
743212e4 |
| 24-Jan-2021 |
rillig <rillig@NetBSD.org> |
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.
|
#
7421cbe3 |
| 23-Jan-2021 |
rillig <rillig@NetBSD.org> |
make(1): split Dir_FindFile into separate functions
|
#
6a5f014e |
| 23-Jan-2021 |
rillig <rillig@NetBSD.org> |
make(1): remove the remaining beasts from the comments
|
#
5b35dd4c |
| 23-Jan-2021 |
rillig <rillig@NetBSD.org> |
make(1): extend comments in dir.c
|
#
cdbcae32 |
| 23-Jan-2021 |
rillig <rillig@NetBSD.org> |
make(1): rename Dir_AddDir, reorder parameters of SearchPath_ToFlags
|
#
160fa363 |
| 23-Jan-2021 |
rillig <rillig@NetBSD.org> |
make(1): extract SearchPath_ExpandMiddle from SearchPath_Expand
|
#
4a6b450e |
| 23-Jan-2021 |
rillig <rillig@NetBSD.org> |
make(1): split local variable in SearchPath_Expand
|