diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-04-01 07:28:29 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-04-01 07:28:29 +0000 |
commit | 2ea210d86004d0167acb9219e03c6f617b3aa9c3 (patch) | |
tree | 36f6ba50c02f895f144101d86c23c124a0e69eec /usr.bin/make/targ.c | |
parent | 578efbfa2de99f72e0c84130ddba49afb782a27e (diff) |
Sync with NetBSD (mostly by christos initial substitution/regexp from Der Mouse)
- 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]
- BSD did not traditionally have <sys/cdefs.h>; use BSD4_4 instead and include
<sys/param.h> to grab it.
- Don't compile the regex code if MAKE_BOOTSTRAP (from gwr)
- Use explicit .c.o rule in Makefile.boot so that the bootstrap process works.
- Use only integral types in procedure arguments. [buf.c buf.h]
- Include <stdlib.h> to get getenv() prototype on SVR4
- if __STDC__ -> ifdef __STDC__ to appease SVR4
- Define const and volatile for non __STDC__
- Implement snprintf() and vsnprintf() for non BSD4_4 systems.
- Make $MACHINE_ARCH settable from the environment.
- Fix .USE directive problems: (reported by cgd)
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.
- 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.
- Fix problems in the RE substitution error handling.
- Locate all the children of a node marked as MADE.
- Do not compile-in ${MACHINE} (as per NetBSD PR#3386)
- Disable globbing for targets/dependencies when POSIX is defined.
- Fix globbing so that patterns that don't have a matching number of [] or {}
don't get expanded. (before the [ case got expanded to nothing!) This is
disabled.
- Make sure that the children of nodes that are marked .MADE, are marked
UPTODATE and their timestamps are consistent.
- Don't disable wildcards completely; they are used by other Makefiles.
Diffstat (limited to 'usr.bin/make/targ.c')
-rw-r--r-- | usr.bin/make/targ.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c index 48b492350af..80a9293362c 100644 --- a/usr.bin/make/targ.c +++ b/usr.bin/make/targ.c @@ -1,5 +1,5 @@ -/* $OpenBSD: targ.c,v 1.5 1996/11/30 21:09:05 millert Exp $ */ -/* $NetBSD: targ.c,v 1.10 1996/11/06 17:59:27 christos Exp $ */ +/* $OpenBSD: targ.c,v 1.6 1997/04/01 07:28:24 millert Exp $ */ +/* $NetBSD: targ.c,v 1.11 1997/02/20 16:51:50 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94"; #else -static char *rcsid = "$OpenBSD: targ.c,v 1.5 1996/11/30 21:09:05 millert Exp $"; +static char *rcsid = "$OpenBSD: targ.c,v 1.6 1997/04/01 07:28:24 millert Exp $"; #endif #endif /* not lint */ @@ -166,6 +166,7 @@ Targ_NewGN (name) gn = (GNode *) emalloc (sizeof (GNode)); gn->name = estrdup (name); + gn->uname = NULL; gn->path = (char *) 0; if (name[0] == '-' && name[1] == 'l') { gn->type = OP_LIB; @@ -215,6 +216,8 @@ TargFreeGN (gnp) free(gn->name); + if (gn->uname) + free(gn->uname); if (gn->path) free(gn->path); |