summaryrefslogtreecommitdiff
path: root/gcc/cppinit.c
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-02-20 07:24:10 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-02-20 07:24:10 +0000
commit5ca8af9f844fafa8d24591f715a2875b23468739 (patch)
treeca6ba18d981566f2ff27d47f76785ea46c4d1f5c /gcc/cppinit.c
parent686ddf2e61acd545aa15c9319fc8bcbc62ac98e3 (diff)
downloadgcc-5ca8af9f844fafa8d24591f715a2875b23468739.tar.gz
* cppinit.c (init_dependency_output): Take deps output file
from -o if none given with -MF. Suppress normal output. * gcc.c (cpp_unique_options): Have -M and -MM imply -E. * doc/cpp.texi, doc/invoke.texi: Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49892 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppinit.c')
-rw-r--r--gcc/cppinit.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index b5ad93719e4..efaf3166afb 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -1084,7 +1084,7 @@ output_deps (pfile)
const char *const deps_mode =
CPP_OPTION (pfile, print_deps_append) ? "a" : "w";
- if (CPP_OPTION (pfile, deps_file) == 0)
+ if (CPP_OPTION (pfile, deps_file)[0] == '\0')
deps_stream = stdout;
else
{
@@ -1835,7 +1835,8 @@ cpp_post_options (pfile)
cpp_fatal (pfile, "you must additionally specify either -M or -MM");
}
-/* Set up dependency-file output. */
+/* Set up dependency-file output. On exit, if print_deps is non-zero
+ then deps_file is not NULL; stdout is the empty string. */
static void
init_dependency_output (pfile)
cpp_reader *pfile;
@@ -1874,21 +1875,22 @@ init_dependency_output (pfile)
else
output_file = spec;
- /* Command line overrides environment variables. */
- if (CPP_OPTION (pfile, deps_file) == 0)
- CPP_OPTION (pfile, deps_file) = output_file;
CPP_OPTION (pfile, print_deps_append) = 1;
}
+ else
+ /* If -M or -MM was seen, default output to wherever was specified
+ with -o. out_fname is non-NULL here. */
+ output_file = CPP_OPTION (pfile, out_fname);
- /* If dependencies go to standard output, or -MG is used, we should
- suppress output, including -dM, -dI etc. */
- if (CPP_OPTION (pfile, deps_file) == 0
- || CPP_OPTION (pfile, print_deps_missing_files))
- {
- CPP_OPTION (pfile, no_output) = 1;
- CPP_OPTION (pfile, dump_macros) = 0;
- CPP_OPTION (pfile, dump_includes) = 0;
- }
+ /* Command line -MF overrides environment variables and default. */
+ if (CPP_OPTION (pfile, deps_file) == 0)
+ CPP_OPTION (pfile, deps_file) = output_file;
+
+ /* When doing dependencies, we should suppress all output, including
+ -dM, -dI etc. */
+ CPP_OPTION (pfile, no_output) = 1;
+ CPP_OPTION (pfile, dump_macros) = 0;
+ CPP_OPTION (pfile, dump_includes) = 0;
}
/* Handle --help output. */