diff options
Diffstat (limited to 'gcc/cppfiles.c')
-rw-r--r-- | gcc/cppfiles.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c index 63e6f75..892583e 100644 --- a/gcc/cppfiles.c +++ b/gcc/cppfiles.c @@ -318,9 +318,12 @@ stack_include_file (pfile, inc) sysp = MAX ((pfile->map ? pfile->map->sysp : 0), (inc->foundhere ? inc->foundhere->sysp : 0)); - /* For -M, add the file to the dependencies on its first inclusion. */ + /* Add the file to the dependencies on its first inclusion. */ if (CPP_OPTION (pfile, deps.style) > !!sysp && !inc->include_count) - deps_add_dep (pfile->deps, inc->name); + { + if (pfile->buffer || CPP_OPTION (pfile, deps.ignore_main_file) == 0) + deps_add_dep (pfile->deps, inc->name); + } /* Not in cache? */ if (! inc->buffer) |