diff options
| author | mycroft <mycroft@NetBSD.org> | 1997-05-06 22:06:58 +0000 |
|---|---|---|
| committer | mycroft <mycroft@NetBSD.org> | 1997-05-06 22:06:58 +0000 |
| commit | 5be8dcf32a673f62cf59cd47b9d3a4734f5999df (patch) | |
| tree | 4d0bf10e0be69250bd5672c202c4faff4c1a35ad /usr.bin/make | |
| parent | d9a167a17bafa49379b28d4d5b7b6147c07b84b3 (diff) | |
Don't do a suffix search for a .PHONY target.
Diffstat (limited to 'usr.bin/make')
| -rw-r--r-- | usr.bin/make/suff.c | 84 |
1 files changed, 43 insertions, 41 deletions
diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c index 8ab101f503d..9bb4ca06380 100644 --- a/usr.bin/make/suff.c +++ b/usr.bin/make/suff.c @@ -1,4 +1,4 @@ -/* $NetBSD: suff.c,v 1.14 1997/05/02 14:24:32 christos Exp $ */ +/* $NetBSD: suff.c,v 1.15 1997/05/06 22:06:58 mycroft Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; #else -static char rcsid[] = "$NetBSD: suff.c,v 1.14 1997/05/02 14:24:32 christos Exp $"; +static char rcsid[] = "$NetBSD: suff.c,v 1.15 1997/05/06 22:06:58 mycroft Exp $"; #endif #endif /* not lint */ @@ -2065,52 +2065,54 @@ sfnd_abort: * on the lhs of a dependency operator or [XXX] it has neither * children or commands) as the old pmake did. */ - gn->path = Dir_FindFile(gn->name, - (targ == NULL ? dirSearchPath : - targ->suff->searchPath)); - if (gn->path != NULL) { - char *ptr; - Var_Set(TARGET, gn->path, gn); - - if (targ != NULL) { - /* - * Suffix known for the thing -- trim the suffix off - * the path to form the proper .PREFIX variable. - */ - int savep = strlen(gn->path) - targ->suff->nameLen; - char savec; + if ((gn->type & OP_PHONY) == 0) { + gn->path = Dir_FindFile(gn->name, + (targ == NULL ? dirSearchPath : + targ->suff->searchPath)); + if (gn->path != NULL) { + char *ptr; + Var_Set(TARGET, gn->path, gn); + + if (targ != NULL) { + /* + * Suffix known for the thing -- trim the suffix off + * the path to form the proper .PREFIX variable. + */ + int savep = strlen(gn->path) - targ->suff->nameLen; + char savec; - if (gn->suffix) - gn->suffix->refCount--; - gn->suffix = targ->suff; - gn->suffix->refCount++; + if (gn->suffix) + gn->suffix->refCount--; + gn->suffix = targ->suff; + gn->suffix->refCount++; - savec = gn->path[savep]; - gn->path[savep] = '\0'; + savec = gn->path[savep]; + gn->path[savep] = '\0'; - if ((ptr = strrchr(gn->path, '/')) != NULL) - ptr++; - else - ptr = gn->path; + if ((ptr = strrchr(gn->path, '/')) != NULL) + ptr++; + else + ptr = gn->path; - Var_Set(PREFIX, ptr, gn); + Var_Set(PREFIX, ptr, gn); - gn->path[savep] = savec; - } else { - /* - * The .PREFIX gets the full path if the target has - * no known suffix. - */ - if (gn->suffix) - gn->suffix->refCount--; - gn->suffix = NULL; + gn->path[savep] = savec; + } else { + /* + * The .PREFIX gets the full path if the target has + * no known suffix. + */ + if (gn->suffix) + gn->suffix->refCount--; + gn->suffix = NULL; - if ((ptr = strrchr(gn->path, '/')) != NULL) - ptr++; - else - ptr = gn->path; + if ((ptr = strrchr(gn->path, '/')) != NULL) + ptr++; + else + ptr = gn->path; - Var_Set(PREFIX, ptr, gn); + Var_Set(PREFIX, ptr, gn); + } } } |
