From 08c8105c5468ff743d2f2ff2fdf3b77a6313b53e Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 16 May 2004 19:16:52 +0000 Subject: Various enhancements - OS/2 Patches - OpenVMS updates - Sanitize the handling of -include/sinclude with and without -k - Fix the setting of $< for order-only rules. --- commands.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'commands.c') diff --git a/commands.c b/commands.c index a1766b4..b202f6c 100644 --- a/commands.c +++ b/commands.c @@ -41,6 +41,7 @@ extern int getpid (); static void set_file_variables (struct file *file) { + struct dep *d; char *at, *percent, *star, *less; #ifndef NO_ARCHIVES @@ -105,8 +106,14 @@ set_file_variables (struct file *file) } star = file->stem; - /* $< is the first dependency. */ - less = file->deps != 0 ? dep_name (file->deps) : ""; + /* $< is the first not order-only dependency. */ + less = ""; + for (d = file->deps; d != 0; d = d->next) + if (!d->ignore_mtime) + { + less = dep_name (d); + break; + } if (file->cmds == default_file->cmds) /* This file got its commands from .DEFAULT. @@ -134,7 +141,6 @@ set_file_variables (struct file *file) char *caret_value; char *qp; char *bp; - struct dep *d; unsigned int len; /* Compute first the value for $+, which is supposed to contain -- cgit v1.2.3