In the gcc info pages the documentation for -M and -MT appears to contradict each other as to what the target name should be by default: `-M': [...] 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. `-MT TARGET': [...] By default, CPP takes the name of the source file, including any path, deletes any file suffix such as `.c', and appends the platform's usual object suffix. The result is the target. My understanding is that the `basename' (used in -M doc) is the filename without the path. My experience also shows the real default behaviour is the one described in -M description, not in -MT description. (tested on 2.95 and 3.3.3) I, for one, would like the behaviour described in -MT. So this bug report includes: - a documentation error. - a request for a new -Mx directive to use filename including path for default target name. Thanks F.G.
Confirmed.
I've submitted a patch. As explained in the message, I think we should just document the current behavior, not change it.
Subject: Bug number PR preprocessor/15185 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-01/msg00532.html
Subject: Bug number PR preprocessor/15185 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-01/msg00866.html
Subject: Bug 15185 Author: tromey Date: Thu Jan 11 16:26:55 2007 New Revision: 120679 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120679 Log: PR preprocessor/15185, PR preprocessor/20989: * doc/cppopts.texi <-MT>: Update description of algorithm for computing default target. <-M, -MD>: Reword "basename" text. Modified: trunk/gcc/ChangeLog trunk/gcc/doc/cppopts.texi
This was fixed for 4.3, and I think it unlikely that anyone will backport the doc fix. So, I am closing this.