From 3024918fcd7c73b32e1446c9ec5d75ef93b981f6 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 22 Jun 1996 21:42:13 +0000 Subject: Sat Jun 22 14:56:05 1996 Roland McGrath * file.c (file_hash_enter): Allow renaming :: to : when latter is non-target, or : to :: when former is non-target. --- file.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index aa31077..acc0fd6 100644 --- a/file.c +++ b/file.c @@ -1,5 +1,5 @@ /* Target file hash table management for GNU Make. -Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc. +Copyright (C) 1988,89,90,91,92,93,94,95,96 Free Software Foundation, Inc. This file is part of GNU Make. GNU Make is free software; you can redistribute it and/or modify @@ -295,12 +295,17 @@ in favor of those for `%s'.", merge_variable_set_lists (&oldfile->variables, file->variables); - if (oldfile->double_colon && !file->double_colon) + if (oldfile->double_colon && file->is_target && !file->double_colon) fatal ("can't rename single-colon `%s' to double-colon `%s'", oldname, name); - if (!oldfile->double_colon && file->double_colon) - fatal ("can't rename double-colon `%s' to single-colon `%s'", - oldname, name); + if (!oldfile->double_colon && file->double_colon) + { + if (oldfile->is_target) + fatal ("can't rename double-colon `%s' to single-colon `%s'", + oldname, name); + else + oldfile->double_colon = file->double_colon; + } if (file->last_mtime > oldfile->last_mtime) /* %%% Kludge so -W wins on a file that gets vpathized. */ @@ -332,7 +337,7 @@ remove_intermediates (sig) register int i; register struct file *f; char doneany; - + if (question_flag || touch_flag) return; if (sig && just_print_flag) @@ -412,7 +417,7 @@ snap_deps () free (d->name); d->name = 0; } - + for (f = lookup_file (".PRECIOUS"); f != 0; f = f->prev) for (d = f->deps; d != 0; d = d->next) for (f2 = d->file; f2 != 0; f2 = f2->prev) @@ -522,11 +527,11 @@ print_file (f) if (!f->is_target) puts ("# Not a target:"); printf ("%s:%s", f->name, f->double_colon ? ":" : ""); - + for (d = f->deps; d != 0; d = d->next) printf (" %s", dep_name (d)); putchar ('\n'); - + if (f->precious) puts ("# Precious file (dependency of .PRECIOUS)."); if (f->phony) -- cgit v1.2.3