This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/20989] New: The -M option gives object file names without directory
- From: "bje at safepro dot dk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Apr 2005 12:48:11 -0000
- Subject: [Bug preprocessor/20989] New: The -M option gives object file names without directory
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The -M preprocessor option (and -MM and similar options) strips the directory
part from the listed object file names. The documentaion for -M says:
"Unless specified explicitly (with `-MT' or `-MQ'), the object file
name consists of the basename of the source file with any suffix
replaced with object file suffix."
I interpret the word "basename" in the manual text to include directories as the
basename function in GNU make does, however the actual output is without
directories:
=== Content of test/test.c ===
#include "test.h"
#include <stdio.h>
int main ()
{
puts (GREETING);
}
=== Content of test/test.h ===
#ifndef TEST_H
#define TEST_H
#define GREETING "Hello world"
#endif
===============================
$ gcc -MM test/test.c
test.o: test/test.c test/test.h
$
I had expected the output to be: "test/test.o: test/test.c test/test.h".
--
Summary: The -M option gives object file names without directory
Product: gcc
Version: 3.4.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: preprocessor
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bje at safepro dot dk
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20989