Delphi command-line compiler[3]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 laurecn 的 blog

if the source text contained in filename is a program, the compiler creates an executable file named filename.exe. if filename contains a library, the compiler creates a file named filename.dll. if filename contains a package, the compiler creates a file named filename.bpl. if filename contains a unit, the compiler creates a unit file named filename.dcu.

you can specify a number of options for the command-line compiler. an option consists of a slash (/) or hyphen (-) immediately followed by an option letter. in some cases, the option letter is followed by additional information, such as a number, a symbol, or a directory name. options can be given in any order and can come before or after the file name.

 

 

cfg file
you can set up a list of options in a configuration file called dcc32.cfg, which will then be used in addition to the options entered on the command line. each line in configuration file corresponds to an extra command-line argument inserted before the actual command-line arguments. thus, by creating a configuration file, you can change the default setting of any command-line option.

 

the command-line compiler lets you enter the same command-line option several times, ignoring all but the last occurrence. this way, even though you've changed some settings with a configuration file, you can still override them on the command line.

 

when dcc32 starts, it looks for dcc32.cfg in the current directory. if the file isn't found there, dcc32 looks in the directory where dcc32.exe resides.

 

here's an example dcc32.cfg file, defining some default directories for include, object, and unit files, and changing the default states of the $o and $r compiler directives:

 

-ic:\delphi\inc;c:\delphi\src

-oc:\delphi\asm

-uc:\delphi\units

-$r+

-$o-

 

now, if you type:   dcc32 mystuff

 

the compiler performs as if you had typed the following:

 

dcc32 -ic:\delphi\inc;c:\delphi\src -oc:\delphi\asm -uc:\delphi\units -$r+ -$o- mystuff

 

 

delphi compiler options
delphi compiler options correspond to switch directives that you can also set directly in your program code.

selecting an option is equivalent to setting the switch directive to its positive (+) state.

 

code generation      effect

本文关键:Delphi command-line compiler
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top