This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Update web pages for cpplib's dependency generation improvements
Gerald Pfeifer wrote:-
> This is fine, modulo a fix for what Joseph correctly pointed out.
>
> (The description is a bit abstract, perhaps a new page in news/ might
> make sense which has a bit more details and that we can link from the
> announcement?)
OK, this is what I'll commit.
Neil.
* htdocs/index.html: Add news item, rotate others to...
* htdocs/news.html: ...here.
* htdocs/news/dependencies.html: New.
* htdocs/projects/cpplib.html: Update and remove older changes.
Index: htdocs/index.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/index.html,v
retrieving revision 1.241
diff -u -p -r1.241 index.html
--- index.html 2001/01/16 18:47:34 1.241
+++ index.html 2001/01/22 20:15:46
@@ -153,6 +153,15 @@ hope to release by the end of Q1 2001.
<dl>
+<dt><b>January 21, 2001</b></dt>
+<dd>
+Neil Booth has contributed <a
+href="news/dependencies.html">improvements</a> to the dependency
+generation machinery of the C preprocessor, adding some new
+functionality and correcting some undesirable behaviour of the old
+implementation.
+</dd>
+
<dt><b>January 15, 2001</b></dt>
<dd>
The GCC development tree is in a slush state, with the goal of <a
@@ -172,52 +181,6 @@ Java support.
<dd>
Nick Clifton of Red Hat has donated support for the Intel XScale
architecture.
-</dd>
-
-<dt><b>November 26, 2000</b></dt>
-<dd>
-The C, C++ and Objective C front ends now use the integrated
-preprocessor exclusively; their independent ability to tokenize an
-input stream has been removed.
-</dd>
-
-<dt><b>November 18, 2000</b></dt>
-<dd>
-G++ is now using a new C++ ABI that represents classes more compactly,
-uses shorter mangled names, and is optimized for higher run-time
-performance. The implementation of the new ABI was contributed by
-Mark Mitchell, Nathan Sidwell, and Alexander Samuel of CodeSourcery,
-LLC.
-</dd>
-
-<dt><b>November 18, 2000</b></dt>
-<dd>
-GCC now supports ISO C99 declarations in <code>for</code> loops
-(<code>for (int i = 0; i < 10; i++) /* ... */</code>). These are
-only supported in C99 mode (command line options
-<code>-std=gnu99</code> or <code>-std=c99</code>), which will be the
-default in some future release, but not in GCC 3.0.
-</dd>
-
-<dt><b>November 14, 2000</b></dt>
-<dd>
-Michael Matz has donated an implementation of the Lengauer and Tarjan
-algorithm for computing dominators in the CFG. This algorithm can
-be significantly faster and more space efficient than our older
-algorithm. For one particularly nasty CFG from complex C++ code
-(more than 77000 basic blocks) compile time dropped from more than
-40 minutes to around 25 minutes. Memory consumption was also
-dramatically decreased.
-</dd>
-
-<dt><b>November 13, 2000</b></dt>
-<dd>
-We have now switched the C++ frontend to use
-<a href="libstdc++/">libstdc++-v3</a>, a new implementation of the ISO
-Standard C++ Library which brings significant changes and improvements
-over our ``old'' library. There still be may some rough edges, but we
-are addressing problems as soon as we learn about them -- please help
-testing and improving ``your'' ports!
</dd>
</dl>
Index: htdocs/news.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/news.html,v
retrieving revision 1.57
diff -u -p -r1.57 news.html
--- news.html 2000/12/03 23:35:08 1.57
+++ news.html 2001/01/22 20:15:46
@@ -12,6 +12,52 @@ home page</a>.
<dl>
+<dt><b>November 26, 2000</b></dt>
+<dd>
+The C, C++ and Objective C front ends now use the integrated
+preprocessor exclusively; their independent ability to tokenize an
+input stream has been removed.
+</dd>
+
+<dt><b>November 18, 2000</b></dt>
+<dd>
+G++ is now using a new C++ ABI that represents classes more compactly,
+uses shorter mangled names, and is optimized for higher run-time
+performance. The implementation of the new ABI was contributed by
+Mark Mitchell, Nathan Sidwell, and Alexander Samuel of CodeSourcery,
+LLC.
+</dd>
+
+<dt><b>November 18, 2000</b></dt>
+<dd>
+GCC now supports ISO C99 declarations in <code>for</code> loops
+(<code>for (int i = 0; i < 10; i++) /* ... */</code>). These are
+only supported in C99 mode (command line options
+<code>-std=gnu99</code> or <code>-std=c99</code>), which will be the
+default in some future release, but not in GCC 3.0.
+</dd>
+
+<dt><b>November 14, 2000</b></dt>
+<dd>
+Michael Matz has donated an implementation of the Lengauer and Tarjan
+algorithm for computing dominators in the CFG. This algorithm can
+be significantly faster and more space efficient than our older
+algorithm. For one particularly nasty CFG from complex C++ code
+(more than 77000 basic blocks) compile time dropped from more than
+40 minutes to around 25 minutes. Memory consumption was also
+dramatically decreased.
+</dd>
+
+<dt><b>November 13, 2000</b></dt>
+<dd>
+We have now switched the C++ frontend to use
+<a href="libstdc++/">libstdc++-v3</a>, a new implementation of the ISO
+Standard C++ Library which brings significant changes and improvements
+over our ``old'' library. There still be may some rough edges, but we
+are addressing problems as soon as we learn about them -- please help
+testing and improving ``your'' ports!
+</dd>
+
<dt><b>November 13, 2000</b></dt>
<dd>
GCC now supports two more ISO C99 features:
Index: htdocs/news/dependencies.html
===================================================================
RCS file: dependencies.html
diff -N dependencies.html
--- /dev/null Tue May 5 13:32:27 1998
+++ dependencies.html Mon Jan 22 12:15:48 2001
@@ -0,0 +1,90 @@
+<html>
+
+<head>
+<title>Dependency Generation Improvements</title>
+</head>
+
+<body>
+<h1 align="center">Dependency Generation Improvements</h1>
+
+<p>22 January 2001</p>
+
+<p>The following is a brief summary of the improvements made to the
+preprocessor's Makefile dependency generation functionality.</p>
+
+<ul>
+ <li><p>Consider the simple example of a file <code>test.c</code>
+ that includes the file <code>test.h</code>, and the command line</p>
+
+ <pre>
+ /usr/bin/gcc -MD -c test.c -o subdir/bar.o
+ </pre>
+
+ <p>With previous versions of CPP, this command line would leave a
+ file <code>test.d</code> in the current directory, and its contents
+ would be</p>
+
+ <pre>
+ test.o: test.c test.h
+ </pre>
+
+ <p>which is pretty useless. The latest versions of CPP instead do
+ what you probably want - they make the target
+ <code>subdir/bar.o</code>, place the dependency file in the same
+ directory as the object file, and name it after the object file.
+ Thus in the file <code>subdir/bar.d</code> you will find</p>
+
+ <pre>
+ subdir/bar.o: test.c test.h
+ </pre>
+
+ <li><p>By default CPP uses the main file name, including any path, and
+ appends the object suffix, normally ``.o'', to it to obtain the name
+ of the target for dependency generation. With <code>-MT</code> or
+ <code>-MQ</code> you can specify a target yourself, overriding the
+ default one.</p>
+
+ <p>If you want multiple targets, you can specify them as a single
+ argument to a switch, or use multiple switches. The targets you
+ specify are output in the order they appear on the command line.
+ <code>-MQ</code> is identical to <code>-MT</code>, except that the
+ target name is quoted for Make, but with <code>-MT</code> it isn't.
+ For example, <code>-MT '$(objpfx)foo.o'</code> gives</p>
+
+ <pre>
+ $(objpfx)foo.o: /tmp/foo.c
+ </pre>
+
+ but <code>-MQ '$(objpfx)foo.o'</code> gives
+
+ <pre>
+ $$(objpfx)foo.o: /tmp/foo.c
+ </pre>
+
+ The default target is automatically quoted, as if it were given with
+ <code>-MQ</code>.</p>
+
+ <li><p>When used with <code>-M</code> or <code>-MM</code>,
+ <code>-MF</code> specifies a file to write the dependencies to.
+ This allows the preprocessor to write the preprocessed file to
+ stdout normally. If no <code>-MF</code> switch is given, and one is
+ not implied by <code>-MD</code> or <code>-MMD</code>, CPP sends the
+ rules to stdout and suppresses normal preprocessed output.</p>
+
+ <li><p>Finally, <code>-MP</code> instructs CPP to add a phony target
+ for each dependency other than the main file, causing each to depend
+ on nothing. These dummy rules work around errors <code>make</code>
+ gives if you remove header files without updating the
+ <code>Makefile</code> to match.</p>
+
+ <p>This is typical output:-</p>
+
+ <pre>
+/tmp/test.o: /tmp/test.c /tmp/test.h
+
+/tmp/test.h:
+ </pre>
+</ul>
+
+</body>
+</html>
Index: htdocs/projects/cpplib.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/projects/cpplib.html,v
retrieving revision 1.4
diff -u -p -r1.4 cpplib.html
--- cpplib.html 2001/01/07 17:46:35 1.4
+++ cpplib.html 2001/01/22 20:15:49
@@ -67,12 +67,6 @@ varargs macros in traditional mode is a
<h2>Work recently completed</h2>
<ol>
- <li>The macro expander has been rewritten and fixes all known bugs,
- including one that exists in previous versions of GCC.
-
- <li>When a macro is defined to itself, it bypasses the macro
- expander entirely.
-
<li>C99's <code>_Pragma</code> operator has been implemented.
<li>Integrated CPP is now the build default, and cannot be disabled.
@@ -81,6 +75,10 @@ varargs macros in traditional mode is a
to the debugging output. At present, only the obsolete DWARF
version 1 uses the information; fixing DWARF2 to do so should
not be difficult.
+
+ <li>The dependency generator has been improved, to incorporate all
+ the features in <a href="http://gcc.gnu.org/ml/gcc/1999-09n/msg00742.html">
+ Tom Tromey's proposal</a> for improving it.
</ol>
<h2>Known Bugs</h2>
@@ -123,16 +121,6 @@ varargs macros in traditional mode is a
You can get some of this with the debug switches, but not all,
and not in a reloadable format. The front end must cooperate
also.
-
- <li>The dependency generator is lacking in several areas. Tom
- Tromey has a <a href="../ml/gcc/1999-09n/msg00742.html">proposal</a>
- for improving it - added features include the ability to control
- the name of the output file and the target of the generated
- rule, and add dummy rules to prevent lossage when a header is
- deleted. I would also like to see a mode in which GCC
- suppresses system headers from the dependency list based on where
- they're found, not what sort of quotation marks were used when
- they were included (as <code>-MM</code> currently does).
</ol>
<h2>Internal work that needs doing</h2>