⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 preprocessor-options.html

📁 自己收集的linux入门到学懂高级编程书集 包括linux程序设计第三版
💻 HTML
📖 第 1 页 / 共 3 页
字号:
     <br><dt><code>-M</code>     <dd>Instead of outputting the result of preprocessing, output a rulesuitable for <code>make</code> describing the dependencies of the mainsource file.  The preprocessor outputs one <code>make</code> rule containingthe object file name for that source file, a colon, and the names of allthe included files, including those coming from <code>-include</code> or<code>-imacros</code> command line options.     <p>Unless specified explicitly (with <code>-MT</code> or <code>-MQ</code>), theobject file name consists of the basename of the source file with anysuffix replaced with object file suffix.  If there are many includedfiles then the rule is split into several lines using <code>\</code>-newline. The rule has no commands.     <p>This option does not suppress the preprocessor's debug output, such as<code>-dM</code>.  To avoid mixing such debug output with the dependencyrules you should explicitly specify the dependency output file with<code>-MF</code>, or use an environment variable like<code>DEPENDENCIES_OUTPUT</code> (see <a href="Environment-Variables.html#Environment%20Variables">Environment Variables</a>).  Debug outputwill still be sent to the regular output stream as normal.     <p>Passing <code>-M</code> to the driver implies <code>-E</code>, and suppresseswarnings with an implicit <code>-w</code>.     <br><dt><code>-MM</code>     <dd>Like <code>-M</code> but do not mention header files that are found insystem header directories, nor header files that are included,directly or indirectly, from such a header.     <p>This implies that the choice of angle brackets or double quotes in an<code>#include</code> directive does not in itself determine whether thatheader will appear in <code>-MM</code> dependency output.  This is aslight change in semantics from GCC versions 3.0 and earlier.     <p><a name="dashMF"></a><br><dt><code>-MF </code><var>file</var><code></code>     <dd>When used with <code>-M</code> or <code>-MM</code>, specifies afile to write the dependencies to.  If no <code>-MF</code> switch is giventhe preprocessor sends the rules to the same place it would have sentpreprocessed output.     <p>When used with the driver options <code>-MD</code> or <code>-MMD</code>,<code>-MF</code> overrides the default dependency output file.     <br><dt><code>-MG</code>     <dd>In conjunction with an option such as <code>-M</code> requestingdependency generation, <code>-MG</code> assumes missing header files aregenerated files and adds them to the dependency list without raisingan error.  The dependency filename is taken directly from the<code>#include</code> directive without prepending any path.  <code>-MG</code>also suppresses preprocessed output, as a missing header file rendersthis useless.     <p>This feature is used in automatic updating of makefiles.     <br><dt><code>-MP</code>     <dd>This option instructs CPP to add a phony target for each dependencyother than the main file, causing each to depend on nothing.  Thesedummy rules work around errors <code>make</code> gives if you remove headerfiles without updating the <code>Makefile</code> to match.     <p>This is typical output:     <pre class="smallexample">          test.o: test.c test.h                    test.h:          </pre>     <br><dt><code>-MT </code><var>target</var><code></code>     <dd>     <p>Change the target of the rule emitted by dependency generation.  Bydefault CPP takes the name of the main input file, including any path,deletes any file suffix such as <code>.c</code>, and appends the platform'susual object suffix.  The result is the target.     <p>An <code>-MT</code> option will set the target to be exactly the string youspecify.  If you want multiple targets, you can specify them as a singleargument to <code>-MT</code>, or use multiple <code>-MT</code> options.     <p>For example, <code>-MT&nbsp;'$(objpfx)foo.o'</code> might give     <pre class="smallexample">          $(objpfx)foo.o: foo.c          </pre>     <br><dt><code>-MQ </code><var>target</var><code></code>     <dd>     <p>Same as <code>-MT</code>, but it quotes any characters which are special toMake.  <code>-MQ&nbsp;'$(objpfx)foo.o'</code> gives     <pre class="smallexample">          $$(objpfx)foo.o: foo.c          </pre>     <p>The default target is automatically quoted, as if it were given with<code>-MQ</code>.     <br><dt><code>-MD</code>     <dd><code>-MD</code> is equivalent to <code>-M -MF </code><var>file</var><code></code>, except that<code>-E</code> is not implied.  The driver determines <var>file</var> based onwhether an <code>-o</code> option is given.  If it is, the driver uses itsargument but with a suffix of <code>.d</code>, otherwise it take thebasename of the input file and applies a <code>.d</code> suffix.     <p>If <code>-MD</code> is used in conjunction with <code>-E</code>, any<code>-o</code> switch is understood to specify the dependency output file(but see <a href="dashMF.html#dashMF">-MF</a>), but if used without <code>-E</code>, each <code>-o</code>is understood to specify a target object file.     <p>Since <code>-E</code> is not implied, <code>-MD</code> can be used to generatea dependency output file as a side-effect of the compilation process.     <br><dt><code>-MMD</code>     <dd>Like <code>-MD</code> except mention only user header files, not system-header files.     <br><dt><code>-fpch-deps</code>     <dd>When using precompiled headers (see <a href="Precompiled-Headers.html#Precompiled%20Headers">Precompiled Headers</a>), this flagwill cause the dependency-output flags to also list the files from theprecompiled header's dependencies.  If not specified only theprecompiled header would be listed and not the files that were used tocreate it because those files are not consulted when a precompiledheader is used.     <br><dt><code>-x c</code>     <dd><dt><code>-x c++</code>     <dd><dt><code>-x objective-c</code>     <dd><dt><code>-x assembler-with-cpp</code>     <dd>Specify the source language: C, C++, Objective-C, or assembly.  This hasnothing to do with standards conformance or extensions; it merelyselects which base syntax to expect.  If you give none of these options,cpp will deduce the language from the extension of the source file:<code>.c</code>, <code>.cc</code>, <code>.m</code>, or <code>.S</code>.  Some other commonextensions for C++ and assembly are also recognized.  If cpp does notrecognize the extension, it will treat the file as C; this is the mostgeneric mode.     <p><strong>Note:</strong> Previous versions of cpp accepted a <code>-lang</code> optionwhich selected both the language and the standards conformance level. This option has been removed, because it conflicts with the <code>-l</code>option.     <br><dt><code>-std=</code><var>standard</var><code></code>     <dd><dt><code>-ansi</code>     <dd>Specify the standard to which the code should conform.  Currently CPPknows about C and C++ standards; others may be added in the future.     <p><var>standard</var>may be one of:          <dl><dt><code>iso9899:1990</code>          <dd><dt><code>c89</code>          <dd>The ISO C standard from 1990.  <code>c89</code> is the customary shorthand forthis version of the standard.          <p>The <code>-ansi</code> option is equivalent to <code>-std=c89</code>.          <br><dt><code>iso9899:199409</code>          <dd>The 1990 C standard, as amended in 1994.          <br><dt><code>iso9899:1999</code>          <dd><dt><code>c99</code>          <dd><dt><code>iso9899:199x</code>          <dd><dt><code>c9x</code>          <dd>The revised ISO C standard, published in December 1999.  Beforepublication, this was known as C9X.          <br><dt><code>gnu89</code>          <dd>The 1990 C standard plus GNU extensions.  This is the default.          <br><dt><code>gnu99</code>          <dd><dt><code>gnu9x</code>          <dd>The 1999 C standard plus GNU extensions.          <br><dt><code>c++98</code>          <dd>The 1998 ISO C++ standard plus amendments.          <br><dt><code>gnu++98</code>          <dd>The same as <code>-std=c++98</code> plus GNU extensions.  This is thedefault for C++ code. </dl>     <br><dt><code>-I-</code>     <dd>Split the include path.  Any directories specified with <code>-I</code>options before <code>-I-</code> are searched only for headers requested with<code>#include&nbsp;"</code><var>file</var><code>"</code>; they are not searched for<code>#include&nbsp;&lt;</code><var>file</var><code>&gt;</code>.  If additional directories arespecified with <code>-I</code> options after the <code>-I-</code>, thosedirectories are searched for all <code>#include</code> directives.     <p>In addition, <code>-I-</code> inhibits the use of the directory of the currentfile directory as the first search directory for <code>#include&nbsp;"</code><var>file</var><code>"</code>.     <br><dt><code>-nostdinc</code>     <dd>Do not search the standard system directories for header files. Only the directories you have specified with <code>-I</code> options(and the directory of the current file, if appropriate) are searched.     <br><dt><code>-nostdinc++</code>     <dd>Do not search for header files in the C++-specific standard directories,but do still search the other standard directories.  (This option isused when building the C++ library.)     <br><dt><code>-include </code><var>file</var><code></code>     <dd>Process <var>file</var> as if <code>#include "file"</code> appeared as the firstline of the primary source file.  However, the first directory searchedfor <var>file</var> is the preprocessor's working directory <em>instead of</em>the directory containing the main source file.  If not found there, itis searched for in the remainder of the <code>#include "..."</code> searchchain as normal.     <p>If multiple <code>-include</code> options are given, the files are includedin the order they appear on the command line.     <br><dt><code>-imacros </code><var>file</var><code></code>     <dd>Exactly like <code>-include</code>, except that any output produced by

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -