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.
- fix the variable substitution code in make [PR/2748]
1. change s/a/b/ so that it substitutes the first occurance of the
pattern on each word, not only the first word.
2. add flag '1' to the variable substitution so that the substitutions
get performed only once.
***THIS IS AN INCOMPATIBLE CHANGE!***
Unfortunately there was no way to make things consistent without
modifying the current behavior. Fortunately none of our Makefiles
depended on this.
OLD:
VAR = aa1 aa2 aa3 aa4
S/a/b/ = ba1 aa2 aa3 aa4
S/a/b/g = bb1 bb2 bb3 bb4
NEW:
VAR = aa1 aa2 aa3 aa4
S/a/b/ = ba1 ba2 ba3 ba4
S/a/b/1 = ba1 aa2 aa3 aa4
S/a/b/g = bb1 bb2 bb3 bb4
S/a/b/1g = bb1 aa2 aa3 aa4
- add regexp variable substitution via 'C/foo/bar/' [PR/2752]
- add variable quoting via the ${VAR:Q} modifier. This is useful when running
recursive invocations of make(1):
make VAR=${VAR:Q}
will always work... (This may prove useful in the kernel builds...) [PR/2981]
referenced only by their basename and not by their full pathname. This
breaks when .PATH or MAKEOBJDIR are used. There might be Makefiles around
that try to work around this bug by prepending ${.CURDIR} to the sources,
and they should be found and fixed. Also a lot of the gunk in suff.c that
was attempting to work around the same problem could be removed.
arch.c: Don't require ranlib stuff. Not everybody has it.
dir.c: SunOS-4 != Solaris; change #ifdef sun to #if sun && !__svr4__
job.c, compat.c: Don't use 'union wait', use int and the W*() macros.
main.c: Check for uname() == -1; some unames return > 0...
util.c, job.c: Add signal() with BSD semantics for svr4, don't use bsd
sigmask and friends.
- ${.PREFIX} should never contain a full pathname
- Fixed gcc -Wall warnings
Major:
- compatMake is now FALSE. This means that we are now running in
full pmake mode:
* rules on dependency lines can be executed in parallel and or
out of sequence:
foo: bar baz
can fire the rule for baz before the rule for bar is fired.
To enforce bar to be fired before baz, another rule needs to be
added. [bar: baz]
* adjacent shell commands in a target are now executed by a single
invocation of the shell, not one invocation of the shell per line
(compatMake can be turned off using the -B flag)
- The -j flag now works... I.e. make -j 4 will fork up to four jobs in
parallel when it can. The target name is printed before each burst
of output caused by the target execution as '--- target ---', when j > 1
- I have changed all the Makefiles so that they work with make -j N, and
I have tested the whole netbsd by:
'make -j 4 cleandir; make -j 4 depend; make -j 4; make -j 4 install'
- I have not compiled or tested this version of make with -DREMOTE.
Dependency rules with `=' in the lhs are parsed as variable assignments.
E.g., the following Makefile fails:
A=a b c d
all: $(A:%=%b)
$(A:%=%b):
@echo $@