diff options
author | Jakub Jelinek <jakub@redhat.com> | 2001-01-24 19:44:40 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2001-01-24 19:44:40 +0100 |
commit | 7855db7cb8238288a2f1e85864dc1ecac098ad38 (patch) | |
tree | a8bb7305a5a82c84986b30d9aec74961e26639ee /gcc | |
parent | 6a40fc2b757192e84d11ce4edfac13b31a3b4397 (diff) | |
download | gcc-7855db7cb8238288a2f1e85864dc1ecac098ad38.zip gcc-7855db7cb8238288a2f1e85864dc1ecac098ad38.tar.gz gcc-7855db7cb8238288a2f1e85864dc1ecac098ad38.tar.bz2 |
cppfiles.c (_cpp_read_file): Add to dependencies if requested.
* cppfiles.c (_cpp_read_file): Add to dependencies if requested.
* cppinit.c (cpp_start_read): Remove deps_add_dep call.
* tradcpp.c (main): Add -imacros or -include'd dependencies
for -M*.
* cpp.texi (-M, -MM): Document -M -include behaviour.
From-SVN: r39240
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cpp.texi | 10 | ||||
-rw-r--r-- | gcc/cppfiles.c | 3 | ||||
-rw-r--r-- | gcc/cppinit.c | 9 | ||||
-rw-r--r-- | gcc/tradcpp.c | 5 |
5 files changed, 24 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6484797..e0b5617 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2001-01-24 Jakub Jelinek <jakub@redhat.com> + + * cppfiles.c (_cpp_read_file): Add to dependencies if requested. + * cppinit.c (cpp_start_read): Remove deps_add_dep call. + * tradcpp.c (main): Add -imacros or -include'd dependencies + for -M*. + * cpp.texi (-M, -MM): Document -M -include behaviour. + 2001-01-24 Roger Collins <roger@ProProject.com> * config/i386/xm-i386.h: Make __i386__ a boolean macro. diff --git a/gcc/cpp.texi b/gcc/cpp.texi index 253d6ee..19e9566 100644 --- a/gcc/cpp.texi +++ b/gcc/cpp.texi @@ -3453,14 +3453,16 @@ Instead of outputting the result of preprocessing, output a rule suitable for @code{make} describing the dependencies of the main source file. The preprocessor outputs one @code{make} rule containing the object file name for that source file, a colon, and the names of all the -included files. If there are many included files then the rule is split -into several lines using @samp{\}-newline. +included files, including those coming from @samp{-include} or +@samp{-imacros} command line options. If there are many included files +then the rule is split into several lines using @samp{\}-newline. @item -MM @findex -MM Like @samp{-M}, but mention only the files included with @samp{#include -"@var{file}"}. System header files included with @samp{#include -<@var{file}>} are omitted. +"@var{file}"} or with @samp{-include} or @samp{-imacros} command line +options. System header files included with @samp{#include <@var{file}>} +are omitted. @item -MF @var{file} @findex -MF diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c index c480cb4..01b8d5f 100644 --- a/gcc/cppfiles.c +++ b/gcc/cppfiles.c @@ -765,6 +765,9 @@ _cpp_read_file (pfile, fname) return 0; } + if (CPP_OPTION (pfile, print_deps)) + deps_add_dep (pfile->deps, f->name); + stack_include_file (pfile, f); return 1; } diff --git a/gcc/cppinit.c b/gcc/cppinit.c index 93568f4..ff4cdb3 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -911,13 +911,8 @@ cpp_start_read (pfile, fname) CPP_OPTION (pfile, out_fname) = ""; if (CPP_OPTION (pfile, print_deps)) - { - /* Set the default target (if there is none already), and - the dependency on the main file. */ - deps_add_default_target (pfile->deps, CPP_OPTION (pfile, in_fname)); - - deps_add_dep (pfile->deps, CPP_OPTION (pfile, in_fname)); - } + /* Set the default target (if there is none already). */ + deps_add_default_target (pfile->deps, CPP_OPTION (pfile, in_fname)); /* Open the main input file. This must be done early, so we have a buffer to stand on. */ diff --git a/gcc/tradcpp.c b/gcc/tradcpp.c index e5e0935..82de0bb 100644 --- a/gcc/tradcpp.c +++ b/gcc/tradcpp.c @@ -848,6 +848,11 @@ main (argc, argv) perror_with_name (pend[i].arg); return FATAL_EXIT_CODE; } + + /* For -M, add this file to the dependencies. */ + if (print_deps) + deps_add_dep (deps, pend[i].arg); + finclude (fd, pend[i].arg, &outbuf); } indepth--; |