Commit Graph

8 Commits

Author SHA1 Message Date
rillig
6de75a95f8 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.
2020-09-13 15:15:51 +00:00
rillig
de1804033e make(1): fix inconsistent code indentation 2020-09-12 14:41:00 +00:00
rillig
90b52971fa make(1): improve documentation for enum.c and enum.h 2020-09-01 20:34:51 +00:00
rillig
851c5fa92a make(1): fix build errors for USER_CPPFLAGS=-DNDEBUG
The functions LstIsValid and LstNodeIsValid are only used in assertions.

Without the always-false assertion, Enum_ValueToString could have
returned undefined behavior.
2020-08-28 19:46:04 +00:00
rillig
fa70c4fdc5 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.
2020-08-24 20:15:51 +00:00
rillig
0eefc20b94 make(1): clean up indentation, includes, add documentation 2020-08-09 09:44:14 +00:00
rillig
472afa9e32 make(1): fix CRLF line endings in newly added files 2020-08-08 14:43:28 +00:00
rillig
619278f158 make(1): add more detailed debug logging for variable modifiers
Before a modifier is applied to a variable, it is not yet parsed,
therefore it is only possible to log a rough estimate of the modifier.
But after applying it, the parsing position has advanced, and the full
modifier can be logged.

In addition, to fully understand how the modifiers work, it's not enough
to just know the variable names and values, there are also some flags
that influence how the modifiers behave.  The most influential is
VARE_WANTRES.

Thanks to sjg for the extensive review and valuable feedback on the
first drafts.
2020-08-08 13:50:23 +00:00