2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
6 .. index:: options, code generation
13 In addition to the many :command:`gcc` options controlling code generation,
14 :command:`gdc` has several options specific to itself.
20 Generates D interface files for all modules being compiled. The compiler
21 determines the output file based on the name of the input file, removes
22 any directory components and suffix, and applies the :samp:`.di` suffix.
28 Same as :option:`-H`, but writes interface files to directory :samp:`{dir}`.
29 This option can be used with :option:`-Hf file` to independently set the
30 output file and directory path.
36 Same as :option:`-H` but writes interface files to :samp:`{file}`. This option can
37 be used with :option:`-Hd dir` to independently set the output file and
44 Output the module dependencies of all source files being compiled in a
45 format suitable for :command:`make`. The compiler outputs one
46 :command:`make` rule containing the object file name for that source file,
47 a colon, and the names of all imported files.
53 Like :option:`-M` but does not mention imported modules from the D standard
54 library package directories.
60 When used with :option:`-M` or :option:`-MM`, specifies a :samp:`{file}` to write
61 the dependencies to. When used with the driver options :option:`-MD` or
62 :option:`-MMD`, :option:`-MF` overrides the default dependency output file.
68 This option is for compatibility with :command:`gcc`, and is ignored by the
75 Outputs a phony target for each dependency other than the modules being
76 compiled, causing each to depend on nothing.
78 .. option:: -MT target
82 Change the :samp:`{target}` of the rule emitted by dependency generation
83 to be exactly the string you specify. If you want multiple targets,
84 you can specify them as a single argument to :option:`-MT`, or use
85 multiple :option:`-MT` options.
87 .. option:: -MQ target
91 Same as :option:`-MT`, but it quotes any characters which are special to
98 This option is equivalent to :option:`-M -MF file`. The driver
99 determines :samp:`{file}` by removing any directory components and suffix
100 from the input file, and then adding a :samp:`.deps` suffix.
106 Like :option:`-MD` but does not mention imported modules from the D standard
107 library package directories.
113 Output information describing the contents of all source files being
114 compiled in JSON format to a file. The driver determines :samp:`{file}` by
115 removing any directory components and suffix from the input file, and then
116 adding a :samp:`.json` suffix.
122 Same as :option:`-X`, but writes all JSON contents to the specified
129 Generates ``Ddoc`` documentation and writes it to a file. The compiler
130 determines :samp:`{file}` by removing any directory components and suffix
131 from the input file, and then adding a :samp:`.html` suffix.
133 .. option:: -fdoc-dir=dir
137 Same as :option:`-fdoc`, but writes documentation to directory :samp:`{dir}`.
138 This option can be used with :option:`-fdoc-file=file` to
139 independently set the output file and directory path.
141 .. option:: -fdoc-file=file
143 .. index:: -fdoc-file
145 Same as :option:`-fdoc`, but writes documentation to :samp:`{file}`. This
146 option can be used with :option:`-fdoc-dir=dir` to independently
147 set the output file and directory path.
149 .. option:: -fdoc-inc=file
153 Specify :samp:`{file}` as a :samp:`{Ddoc}` macro file to be read. Multiple
154 :option:`-fdoc-inc` options can be used, and files are read and processed
157 .. option:: -fdump-c++-spec={file}
159 For D source files, generate corresponding C++ declarations in :samp:`{file}`.
161 .. option:: -fdump-c++-spec-verbose
163 In conjunction with :option:`-fdump-c++-spec=` above, add comments for ignored
164 declarations in the generated C++ header.
166 .. option:: -fsave-mixins={file}
168 Generates code expanded from D ``mixin`` statements and writes the
169 processed sources to :samp:`{file}`. This is useful to debug errors in compilation
170 and provides source for debuggers to show when requested.