Instead of adding MAKE_BOOTSTRAP for hosted environments, i.e., when
you want things simple, instead add MAKE_NATIVE to get those hugely
important features like __RCSID().
It's now possible to build make on some hosts with: cc *.c */*.c
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>
Unfortunately this revealed a deeper problem with the brk_string code.
To fix it:
- remove sharing of the buffer between brk_string invocations
- change the semantics of brk_string so that the argument array
starts with 0, and return the buffer where the strings are
stored
var.c: Minor memory leak plugged.
suff.c: Don't add extra sources on the null suffix if it has dependency
lines or commands attached to it [POSIX says so]
The following two patches fix a couple of problems with make(1)
1. Null Suffixes were not being copied, but they were being free'd
This caused rules of the form:
.c:
${CC} ...
to access invalid memory and potentially core dump..
[That was always broken; I did not break that one :-)]
2. My recent fixes to parse ${VAR:%.foo=%.bar} handled the null string
case incorrectly (${VAR:=.c} was broken).