From fb6410f43583a9e0b457d675e1bc2d1ed5ba279b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 28 Sep 2004 18:13:55 +0000 Subject: Implemented dontcare flag inheritance when rebuilding makefiles. --- ChangeLog | 5 +++++ remake.c | 31 +++++++++++++++++++++++++++++++ tests/ChangeLog | 5 +++++ tests/scripts/features/include | 12 +++++++++++- 4 files changed, 52 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7ad0ab8..53fa8df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-09-28 Boris Kolpackov + + * remake.c (update_file_1): When rebuilding makefiles inherit + dontcare flag from a target that triggered update. + 2004-09-27 Boris Kolpackov * variable.c (initialize_file_variables): Mark pattern-specific diff --git a/remake.c b/remake.c index b0c76dc..70acad3 100644 --- a/remake.c +++ b/remake.c @@ -468,6 +468,7 @@ update_file_1 (struct file *file, unsigned int depth) { FILE_TIMESTAMP mtime; int maybe_make; + int dontcare = 0; check_renamed (d->file); @@ -491,7 +492,21 @@ update_file_1 (struct file *file, unsigned int depth) d->file->parent = file; maybe_make = must_make; + + /* Inherit dontcare flag from our parent. */ + if (rebuilding_makefiles) + { + dontcare = d->file->dontcare; + d->file->dontcare = file->dontcare; + } + + dep_status |= check_dep (d->file, depth, this_mtime, &maybe_make); + + /* Restore original dontcare flag. */ + if (rebuilding_makefiles) + d->file->dontcare = dontcare; + if (! d->ignore_mtime) must_make = maybe_make; @@ -528,10 +543,26 @@ update_file_1 (struct file *file, unsigned int depth) for (d = file->deps; d != 0; d = d->next) if (d->file->intermediate) { + int dontcare = 0; + FILE_TIMESTAMP mtime = file_mtime (d->file); check_renamed (d->file); d->file->parent = file; + + /* Inherit dontcare flag from our parent. */ + if (rebuilding_makefiles) + { + dontcare = d->file->dontcare; + d->file->dontcare = file->dontcare; + } + + dep_status |= update_file (d->file, depth); + + /* Restore original dontcare flag. */ + if (rebuilding_makefiles) + d->file->dontcare = dontcare; + check_renamed (d->file); { diff --git a/tests/ChangeLog b/tests/ChangeLog index 8420705..87c64d5 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +2004-09-28 Boris Kolpackov + + * scripts/features/include: Test dontcare flag inheritance + when rebuilding makefiles. + 2004-09-27 Boris Kolpackov * scripts/features/patspecific_vars: Test exported variables. diff --git a/tests/scripts/features/include b/tests/scripts/features/include index 5f20ad8..f48cbd3 100644 --- a/tests/scripts/features/include +++ b/tests/scripts/features/include @@ -16,7 +16,7 @@ open(MAKEFILE,"> $makefile"); print MAKEFILE <