Changeset 35

Show
Ignore:
Timestamp:
05/04/05 06:45:07 (7 years ago)
Author:
Derek Parnell
Message:

Upload of v2.06 (build #856)

see Docs/CHANGE_LOG.htm for details.
added downloads/build-2.06.doc.zip
added downloads/build-2.06.src.zip
added downloads/build_win_2.06.exe
modified trunk/Docs/AUTO_BUILD_NUMBER.htm
modified trunk/Docs/CHANGE_LOG.htm
modified trunk/Docs/COMMAND_LINE.htm
modified trunk/Docs/DLL_LIBRARIES.htm
modified trunk/Docs/index.htm
modified trunk/Docs/PRAGMA.htm
modified trunk/Docs/RESPONSE_FILE.htm
modified trunk/Docs/RULE_DEFINITION_FILE.htm
modified trunk/Docs/SWITCHES.htm
modified trunk/Docs/TO_DO.htm
modified trunk/Source/build.d
modified trunk/Source/build_bn.d
modified trunk/Source/source_bn.d
modified trunk/Source/util/bmscanner_bn.d
modified trunk/Source/util/fdt_bn.d
modified trunk/Source/util/fileex_bn.d
modified trunk/Source/util/linetoken_bn.d
modified trunk/Source/util/pathex_bn.d
modified trunk/Source/util/str_bn.d

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Docs/AUTO_BUILD_NUMBER.htm

    r34 r35  
    22<head> 
    33<!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 
    4 <!-- on 2005/05/02 at 14h19m42 --> 
     4<!-- on 2005/05/04 at 17h47m11 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    1616 a single line in your source code in the form ... <br> 
    1717<pre> 
    18        private import <strong>&lt;modulename&gt;</strong>_bn; 
     18 private import <strong>&lt;modulename&gt;</strong>_bn; 
    1919</pre> 
    2020Typically this line is placed immediately after the source file's 
     
    3333If your module is called "parser.d" you would have the lines ... 
    3434<pre> 
    35   module parser; 
    36   private import parser_bn; 
     35module parser; 
     36private import parser_bn; 
    3737</pre> 
    3838<p> 
     
    4040<p> 
    4141<pre> 
    42           writefln("Build number is %d", auto_build_number); 
     42writefln("Build number is %d", auto_build_number); 
    4343</pre> 
    4444You can access the build numbers of other modules in you application 
     
    4747Example: 
    4848<pre> 
    49        module parser;  // This module's name. 
    50        private import parser_bn;   // This module's B/N 
    51        private import tokenizer_bn; // Another module's B/N 
    52       . . . 
    53       writefln("Builds..."); 
    54       writefln("  Parser %d", parser_bn.auto_build_number); 
    55       writefln("  Tokens %d", tokenizer_bn.auto_build_number); 
     49 module parser;  // This module's name. 
     50 private import parser_bn;   // This module's B/N 
     51 private import tokenizer_bn; // Another module's B/N 
     52. . . 
     53writefln("Builds..."); 
     54writefln("  Parser %d", parser_bn.auto_build_number); 
     55writefln("  Tokens %d", tokenizer_bn.auto_build_number); 
    5656</pre> 
    5757<p> 
    5858 The "_bn.d" file created by <em>build</em> for this module would look like ... <br> 
    5959<pre> 
    60   module parser_bn; 
    61    // This file is automatically maintained by the BUILD utility, 
    62    // Please refrain from manually editing it. 
    63   long auto_build_number = 77; 
     60module parser_bn; 
     61 // This file is automatically maintained by the BUILD utility, 
     62 // Please refrain from manually editing it. 
     63long auto_build_number = 77; 
    6464</pre> 
    6565 Of course the number <em>77</em> is just an example. This number would actually 
  • trunk/Docs/CHANGE_LOG.htm

    r34 r35  
    22<head> 
    33<!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 
    4 <!-- on 2005/05/02 at 14h19m42 --> 
     4<!-- on 2005/05/04 at 17h47m11 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    1313</h3><br> 
    1414<p> 
     15 <strong> -- v2.06 -- 04/May/2005 </strong> 
     16<ul> 
     17 <li> ** <strong>FIX</strong>: <em>thanks to phoenix</em>: When emitting commandline parameters for 
     18 the compiler or librarian, it was possible to have some ending with <strong>\"</strong> which caused 
     19 the shell to <em>escape</em> the quote character and thus provide incorrect parameters to 
     20the compiler. 
     21 </ul>  
    1522 <strong> -- v2.05 -- 02/May/2005 </strong> 
    1623<ul> 
  • trunk/Docs/COMMAND_LINE.htm

    r34 r35  
    22<head> 
    33<!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 
    4 <!-- on 2005/05/02 at 14h19m42 --> 
     4<!-- on 2005/05/04 at 17h47m11 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    1414 The typical format of the <em>build</em> utility's command line is ... <br> 
    1515<pre> 
    16        <strong>build</strong> &lt;sourcefile&gt; [ &lt;switches&gt; ] [ &lt;otherfiles&gt; ] 
     16 <strong>build</strong> &lt;sourcefile&gt; [ &lt;switches&gt; ] [ &lt;otherfiles&gt; ] 
    1717</pre> 
    1818You can however specify the files and switches in any order you like. 
     
    2727like this ... 
    2828<pre> 
    29   Path and Version : C:\Program Files\build.exe v3.6(339) 
    30   Usage: build sourcefile [options objectfiles libraries] 
    31      <strong>sourcefile</strong> D source file 
    32      <strong>-v</strong>         Verbose (passed through to D) 
    33      <strong>-V</strong>         Verbose (NOT passed through) 
    34      <strong>-names</strong>     Displays the names of the files used to build the target. 
    35      <strong>-DCPATH&lt;path&gt; &lt;path&gt;</strong> is where the compiler has been installed. 
    36                Only needed if the compiler is not in the system's 
    37                PATH list. Used if you are testing an alternate 
    38                version of the compiler. 
    39      <strong>-CFPATH&lt;path&gt; &lt;path&gt;</strong> is where the D config file has been installed. 
    40      <strong>-full</strong>      Causes all source files, except ignored modules, 
    41                 to be compiled. 
    42      <strong>-link</strong>      Forces the linker to be called instead of the librarian. 
    43                 (Only needed if the source files do not contain 
    44                   main/WinMain)  
    45      <strong>-nolink</strong>    Ensures that the linker is not called. 
    46                  (Only needed if main/WinMain is found in the source  
    47                  files and you do NOT want an executable created.) 
    48      <strong>-lib</strong>       Forces the object files to be placed in a library. 
    49                  (Only needed if main/WinMain is found in the source  
    50                  files AND you want it in a library instead of 
    51                  an executable.) 
    52      <strong>-nolib</strong>     Ensures that the object files are not used to form 
    53                 a library. 
    54                  (Only needed if main/WinMain is not found in the source  
    55                  files and you do NOT want a library. 
    56      <strong>-obj</strong>       This is the same as having both -nolink and -nolib 
    57                 switches on the command line. It is just a shorthand. 
    58      <strong>-allobj</strong>    Ensures that all object files are added to a 
    59                 library. 
    60                 (Normally only those in the same directory are added.) 
    61      <strong>-cleanup</strong>   Ensures that all object files created during the run 
    62                 are removed at the end of the run, plus other work files. 
    63      <strong>-clean</strong>     Same as -cleanup 
    64      <strong>-test</strong>      Does everything as normal except it displays the commands 
    65                   instead of running them. Also, the auto-build-numbers are 
    66                   not incremented. 
    67      <strong>-RDF&lt;path&gt;</strong>  Overrides the default Rule Definition File 
    68      <strong>-gui[:x.y]</strong> Forces a GUI application to be created. The optional 
    69                 :x.y can be used to build an application for a 
    70                 specific version of Windows. eg. -gui:4.0 
    71                 (Only needed if WinMain is not found in the source files 
    72                 or if you wish to override the default Windows version) 
    73      <strong>-dll</strong>       Forces a DLL library to be created. 
    74                       (Only needed if DllMain is not found in the source files. 
    75      <strong>-LIBOPT&lt;opt&gt;</strong> Allows you to pass &lt;opt&gt; to the librarian 
    76      <strong>-X&lt;module&gt;</strong> Packages and Modules to ignore (eg. -Xmylib) 
    77      <strong>-M&lt;module&gt;</strong> Packages and Modules to notice (eg. -Mphobos) 
    78      <strong>-T&lt;targetname&gt;</strong> The name of the target file to create. Normally 
    79                 the target name istaken from the first or only name 
    80                 of the command line. 
    81      <strong>-R&lt;y|n&gt;</strong> Indicates whether to use a response file or command line 
    82                    arguments with the compiler tools. 
    83                   <strong>-Ry</strong> will cause a response to be used. 
    84                   <strong>-Rn</strong> will cause command line arguments to be used. 
    85                   <strong>-R</strong> will reverse the current usage. 
    86                   Note that the default for Windows DigitalMars is to use a response file 
    87                   but for all other environments it is to use command line arguments. 
    88      <strong>-info</strong>      Displays the version and path of the Build application 
    89      <strong>-help</strong>      Displays the full 'usage' help text. 
    90      <strong>-h</strong>         Same as -help, displays the full 'usage' help text. 
    91      <strong>-?   </strong>      Same as -help, displays the full 'usage' help text. 
    92      <strong>-silent</strong>    Avoids unnecessary messages being displayed. 
    93      <strong>[...]</strong>      All other options, objectfiles and libraries are 
    94                 passed to the compiler 
     29Path and Version : C:\Program Files\build.exe v3.6(339) 
     30Usage: build sourcefile [options objectfiles libraries] 
     31 <strong>sourcefile</strong> D source file 
     32 <strong>-v</strong>         Verbose (passed through to D) 
     33 <strong>-V</strong>         Verbose (NOT passed through) 
     34 <strong>-names</strong>     Displays the names of the files used to build the target. 
     35 <strong>-DCPATH&lt;path&gt; &lt;path&gt;</strong> is where the compiler has been installed. 
     36Only needed if the compiler is not in the system's 
     37PATH list. Used if you are testing an alternate 
     38version of the compiler. 
     39 <strong>-CFPATH&lt;path&gt; &lt;path&gt;</strong> is where the D config file has been installed. 
     40 <strong>-full</strong>      Causes all source files, except ignored modules, 
     41to be compiled. 
     42 <strong>-link</strong>      Forces the linker to be called instead of the librarian. 
     43(Only needed if the source files do not contain 
     44 main/WinMain)  
     45 <strong>-nolink</strong>    Ensures that the linker is not called. 
     46 (Only needed if main/WinMain is found in the source  
     47files and you do NOT want an executable created.) 
     48 <strong>-lib</strong>       Forces the object files to be placed in a library. 
     49 (Only needed if main/WinMain is found in the source  
     50files AND you want it in a library instead of 
     51an executable.) 
     52 <strong>-nolib</strong>     Ensures that the object files are not used to form 
     53a library. 
     54 (Only needed if main/WinMain is not found in the source  
     55files and you do NOT want a library. 
     56 <strong>-obj</strong>       This is the same as having both -nolink and -nolib 
     57switches on the command line. It is just a shorthand. 
     58 <strong>-allobj</strong>    Ensures that all object files are added to a 
     59library. 
     60(Normally only those in the same directory are added.) 
     61 <strong>-cleanup</strong>   Ensures that all object files created during the run 
     62are removed at the end of the run, plus other work files. 
     63 <strong>-clean</strong>     Same as -cleanup 
     64 <strong>-test</strong>      Does everything as normal except it displays the commands 
     65instead of running them. Also, the auto-build-numbers are 
     66not incremented. 
     67 <strong>-RDF&lt;path&gt;</strong>  Overrides the default Rule Definition File 
     68 <strong>-gui[:x.y]</strong> Forces a GUI application to be created. The optional 
     69:x.y can be used to build an application for a 
     70specific version of Windows. eg. -gui:4.0 
     71(Only needed if WinMain is not found in the source files 
     72or if you wish to override the default Windows version) 
     73 <strong>-dll</strong>       Forces a DLL library to be created. 
     74(Only needed if DllMain is not found in the source files. 
     75 <strong>-LIBOPT&lt;opt&gt;</strong> Allows you to pass &lt;opt&gt; to the librarian 
     76 <strong>-X&lt;module&gt;</strong> Packages and Modules to ignore (eg. -Xmylib) 
     77 <strong>-M&lt;module&gt;</strong> Packages and Modules to notice (eg. -Mphobos) 
     78 <strong>-T&lt;targetname&gt;</strong> The name of the target file to create. Normally 
     79the target name istaken from the first or only name 
     80of the command line. 
     81 <strong>-R&lt;y|n&gt;</strong> Indicates whether to use a response file or command line 
     82arguments with the compiler tools. 
     83 <strong>-Ry</strong> will cause a response to be used. 
     84 <strong>-Rn</strong> will cause command line arguments to be used. 
     85 <strong>-R</strong> will reverse the current usage. 
     86Note that the default for Windows DigitalMars is to use a response file 
     87but for all other environments it is to use command line arguments. 
     88 <strong>-info</strong>      Displays the version and path of the Build application 
     89 <strong>-help</strong>      Displays the full 'usage' help text. 
     90 <strong>-h</strong>         Same as -help, displays the full 'usage' help text. 
     91 <strong>-?   </strong>      Same as -help, displays the full 'usage' help text. 
     92 <strong>-silent</strong>    Avoids unnecessary messages being displayed. 
     93 <strong>[...]</strong>      All other options, objectfiles and libraries are 
     94passed to the compiler 
    9595</pre> 
    9696<p> 
  • trunk/Docs/DLL_LIBRARIES.htm

    r34 r35  
    22<head> 
    33<!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 
    4 <!-- on 2005/05/02 at 14h19m42 --> 
     4<!-- on 2005/05/04 at 17h47m11 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    1616to be a DLL file. The Module Definition file generated takes the form ... 
    1717<pre> 
    18     LIBRARY "&lt;targetname>.dll"; 
    19     EXETYPE NT 
    20     SUBSYSTEM WINDOWS,&lt;version> 
    21     CODE PRELOAD DISCARDABLE SHARED EXECUTE 
    22     DATA PRELOAD SINGLE WRITE 
     18LIBRARY "&lt;targetname>.dll"; 
     19EXETYPE NT 
     20SUBSYSTEM WINDOWS,&lt;version> 
     21CODE PRELOAD DISCARDABLE SHARED EXECUTE 
     22DATA PRELOAD SINGLE WRITE 
    2323</pre> 
    2424<p> 
     
    2929 after the DLL file is created, in order to also create a <strong>.lib</strong> 
    3030library to interface with the DLL. Build currently supports both the 
    31  DigitalMars version and the Borland (Inprise) version of <strong>implib</strong> 
     31 DigitalMars version and the Borland (Inprise) version of <strong>implib</strong>. 
    3232 
    3333</p> 
  • trunk/Docs/PRAGMA.htm

    r34 r35  
    22<head> 
    33<!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 
    4 <!-- on 2005/05/02 at 14h19m42 --> 
     4<!-- on 2005/05/04 at 17h47m11 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    1717They take the forms ... 
    1818<pre> 
    19        <strong>pragma(</strong> &lt;name&gt; <strong>);</strong> 
    20        <strong>pragma(</strong> &lt;name&gt; <strong>,</strong> &lt;option&gt; [ <strong>,</strong>&lt;option&gt;] <strong>);</strong> 
     19 <strong>pragma(</strong> &lt;name&gt; <strong>);</strong> 
     20 <strong>pragma(</strong> &lt;name&gt; <strong>,</strong> &lt;option&gt; [ <strong>,</strong>&lt;option&gt;] <strong>);</strong> 
    2121</pre> 
    2222<p> 
     
    2828Example: 
    2929<pre> 
    30       version(build) { pragma(nolink); } 
     30version(build) { pragma(nolink); } 
    3131</pre> 
    3232 
     
    4949 format is <br> 
    5050<pre> 
    51     pragma(build, "FILENAME" [, "OPTIONS"] ...); 
     51pragma(build, "FILENAME" [, "OPTIONS"] ...); 
    5252</pre> 
    5353 where <em>FILENAME</em> is either the file to link in, or the file to use when 
     
    5656<p> 
    5757<pre> 
    58      /// Compile the images into a resource obj and add images.res to linker. 
    59     pragma(build, "images.rc"); 
     58 /// Compile the images into a resource obj and add images.res to linker. 
     59pragma(build, "images.rc"); 
    6060</pre> 
    6161 or <br> 
    6262<pre> 
    63      /// Compile the images into a resource obj and add images.res to linker. 
    64     pragma(build, "images.res"); 
     63 /// Compile the images into a resource obj and add images.res to linker. 
     64pragma(build, "images.res"); 
    6565</pre> 
    6666<p> 
     
    7777 take the form &lt;KEYWORD>=&lt;VALUE>. For example <br> 
    7878<pre> 
    79       pragma(build, "dbapi.c", "COPT=-wc -x", "HDR=abc.hp"); 
     79pragma(build, "dbapi.c", "COPT=-wc -x", "HDR=abc.hp"); 
    8080</pre> 
    8181The OPTIONS values are used as replacement text for token in the 
     
    9393Example: 
    9494<pre> 
    95        /// Tell 'build' that it needs to call an external program 
    96        /// to build an up-to-date version of 'images.rc' 
    97       version(build) { pragma(build, "images.rc"); } 
     95 /// Tell 'build' that it needs to call an external program 
     96 /// to build an up-to-date version of 'images.rc' 
     97version(build) { pragma(build, "images.rc"); } 
    9898</pre> 
    9999<p>See Also:  
     
    114114 means that if you code ... <br> 
    115115<pre> 
    116       pragma (build_def, "EXETYPE DOS"); 
    117       pragma (build_def, "EXETYPE NT"); 
     116pragma (build_def, "EXETYPE DOS"); 
     117pragma (build_def, "EXETYPE NT"); 
    118118</pre> 
    119119Then the EXETYPE DOS will be used and the 'NT' line ignored. You can use 
     
    123123 The syntax for these pragma is <br> 
    124124<pre> 
    125           pragma(build_def, &lt;QUOTED_STRING&gt; ); 
    126 </pre> 
    127 <p> 
    128 Example: 
    129 <pre> 
    130   version(build) { 
    131     pragma (build_def, "VERSION 1.1"); 
    132     version(DOS) { 
    133       pragma (build_def, "EXETYPE DOS"); 
    134    
    135     version(WIN) { 
    136       pragma (build_def, "EXETYPE NT"); 
    137       pragma (build_def, "SUBSYSTEM WINDOWS,4.0"); 
    138    
    139  
     125pragma(build_def, &lt;QUOTED_STRING&gt; ); 
     126</pre> 
     127<p> 
     128Example: 
     129<pre> 
     130version(build) { 
     131pragma (build_def, "VERSION 1.1"); 
     132version(DOS) { 
     133pragma (build_def, "EXETYPE DOS"); 
     134
     135version(WIN) { 
     136pragma (build_def, "EXETYPE NT"); 
     137pragma (build_def, "SUBSYSTEM WINDOWS,4.0"); 
     138
     139
    140140</pre> 
    141141<p> 
     
    162162Example: 
    163163<pre> 
    164        / Tell 'build' that prime.d must be included (it contains the main function.) 
    165       version(build) { pragma(include, "prime"); } 
     164 / Tell 'build' that prime.d must be included (it contains the main function.) 
     165version(build) { pragma(include, "prime"); } 
    166166</pre> 
    167167<p>See Also:  
     
    183183Example 1: 
    184184<pre> 
    185        // This app needs the MyGUI.lib library to be used. 
    186       version(build) { pragma(link, MyGUI); } 
     185 // This app needs the MyGUI.lib library to be used. 
     186version(build) { pragma(link, MyGUI); } 
    187187</pre> 
    188188<p> 
    189189Example 2: 
    190190<pre> 
    191        // This app needs the a DB library and TCP library to be used. 
    192       version(build) { pragma(link, EuDB, TCP4Win); } 
     191 // This app needs the a DB library and TCP library to be used. 
     192version(build) { pragma(link, EuDB, TCP4Win); } 
    193193</pre> 
    194194<p>See Also:  
     
    210210Example: 
    211211<pre> 
    212       version(build) { pragma(nolink); } 
     212version(build) { pragma(nolink); } 
    213213</pre> 
    214214<p>See Also:  
     
    233233Example: 
    234234<pre> 
    235        /// Tell 'build' to create WhizzBang.exe 
    236       version(build) { pragma(target, "WhizzBang"); } 
     235 /// Tell 'build' to create WhizzBang.exe 
     236version(build) { pragma(target, "WhizzBang"); } 
    237237</pre> 
    238238<p>See Also:  
  • trunk/Docs/RESPONSE_FILE.htm

    r34 r35  
    22<head> 
    33<!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 
    4 <!-- on 2005/05/02 at 14h19m43 --> 
     4<!-- on 2005/05/04 at 17h47m11 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    2323Example: 
    2424<pre> 
    25    build @final 
     25build @final 
    2626</pre> 
    2727where a file called 'final.brf' contains the command 
     
    3030Example: (contents of final.brf) 
    3131<pre> 
    32     # This creates a production (release) edition of the app. 
    33     -T{Target}_release  # Set the name of the executable. 
    34     -release   # Don't generate runtime checks. 
    35     -full      # Force compilation of all files. 
    36     -cleanup   # remove work files when completed 
    37     -inline    # Allow inlining to occur 
     32# This creates a production (release) edition of the app. 
     33-T{Target}_release  # Set the name of the executable. 
     34-release   # Don't generate runtime checks. 
     35-full      # Force compilation of all files. 
     36-cleanup   # remove work files when completed 
     37-inline    # Allow inlining to occur 
    3838</pre> 
    3939<p> 
    4040The command line for your build could then look like ... 
    4141<pre> 
    42     build myapp @final 
     42build myapp @final 
    4343</pre> 
    4444<p> 
  • trunk/Docs/RULE_DEFINITION_FILE.htm

    r34 r35  
    22<head> 
    33<!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 
    4 <!-- on 2005/05/02 at 14h19m43 --> 
     4<!-- on 2005/05/04 at 17h47m11 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    4040<p> 
    4141<pre> 
    42  ----- Windows Resource Compiler ----- 
    43   This uses ` pragma(/b'build', &lt;sourcefile>.rc); `  
    44  ------------------------------------- 
    45  rule=Resources 
    46  source=rc 
    47  target=res 
     42----- Windows Resource Compiler ----- 
     43 This uses ` pragma(/b'build', &lt;sourcefile>.rc); `  
     44------------------------------------- 
     45rule=Resources 
     46source=rc 
     47target=res 
    4848 tool=rc /r {@IN} /fo {@OUT} 
    4949<p> 
    50  ------------------------------------- 
    51  DMD C linkage 
    52  This uses ` pragma(build, &lt;sourcefile>.c, "COPT=&lt;options>", "HDR=&lt;whatever>"); ` 
    53  ------------------------------------- 
     50------------------------------------- 
     51DMD C linkage 
     52This uses ` pragma(build, &lt;sourcefile>.c, "COPT=&lt;options>", "HDR=&lt;whatever>"); ` 
     53------------------------------------- 
    5454 rule=DMD C/C++  
    55  source=c 
    56  target=obj 
    57  tool=dmc -c {COPT} {@IN} -o{@OUT} {HDR} 
     55source=c 
     56target=obj 
     57tool=dmc -c {COPT} {@IN} -o{@OUT} {HDR} 
    5858<p> 
    5959</pre> 
  • trunk/Docs/SWITCHES.htm

    r34 r35  
    22<head> 
    33<!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 
    4 <!-- on 2005/05/02 at 14h19m43 --> 
     4<!-- on 2005/05/04 at 17h47m11 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    8787Example: 
    8888<pre> 
    89   -CFPATHc:\myproject\configs 
     89-CFPATHc:\myproject\configs 
    9090</pre> 
    9191<p>See Also:  
     
    170170Example: 
    171171<pre> 
    172   -DCPATHc:\old\dmd\bin 
     172-DCPATHc:\old\dmd\bin 
    173173</pre> 
    174174<p>See Also:  
     
    421421<p><p>Example: 
    422422<pre> 
    423     (Set the page size to 32Kb) 
    424     -LIBOPT-p32 
    425 <p> 
    426     (Embedded spaces enclosed in quotes.) 
    427     "-LIBOPT -l -i" 
     423(Set the page size to 32Kb) 
     424-LIBOPT-p32 
     425<p> 
     426(Embedded spaces enclosed in quotes.) 
     427"-LIBOPT -l -i" 
    428428</pre> 
    429429<p>See Also:  
     
    503503Example (notice the Phobos package): 
    504504<pre> 
    505   -Mphobos 
     505-Mphobos 
    506506</pre> 
    507507<p>See Also:  
     
    700700Without a response file the compiler might be invoked thus: 
    701701<pre> 
    702   dmd -op -release appmain.d somemod.obj -IC:\DLibs 
     702dmd -op -release appmain.d somemod.obj -IC:\DLibs 
    703703</pre> 
    704704But with a response file, these arguments are first written out to 
    705705a text file (the response file) and the compiler is invoked : 
    706706<pre> 
    707   dmd @appmain.rsp 
     707dmd @appmain.rsp 
    708708</pre> 
    709709 The <em>appmain.rsp</em> would contain the lines : 
    710710<pre> 
    711   -op 
    712   -release 
    713   appmain.d 
    714   somemod.obj 
    715   -IC:\DLibs 
     711-op 
     712-release 
     713appmain.d 
     714somemod.obj 
     715-IC:\DLibs 
    716716</pre> 
    717717<p>See Also:  
     
    751751Example: 
    752752<pre> 
    753     -RDFmyrules.xyz 
     753-RDFmyrules.xyz 
    754754</pre> 
    755755<p>See Also:  
     
    828828Example 
    829829<pre> 
    830       -Ttestapp 
    831 <p> 
    832       -Ttest_(Target}  # Generate a name based on the default name. 
     830-Ttestapp 
     831<p> 
     832-Ttest_(Target}  # Generate a name based on the default name. 
    833833</pre> 
    834834<p>See Also:  
     
    967967Example - ignore the 'parser' module (or package) 
    968968<pre> 
    969       -Xparser 
     969-Xparser 
    970970</pre> 
    971971<p>See Also:  
  • trunk/Docs/TO_DO.htm

    r34 r35  
    22<head> 
    33<!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 
    4 <!-- on 2005/05/02 at 14h19m43 --> 
     4<!-- on 2005/05/04 at 17h47m11 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    2828 <li> Support the concept of a 'Plugin' block of code. <br> 
    2929<pre> 
    30  version (build) pragma(plugin, &lt;tool>[,delim=xxx],[, &lt;parms>] ) { [body] } 
     30version (build) pragma(plugin, &lt;tool>[,delim=xxx],[, &lt;parms>] ) { [body] } 
    3131</pre> 
    3232This block would be replaced by the stdout data of calling 'tool &lt;params>' and 
  • trunk/Docs/index.htm

    r34 r35  
    22<head> 
    33<!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 
    4 <!-- on 2005/05/02 at 14h19m42 --> 
     4<!-- on 2005/05/04 at 17h47m11 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
  • trunk/Source/build.d

    r34 r35  
    4949*/ 
    5050 
    51 ///topic Change Log 
    52 ///info 
    53 //A list of changes and fixes that have been made. 
    54 // 
    55 // /b"-- v2.05 -- 02/May/2005" 
    56 //<ul> 
    57 ///li ** /b FIX: When supplying some forms of relative paths, the 
    58 //utility would crash or give the wrong canonical form of the path. This 
    59 //effected formats like \..\anything and  C:..\anything 
    60 ///li ** /b FIX: The utility now assumes the current directory if it can not 
    61 //locate the compiler using the paths on the system PATH symbol. 
    62 ///li ** /b FIX: The utility now assumes the compiler's location if no path 
    63 //for the configuration file has been specified. 
    64 ///li ** /b FIX: The utility now supports better parsing of the lines in the 
    65 //configuration file. It handles odd variations of embedded quotes. 
    66 ///li ** /b ENH: The utility now supports Windows 95/98/ME for file times. 
    67 //</ul> 
    68 // 
    69 // /b"-- v2.04 -- 29/Apr/2005" 
    70 //<ul> 
    71 ///li ** /b FIX: /i"thanks to Nils Hensel": The utility was not correctly 
    72 //parsing the DFLAGS line in the configuration file when it contained 
    73 //embedded quote characters. 
    74 ///li ** /b FIX: /i"thanks to Anders F Bjoerklund": The utility was not treating 
    75 //directory names that contained dots correctly. 
    76 ///li ** /b FIX: /i"thanks to Carlos": Unix-style files that end with a nested comment 
    77 //delimiter are now handled correctly. 
    78 ///li ** /b ENH: /i"thanks to qbert(Charlie)": The location of the librarian tool can now 
    79 //be specified. It can be explictly named on a LIBCMD= line inside the 
    80 //DMD configuration file, or failing that, implictly assumed to be in the 
    81 //same directory as the DMD linker. 
    82 ///li ** /b ENH: A new commandline switch -LIBOPT which allows you to pass 
    83 //commandline options to the librarian. 
    84 //</ul> 
    85 // 
    86 // /b"-- v2.03 -- 20/Apr/2005" 
    87 //<ul> 
    88 ///li ** /b FIX: /i"thanks to Carlos": The linux build had a spelling mistake 
    89 //in source.d (line 286). The indentifier "lNextMod" should have been coded 
    90 // as "lNextModule". 
    91 //</ul> 
    92 // 
    93 // /b"-- v2.02 -- 19/Apr/2005" 
    94 //<ul> 
    95 ///li ** /b FIX: /i"thanks to Carlos": The utility was not handling the situation 
    96 //where a simple statement, rather than a block statement, followed a version 
    97 //directive. 
    98 ///li ** /b FIX: /i"thanks to aldacron": The utility now respects the compiler's 
    99 //'Output file' switch. Which is '-of[filename]' for DMD and '-o [filename]' 
    100 //for GNU. The utility treats it as an alias for its -T switch. 
    101 ///li ** /b FIX: /i"thanks to aldacron": The utility now respects the DMD compiler's 
    102 //'Object Path' switch. If you have '-odsomepath' on the command line, the 
    103 //utility adds this to the search path when checking for up-to-date files, 
    104 //and will clean up files in that directory if requested to (-clean). It will 
    105 //also create the directory if it doesn't exist. 
    106 //</ul> 
    107 // 
    108 // /b"-- v2.01 -- 18/Apr/2005" 
    109 //<ul> 
    110 ///li ** /b FIX: /i"thanks to Justin (jcc7)": If an excluded module (-X) was 
    111 //in a package at the current directory level, it was not being excluded. 
    112 //</ul> 
    113 // 
    114 // /b"-- v2.00 -- 08/Apr/2005" 
    115 //<ul> 
    116 ///li ** /b FIX: Now supports the raw-string delimiter ` in Build's own 
    117 //pragma commands. 
    118 ///li ** /b FIX: Now handles backslash escapes in Build's own 
    119 //pragma commands. 
    120 ///li ** /b ENH: New -silent switch avoids all unnecessary messages. 
    121 ///li ** /b ENH: New -help switch displays full usage text. Aliases: -h, -? 
    122 //</ul> 
    123 // 
    124 // /b"-- v1.19 -- 04/Apr/2005" 
    125 //<ul> 
    126 ///li ** /b FIX: /i"thanks to Ben Hinkle". When creating a library in Linux, 
    127 //the utility was looking for /i".obj" files instead of /i".o" files. 
    128 ///li ** /b FIX" When creating a library, if a source file had more than one 
    129 ///i".d" in its name, the utility would look for the wrong object file for it. 
    130 //</ul> 
    131 // 
    132 // /b"-- v1.18 -- 03/Apr/2005" 
    133 //<ul> 
    134 ///li ** /b FIX: If mixed case was used, it was possible to have duplicate 
    135 //element types in a OptLink module definition file. Effected the use of 
    136 //pragma(build_def). 
    137 ///li ** /b ENH: Some performance improvements. 
    138 //</ul> 
    139 // 
    140 // /b"-- v1.17 -- 30/Mar/2005" 
    141 //<ul> 
    142 ///li ** /b FIX: In Windows systems, the utility now does case-insensitive 
    143 // path name compares. 
    144 ///li ** /b FIX: A bug in the String Search function crashed the utility 
    145 //when the -T switch was used with target names less than 9 characters long. 
    146 ///li ** /b ENH: The new switch /b"-obj" is available. This is just a shorthand 
    147 //for having both /i"-nolib" and /i"-nolink" on the command line. 
    148 //</ul> 
    149 // 
    150 // /b"-- v1.16 -- 28/Mar/2005" 
    151 //<ul> 
    152 ///li ** /b FIX: The utility now handles quotes around pragma(link) references. 
    153 ///li ** /b FIX: The utility now handles multiple references to the same module 
    154 //even though they are using different 'path' specifications. 
    155 ///li ** /b ENH: The utility now has support for making Windows DLL files. 
    156 //</ul> 
    157 // 
    158 // /b"-- v1.15 -- 24/Mar/2005" 
    159 //<ul> 
    160 ///li ** /b FIX: The utility now checks for more recent libraries and 
    161 //object files as added by pragma(link), pragma(build), and command line. It 
    162 //didn't used to rebuild the executable if only a new version of a library 
    163 //was present. 
    164 ///li ** /b FIX: The order of the librarian parameters was incorrect. 
    165 ///li ** /b FIX: The utility was not using the correct path name if importing 
    166 //modules from some Import paths. 
    167 ///li ** /b ENH: Verbose mode now shows the ignored and noticed packages. 
    168 //</ul> 
    169 // 
    170 // /b"-- v1.14 -- 23/Mar/2005" 
    171 //<ul> 
    172 ///li ** /b FIX: /i"Thanks to teqDruid." For GNU platforms, the utility 
    173 // now passes any library name found in pragma(link,...) to the linker. 
    174 ///li ** /b FIX: Nows correctly handles unix and Microsoft line-ends. 
    175 ///li ** /b FIX: /i"Thanks to Ben Hinkle." Using relative paths '..' and '.' 
    176 //now work correctly on the -I switch. 
    177 ///li ** /b FIX: /i"Thanks to Ben Hinkle." The correct librarian program 'ar' 
    178 //is now called on unix systems. 
    179 ///li ** /b ENH: The new switch -names displays the names of the files 
    180 //used in building the target. This is not a noisy as verbose mode. 
    181 ///li ** /b ENH: New pragma /b include used to identify a file that 
    182 //must be included in the compilation process but is not one that 
    183 //is imported by any file in the group. Only needed if command line 
    184 // file does not otherwise import the required file. Can be used to 
    185 // include the file containing the 'main' function from a file that 
    186 //does not import that file. Rarely needed. 
    187 ///li ** /b ENH: New pragma /b build used to build 'foreign' file types 
    188 //that D doesn't know about. 
    189 ///li ** /b ENH: New pragma /b target used to nominate the default target 
    190 //file name. 
    191 ///li ** /b ENH: You can now use a symbolic target name on the -T switch. 
    192 //</ul> 
    193 // 
    194 // /b"-- v1.13 -- 13/Mar/2005" 
    195 //<ul> 
    196 ///li ** /b FIX: Explictly included paths entered on the -I switch are 
    197 //now added to the dmd command line. 
    198 ///li ** /b FIX: Explictly excluded modules (via -X) were only checking package 
    199 //names. They also check for module names now. 
    200 ///li ** /b FIX: Imported files are now looked for relative to the current directory 
    201 //before the import paths are checked. 
    202 ///li ** /b FIX: The utility now checks the DFLAG environment symbol in 
    203 //non-DigitalMars D compilers. 
    204 ///li ** /b CHG: The switch -nounittest is now deprecated and ignored if used. 
    205 //The default setting is no longer to compile with unittests turned on. 
    206 //</ul> 
    207 // /b"-- v1.12 -- 6/Mar/2005" 
    208 //<ul> 
    209 ///li ** /b FIX: The response file (-Ry) is now only the default when using 
    210 //DigitalMars tools on Windows. All other environments do not use the response 
    211 //file by default. 
    212 //</ul> 
    213 // /b"-- v1.11 -- 4/Mar/2005" 
    214 //<ul> 
    215 ///li ** /b FIX: No long outputs empty compiler tool switches. 
    216 //</ul> 
    217 // 
    218 // /b"-- v1.10 -- 4/Mar/2005" 
    219 //<ul> 
    220 ///li ** /b FIX: /i"Thanks to Carlos." Better support for GDC command line switches. 
    221 ///li ** /b FIX: /i"Thanks to Carlos." Cause 'Unix' version to trigger Posix code. 
    222 ///li ** /b FIX: /i"Thanks to Carlos." The vUseResponseFile variable was only being 
    223 //declared in the Windows version. 
    224 ///li ** /b FIX: No passes space-embedded switches and paths to the compiler 
    225 //tools correctly. 
    226 ///li ** /b ENH: If an environment symbol called DFLAGS has been defined, it is 
    227 //analyzed. This is done before any configuration file processing. 
    228 ///li ** /b ENH: New command line switch -test. This shows the command lines 
    229 //instead of running them. No compiling or linking is done. 
    230 //</ul> 
    231 // 
    232 // /b"-- v1.9 -- 3/Mar/2005" 
    233 //<ul> 
    234 ///li ** /b FIX: /i"Thanks to Carlos." For unix, it now uses ':' instead of ';' for path 
    235 //separators when parsing the configuration file lines. 
    236 ///li ** /b FIX: /i"Thanks to Carlos." The default location for the configuration 
    237 //file was being ignored. 
    238 ///li ** /b ENH: A new command line switch /b"-R" used to control the use 
    239 // of a response file for the compiler tools. 
    240 //</ul> 
    241 // 
    242 // /b"-- v1.8 -- 1/Mar/2005" 
    243 //<ul> 
    244 ///li ** /b FIX: /i"Thanks to Anders F Bjoerklund:" Removed nonASCII chars from source code. 
    245 ///li ** /b FIX: /i"Thanks to Anders F Bjoerklund:" Changed version(GDC) to version(GNU) 
    246 ///li ** /b FIX: Changed compiler name for GNU versions from 'dmd' to 'gdc' 
    247 ///li ** /b FIX: /i"Thanks to Carlos." The application was incorrectly parsing the DFLAGS sc.ini line. 
    248 ///li ** /b ENH: /i"Thanks to Anders F Bjoerklund:" Provided a Makefile for the initial 
    249 //compile of the application. 
    250 //</ul> 
    251 // 
    252 // /b"-- v1.7 -- 28/Feb/2005" 
    253 //<ul> 
    254 ///li ** /b FIX: /i"Thanks to clayasaurus." Linux edition was not compiling 
    255 //due to a missing 'version(Windows)' block around the use of vWinVer 
    256 //</ul> 
    257 // 
    258 // /b"-- v1.6 -- 28/Feb/2005" 
    259 //<ul> 
    260 ///li ** /b FIX: /i"Thanks to Kris." The utility was not including the DCPATH value 
    261 //when invoking the compiler. 
    262 ///li ** /b ENH: When building a Windows app, the .DEF file now includes the 
    263 //version of windows that /i this application is being run on. 
    264 ///li ** /b ENH: The command line switch /b"-gui" can now have an optional 
    265 // version information to specify which Windows version to build for. 
    266 //The default Windows Version used is the one for the version running 
    267 // this utility. 
    268 ///li ** /b ENH: New command line switch -info to display the utility's version #. 
    269 //</ul> 
    270 // /b"-- v1.5 -- 25/Feb/2005" 
    271 //<ul> 
    272 ///li ** /b FIX: /i"Thanks to clayasaurus." Now only displays the CFPATH 
    273 // and DCPATH messages when /i verbose mode is on. 
    274 ///li ** /b FIX: /i"Thanks to kris." Hardcoded default for DMD path was 
    275 //misleading when dmd.exe was not in the Windows PATH. 
    276 ///li ** /b FIX: The utility was not correctly parsing empty raw strings ``. 
    277 ///li ** /b ENH: /i"Thanks to kris." If the -DCPATH switch is used, then 
    278 //if the existing DCPATH and CFPATH are the same, this switch changes both. 
    279 //</ul> 
    280 // 
    281 // /b"-- v1.4 -- 24/Feb/2005" 
    282 //<ul> 
    283 ///li ** /b FIX: /i"Thanks to Abscissa." The -version switch was being interpreted as 
    284 // a file to compile. 
    285 ///li ** /b FIX: /i"Thanks to brad." Linux version was using the wrong package name 
    286 //when formatting a file date for display. 
    287 ///li ** /b FIX: /i"Thanks to brad." Linux version was not setting the target 
    288 //name correctly which resulted in the first source file being compiled twice. 
    289 ///li ** /b FIX: /i"Thanks to brad." Parsing the DFLAG line in the dmd options 
    290 //file was not dealing with whitespace delimiters. 
    291 ///li ** /b ENH: When specifing an alternate target file, you can now also 
    292 // specify a path for the target, and that path is created for you if it 
    293 //doesn't exist. 
    294 //</ul> 
    295 // 
    296 // /b"-- v1.3 -- 23/Feb/2005" 
    297 //<ul> 
    298 ///li ** /b ENH: Put in a workaround for DMD (Windows) not using the sc.ini 
    299 //file correctly. The utility now explicitly adds any DFLAG options from 
    300 //the sc.ini file into the .rsp file. 
    301 ///li ** /b FIX: The utility now correctly handles ';' delimited DFLAG options 
    302 //in the sc.ini file. 
    303 ///li ** /b ENH: Now supports the use of 'response' files on the command line 
    304 ///li ** /b ENH: Now supports the -T command line switch to supply an 
    305 // alternate tareget name. 
    306 // 
    307 //</ul> 
    308 // /b"-- v1.2 -- 21/Feb/2005" 
    309 //<ul> 
    310 ///li ** /b ENH: /i"Thanks to Anders F Bjoerklund:" Added better support for 'darwin' 
    311 //       and 'gdc'. 
    312 //</ul> 
    313  
     51/* --------- CHANGE LOG -------------------- 
     52__ /topic Change Log 
     53__ /info 
     54__ A list of changes and fixes that have been made. 
     55__ 
     56__  /b"-- v2.06 -- 04/May/2005" 
     57__ <ul> 
     58__ /li ** /b FIX: /i"thanks to phoenix": When emitting commandline parameters for 
     59__ the compiler or librarian, it was possible to have some ending with /b'\"' which caused 
     60__ the shell to /i escape the quote character and thus provide incorrect parameters to 
     61__ the compiler. 
     62__ </ul> 
     63__  /b"-- v2.05 -- 02/May/2005" 
     64__ <ul> 
     65__ /li ** /b FIX: When supplying some forms of relative paths, the 
     66__ utility would crash or give the wrong canonical form of the path. This 
     67__ effected formats like \..\anything and  C:..\anything 
     68__ /li ** /b FIX: The utility now assumes the current directory if it can not 
     69__ locate the compiler using the paths on the system PATH symbol. 
     70__ /li ** /b FIX: The utility now assumes the compiler's location if no path 
     71__ for the configuration file has been specified. 
     72__ /li ** /b FIX: The utility now supports better parsing of the lines in the 
     73__ configuration file. It handles odd variations of embedded quotes. 
     74__ /li ** /b ENH: The utility now supports Windows 95/98/ME for file times. 
     75__ </ul> 
     76__ 
     77__  /b"-- v2.04 -- 29/Apr/2005" 
     78__ <ul> 
     79__ /li ** /b FIX: /i"thanks to Nils Hensel": The utility was not correctly 
     80__ parsing the DFLAGS line in the configuration file when it contained 
     81__ embedded quote characters. 
     82__ /li ** /b FIX: /i"thanks to Anders F Bjoerklund": The utility was not treating 
     83__ directory names that contained dots correctly. 
     84__ /li ** /b FIX: /i"thanks to Carlos": Unix-style files that end with a nested comment 
     85__ delimiter are now handled correctly. 
     86__ /li ** /b ENH: /i"thanks to qbert(Charlie)": The location of the librarian tool can now 
     87__ be specified. It can be explictly named on a LIBCMD= line inside the 
     88__ DMD configuration file, or failing that, implictly assumed to be in the 
     89__ same directory as the DMD linker. 
     90__ /li ** /b ENH: A new commandline switch -LIBOPT which allows you to pass 
     91__ commandline options to the librarian. 
     92__ </ul> 
     93__ 
     94__  /b"-- v2.03 -- 20/Apr/2005" 
     95__ <ul> 
     96__ /li ** /b FIX: /i"thanks to Carlos": The linux build had a spelling mistake 
     97__ in source.d (line 286). The indentifier "lNextMod" should have been coded 
     98__  as "lNextModule". 
     99__ </ul> 
     100__ 
     101__  /b"-- v2.02 -- 19/Apr/2005" 
     102__ <ul> 
     103__ /li ** /b FIX: /i"thanks to Carlos": The utility was not handling the situation 
     104__ where a simple statement, rather than a block statement, followed a version 
     105__ directive. 
     106__ /li ** /b FIX: /i"thanks to aldacron": The utility now respects the compiler's 
     107__ 'Output file' switch. Which is '-of[filename]' for DMD and '-o [filename]' 
     108__ for GNU. The utility treats it as an alias for its -T switch. 
     109__ /li ** /b FIX: /i"thanks to aldacron": The utility now respects the DMD compiler's 
     110__ 'Object Path' switch. If you have '-odsomepath' on the command line, the 
     111__ utility adds this to the search path when checking for up-to-date files, 
     112__ and will clean up files in that directory if requested to (-clean). It will 
     113__ also create the directory if it doesn't exist. 
     114__ </ul> 
     115__ 
     116__  /b"-- v2.01 -- 18/Apr/2005" 
     117__ <ul> 
     118__ /li ** /b FIX: /i"thanks to Justin (jcc7)": If an excluded module (-X) was 
     119__ in a package at the current directory level, it was not being excluded. 
     120__ </ul> 
     121__ 
     122__  /b"-- v2.00 -- 08/Apr/2005" 
     123__ <ul> 
     124__ /li ** /b FIX: Now supports the raw-string delimiter ` in Build's own 
     125__ pragma commands. 
     126__ /li ** /b FIX: Now handles backslash escapes in Build's own 
     127__ pragma commands. 
     128__ /li ** /b ENH: New -silent switch avoids all unnecessary messages. 
     129__ /li ** /b ENH: New -help switch displays full usage text. Aliases: -h, -? 
     130__ </ul> 
     131__ 
     132__  /b"-- v1.19 -- 04/Apr/2005" 
     133__ <ul> 
     134__ /li ** /b FIX: /i"thanks to Ben Hinkle". When creating a library in Linux, 
     135__ the utility was looking for /i".obj" files instead of /i".o" files. 
     136__ /li ** /b FIX" When creating a library, if a source file had more than one 
     137__ /i".d" in its name, the utility would look for the wrong object file for it. 
     138__ </ul> 
     139__ 
     140__  /b"-- v1.18 -- 03/Apr/2005" 
     141__ <ul> 
     142__ /li ** /b FIX: If mixed case was used, it was possible to have duplicate 
     143__ element types in a OptLink module definition file. Effected the use of 
     144__ pragma(build_def). 
     145__ /li ** /b ENH: Some performance improvements. 
     146__ </ul> 
     147__ 
     148__  /b"-- v1.17 -- 30/Mar/2005" 
     149__ <ul> 
     150__ /li ** /b FIX: In Windows systems, the utility now does case-insensitive 
     151__  path name compares. 
     152__ /li ** /b FIX: A bug in the String Search function crashed the utility 
     153__ when the -T switch was used with target names less than 9 characters long. 
     154__ /li ** /b ENH: The new switch /b"-obj" is available. This is just a shorthand 
     155__ for having both /i"-nolib" and /i"-nolink" on the command line. 
     156__ </ul> 
     157__ 
     158__  /b"-- v1.16 -- 28/Mar/2005" 
     159__ <ul> 
     160__ /li ** /b FIX: The utility now handles quotes around pragma(link) references. 
     161__ /li ** /b FIX: The utility now handles multiple references to the same module 
     162__ even though they are using different 'path' specifications. 
     163__ /li ** /b ENH: The utility now has support for making Windows DLL files. 
     164__ </ul> 
     165__ 
     166__  /b"-- v1.15 -- 24/Mar/2005" 
     167__ <ul> 
     168__ /li ** /b FIX: The utility now checks for more recent libraries and 
     169__ object files as added by pragma(link), pragma(build), and command line. It 
     170__ didn't used to rebuild the executable if only a new version of a library 
     171__ was present. 
     172__ /li ** /b FIX: The order of the librarian parameters was incorrect. 
     173__ /li ** /b FIX: The utility was not using the correct path name if importing 
     174__ modules from some Import paths. 
     175__ /li ** /b ENH: Verbose mode now shows the ignored and noticed packages. 
     176__ </ul> 
     177__ 
     178__  /b"-- v1.14 -- 23/Mar/2005" 
     179__ <ul> 
     180__ /li ** /b FIX: /i"Thanks to teqDruid." For GNU platforms, the utility 
     181__  now passes any library name found in pragma(link,...) to the linker. 
     182__ /li ** /b FIX: Nows correctly handles unix and Microsoft line-ends. 
     183__ /li ** /b FIX: /i"Thanks to Ben Hinkle." Using relative paths '..' and '.' 
     184__ now work correctly on the -I switch. 
     185__ /li ** /b FIX: /i"Thanks to Ben Hinkle." The correct librarian program 'ar' 
     186__ is now called on unix systems. 
     187__ /li ** /b ENH: The new switch -names displays the names of the files 
     188__ used in building the target. This is not a noisy as verbose mode. 
     189__ /li ** /b ENH: New pragma /b include used to identify a file that 
     190__ must be included in the compilation process but is not one that 
     191__ is imported by any file in the group. Only needed if command line 
     192__  file does not otherwise import the required file. Can be used to 
     193__  include the file containing the 'main' function from a file that 
     194__ does not import that file. Rarely needed. 
     195__ /li ** /b ENH: New pragma /b build used to build 'foreign' file types 
     196__ that D doesn't know about. 
     197__ /li ** /b ENH: New pragma /b target used to nominate the default target 
     198__ file name. 
     199__ /li ** /b ENH: You can now use a symbolic target name on the -T switch. 
     200__ </ul> 
     201__ 
     202__  /b"-- v1.13 -- 13/Mar/2005" 
     203__ <ul> 
     204__ /li ** /b FIX: Explictly included paths entered on the -I switch are 
     205__ now added to the dmd command line. 
     206__ /li ** /b FIX: Explictly excluded modules (via -X) were only checking package 
     207__ names. They also check for module names now. 
     208__ /li ** /b FIX: Imported files are now looked for relative to the current directory 
     209__ before the import paths are checked. 
     210__ /li ** /b FIX: The utility now checks the DFLAG environment symbol in 
     211__ non-DigitalMars D compilers. 
     212__ /li ** /b CHG: The switch -nounittest is now deprecated and ignored if used. 
     213__ The default setting is no longer to compile with unittests turned on. 
     214__ </ul> 
     215__  /b"-- v1.12 -- 6/Mar/2005" 
     216__ <ul> 
     217__ /li ** /b FIX: The response file (-Ry) is now only the default when using 
     218__ DigitalMars tools on Windows. All other environments do not use the response 
     219__ file by default. 
     220__ </ul> 
     221__  /b"-- v1.11 -- 4/Mar/2005" 
     222__ <ul> 
     223__ /li ** /b FIX: No long outputs empty compiler tool switches. 
     224__ </ul> 
     225__ 
     226__  /b"-- v1.10 -- 4/Mar/2005" 
     227__ <ul> 
     228__ /li ** /b FIX: /i"Thanks to Carlos." Better support for GDC command line switches. 
     229__ /li ** /b FIX: /i"Thanks to Carlos." Cause 'Unix' version to trigger Posix code. 
     230__ /li ** /b FIX: /i"Thanks to Carlos." The vUseResponseFile variable was only being 
     231__ declared in the Windows version. 
     232__ /li ** /b FIX: No passes space-embedded switches and paths to the compiler 
     233__ tools correctly. 
     234__ /li ** /b ENH: If an environment symbol called DFLAGS has been defined, it is 
     235__ analyzed. This is done before any configuration file processing. 
     236__ /li ** /b ENH: New command line switch -test. This shows the command lines 
     237__ instead of running them. No compiling or linking is done. 
     238__ </ul> 
     239__ 
     240__  /b"-- v1.9 -- 3/Mar/2005" 
     241__ <ul> 
     242__ /li ** /b FIX: /i"Thanks to Carlos." For unix, it now uses ':' instead of ';' for path 
     243__ separators when parsing the configuration file lines. 
     244__ /li ** /b FIX: /i"Thanks to Carlos." The default location for the configuration 
     245__ file was being ignored. 
     246__ /li ** /b ENH: A new command line switch /b"-R" used to control the use 
     247__  of a response file for the compiler tools. 
     248__ </ul> 
     249__ 
     250__  /b"-- v1.8 -- 1/Mar/2005" 
     251__ <ul> 
     252__ /li ** /b FIX: /i"Thanks to Anders F Bjoerklund:" Removed nonASCII chars from source code. 
     253__ /li ** /b FIX: /i"Thanks to Anders F Bjoerklund:" Changed version(GDC) to version(GNU) 
     254__ /li ** /b FIX: Changed compiler name for GNU versions from 'dmd' to 'gdc' 
     255__ /li ** /b FIX: /i"Thanks to Carlos." The application was incorrectly parsing the DFLAGS sc.ini line. 
     256__ /li ** /b ENH: /i"Thanks to Anders F Bjoerklund:" Provided a Makefile for the initial 
     257__ compile of the application. 
     258__ </ul> 
     259__ 
     260__  /b"-- v1.7 -- 28/Feb/2005" 
     261__ <ul> 
     262__ /li ** /b FIX: /i"Thanks to clayasaurus." Linux edition was not compiling 
     263__ due to a missing 'version(Windows)' block around the use of vWinVer 
     264__ </ul> 
     265__ 
     266__  /b"-- v1.6 -- 28/Feb/2005" 
     267__ <ul> 
     268__ /li ** /b FIX: /i"Thanks to Kris." The utility was not including the DCPATH value 
     269__ when invoking the compiler. 
     270__ /li ** /b ENH: When building a Windows app, the .DEF file now includes the 
     271__ version of windows that /i this application is being run on. 
     272__ /li ** /b ENH: The command line switch /b"-gui" can now have an optional 
     273__  version information to specify which Windows version to build for. 
     274__ The default Windows Version used is the one for the version running 
     275__  this utility. 
     276__ /li ** /b ENH: New command line switch -info to display the utility's version #. 
     277__ </ul> 
     278__  /b"-- v1.5 -- 25/Feb/2005" 
     279__ <ul> 
     280__ /li ** /b FIX: /i"Thanks to clayasaurus." Now only displays the CFPATH 
     281__  and DCPATH messages when /i verbose mode is on. 
     282__ /li ** /b FIX: /i"Thanks to kris." Hardcoded default for DMD path was 
     283__ misleading when dmd.exe was not in the Windows PATH. 
     284__ /li ** /b FIX: The utility was not correctly parsing empty raw strings ``. 
     285__ /li ** /b ENH: /i"Thanks to kris." If the -DCPATH switch is used, then 
     286__ if the existing DCPATH and CFPATH are the same, this switch changes both. 
     287__ </ul> 
     288__ 
     289__  /b"-- v1.4 -- 24/Feb/2005" 
     290__ <ul> 
     291__ /li ** /b FIX: /i"Thanks to Abscissa." The -version switch was being interpreted as 
     292__  a file to compile. 
     293__ /li ** /b FIX: /i"Thanks to brad." Linux version was using the wrong package name 
     294__ when formatting a file date for display. 
     295__ /li ** /b FIX: /i"Thanks to brad." Linux version was not setting the target 
     296__ name correctly which resulted in the first source file being compiled twice. 
     297__ /li ** /b FIX: /i"Thanks to brad." Parsing the DFLAG line in the dmd options 
     298__ file was not dealing with whitespace delimiters. 
     299__ /li ** /b ENH: When specifing an alternate target file, you can now also 
     300__  specify a path for the target, and that path is created for you if it 
     301__ doesn't exist. 
     302__ </ul> 
     303__ 
     304__  /b"-- v1.3 -- 23/Feb/2005" 
     305__ <ul> 
     306__ /li ** /b ENH: Put in a workaround for DMD (Windows) not using the sc.ini 
     307__ file correctly. The utility now explicitly adds any DFLAG options from 
     308__ the sc.ini file into the .rsp file. 
     309__ /li ** /b FIX: The utility now correctly handles ';' delimited DFLAG options 
     310__ in the sc.ini file. 
     311__ /li ** /b ENH: Now supports the use of 'response' files on the command line 
     312__ /li ** /b ENH: Now supports the -T command line switch to supply an 
     313__  alternate tareget name. 
     314__ 
     315__ </ul> 
     316__  /b"-- v1.2 -- 21/Feb/2005" 
     317__ <ul> 
     318__ /li ** /b ENH: /i"Thanks to Anders F Bjoerklund:" Added better support for 'darwin' 
     319__        and 'gdc'. 
     320__ </ul> 
     321*/ 
    314322 
    315323module build; 
     
    325333    version(Windows) { 
    326334        // OptLink Definition File 
    327         pragma (build_def, "VERSION 2.05"); 
     335        pragma (build_def, "VERSION 2.06"); 
    328336    } 
    329337} 
     
    470478    char[]       vAppPath; 
    471479    char[]       vAppName; 
    472     char[]       vAppVersion = "2.05"; 
     480    char[]       vAppVersion = "2.06"; 
    473481    char[]       vTargetName;           // Output name from first file name. 
    474482    char[]       vPragmaTargetName;     // Output name from pragma. 
     
    10281036            // Enclose in quotes if no quotes are currently present. 
    10291037            if (bmfind(lCompileArg, "\"") == -1) 
    1030                 lOutText ~= std.string.format(`"%s"`, lCompileArg); 
     1038                // Arguments containing a blank need to be quoted. 
     1039                if (bmfind(lCompileArg, " ") != -1) 
     1040                { 
     1041                    // Strip off any trailing shell escape lead-in character. 
     1042                    if (lCompileArg[$-1] == '\\') 
     1043                        lCompileArg.length = lCompileArg.length - 1; 
     1044                    lOutText ~= std.string.format(`"%s"`, lCompileArg); 
     1045                } 
     1046                else 
     1047                    lOutText ~= lCompileArg; 
    10311048            else 
    10321049                lOutText ~= lCompileArg; 
     
    10421059        ) { 
    10431060        if (vNoLinkSwitch.length > 0) { 
    1044             lOutText ~= std.string.format("\"%s\"\n",vNoLinkSwitch);  // No linking allowed. 
     1061            if (bmfind(vNoLinkSwitch, " ") != -1) 
     1062            { 
     1063                lOutText ~= std.string.format(`"%s"`,vNoLinkSwitch);  // No linking allowed. 
     1064            } 
     1065            else 
     1066                lOutText ~= vNoLinkSwitch; 
     1067            // Terminate with a newline char. 
     1068            lOutText ~= "\n"; 
     1069 
    10451070            vCompilerArgs ~= vNoLinkSwitch; 
    10461071        } 
     
    10541079        if (lLinking ||( getExt(lFileName) != kObjExtention)) { 
    10551080            if (lFileName.length > 0) { 
    1056                 lOutText ~= std.string.format("\"%s\"\n",lFileName); 
     1081                if (bmfind(lFileName, " ") != -1) 
     1082                { 
     1083                    lOutText ~= std.string.format(`"%s"`,lFileName); 
     1084                } 
     1085                else 
     1086                    lOutText ~= lFileName; 
     1087                // Terminate with a newline char. 
     1088                lOutText ~= "\n"; 
    10571089            } 
    10581090        } 
     
    10921124 
    10931125        if (lDefName.length > 0) { 
    1094             lOutText ~= std.string.format("\"%s\"\n",lDefName); 
     1126            if (bmfind(lDefName, " ") != -1) 
     1127            { 
     1128                lOutText ~= std.string.format(`"%s"`,lDefName); 
     1129            } 
     1130            else 
     1131                lOutText ~= lDefName; 
     1132            // Terminate with a newline char. 
     1133            lOutText ~= "\n"; 
     1134 
    10951135        } 
    10961136    } 
     
    11001140        foreach (char[] lFileName; vLinkFiles.keys) { 
    11011141            if (lFileName.length > 0) { 
    1102                 lOutText ~= std.string.format("\"%s\"\n",lFileName); 
     1142                if (bmfind(lFileName, " ") != -1) 
     1143                { 
     1144                    lOutText ~= std.string.format(`"%s"`,lFileName); 
     1145                } 
     1146                else 
     1147                    lOutText ~= lFileName; 
     1148                // Terminate with a newline char. 
     1149                lOutText ~= "\n"; 
    11031150            } 
    11041151        } 
     
    11101157        if(lLinking) { 
    11111158            // Ensure the linker gets the right executable name to create. 
    1112             version(Posix) { 
    1113                 lOutText ~= std.string.format("%s\"%s\"\n",vOutFileSwitch, 
    1114                                     util.pathex.AbbreviateFileName(lTargetName)); 
     1159            char[] lSmallName; 
     1160            lSmallName = util.pathex.AbbreviateFileName(lTargetName); 
     1161            if (bmfind(lSmallName, " ") != -1) { 
     1162                version(Posix) { 
     1163                    lOutText ~= std.string.format(`%s"%s"`,vOutFileSwitch,lSmallName); 
     1164                } 
     1165                else { 
     1166                    lOutText ~= std.string.format(`"%s%s"`,vOutFileSwitch,lSmallName); 
     1167                } 
    11151168            } 
    1116             else { 
    1117                 lOutText ~= std.string.format("\"%s\"\n",vOutFileSwitch ~ 
    1118                                     util.pathex.AbbreviateFileName(lTargetName)); 
    1119             } 
     1169            else 
     1170                lOutText ~= std.string.format(`%s%s`,vOutFileSwitch,lSmallName); 
     1171 
     1172            // Terminate with a newline char. 
     1173            lOutText ~= "\n"; 
    11201174 
    11211175            // Include the default libraries. 
     
    11231177            { 
    11241178                if (lLib.length > 0) { 
    1125                     lOutText ~= std.string.format("\"%s\"\n",lLib); 
     1179                    if (bmfind(lLib, " ") != -1) 
     1180                    { 
     1181                        lOutText ~= std.string.format(`"%s"`,lLib); 
     1182                    } 
     1183                    else 
     1184                        lOutText ~= lLib; 
     1185                    // Terminate with a newline char. 
     1186                    lOutText ~= "\n"; 
    11261187                } 
    11271188            } 
     
    11341195        } 
    11351196        else 
    1136         {   // using commandline, may run into limits 
    1137             lOutText=std.string.replace(lOutText, "\n"," "); 
     1197        {   // using commandline; may run into limits 
     1198            lOutText=std.string.replace(lOutText, "\n", " "); 
    11381199            //lOutText=std.string.replace(lOutText, "\""," "); 
    11391200            lCommand = vCompilerPath ~ vCompiler ~ " " ~ lOutText; 
     
    24132474} 
    24142475 
    2415 //============= The User Manual ====================================== 
    2416 ///topic Introduction 
    2417 ///info 
    2418 //This is a utility to build an application using the D programming language. 
    2419 //It does this by examining the source file supplied on the command line 
    2420 //to work out its dependant files, and then determines which need to be 
    2421 // compiled and which need to be linked to create the executable. 
    2422 // 
    2423 //Alternatively, it can be used to create a Library file rather than an 
    2424 // executable. 
    2425 // 
    2426 //The aim of the utility is to help remove the need for /i make files 
    2427 // or similar devices. 
    2428  
    2429 ///topic Pragma 
    2430 ///info 
    2431 //The /b build utility supports the use of various pragma statements. 
    2432 //A pragma is a special statement embedded in the source code that 
    2433 // provides information to tools reading the source code. 
    2434 // 
    2435 //They take the forms ... 
    2436 ///code 
    2437 //      /b"pragma(" ~<name~> /b");" 
    2438 //      /b"pragma(" ~<name~> /b"," ~<option~> [ /b","~<option~>] /b");" 
    2439 ///endcode 
    2440 // 
    2441 //If the D compiler doesn't recognise the pragma, it will fail. So to 
    2442 // 'hide' them from the compiler, you need to wrap them in a /b version 
    2443 // block. All the pragmas used by this utility need to be enclosed in 
    2444 // a /i build version. 
    2445 // 
    2446 //Example: 
    2447 ///code 
    2448 //      version(build) { pragma(nolink); } 
    2449 ///endcode 
    2450  
    2451 ///topic Pragma 
    2452 ///pragma link 
    2453 ///desc This nominates one or more libraries that are required to be linked in. 
    2454 //If your applications needs code from a library to be linked in, rather than 
    2455 // supplying source code, you can tell /i build which libraries are needed. 
    2456 //This can happen when using a library provided by a third-party. 
    2457 // 
    2458 //Example 1: 
    2459 ///code 
    2460 //      /// This app needs the MyGUI.lib library to be used. 
    2461 //      version(build) { pragma(link, MyGUI); } 
    2462 ///endcode 
    2463 // 
    2464 //Example 2: 
    2465 ///code 
    2466 //      /// This app needs the a DB library and TCP library to be used. 
    2467 //      version(build) { pragma(link, EuDB, TCP4Win); } 
    2468 ///endcode 
    2469  
    2470 ///topic Pragma 
    2471 ///pragma nolink 
    2472 ///desc This identifies that the current module is not to be be linked in. 
    2473 //Normally, each object file created by the compiler is linked in, but 
    2474 // if the supplied source file is just a stub for code which is externally 
    2475 // defined in a library, then you do not need the 'stub' object file. 
    2476 // 
    2477 //Example: 
    2478 ///code 
    2479 //      version(build) { pragma(nolink); } 
    2480 ///endcode 
    2481  
    2482 ///topic Pragma 
    2483 ///pragma include 
    2484 ///desc This identifies a required file which is not otherwise imported. 
    2485 //In some applications, especially ones converted over from C, it is 
    2486 //possible that the file on the /i Build command line does not directly 
    2487 //or indirectly import a required file. In those situations, you can 
    2488 //use this pragma to tell build to include it in the compilation checking 
    2489 //process. 
    2490 // 
    2491 //Example: 
    2492 ///code 
    2493 //      // Tell 'build' that prime.d must be included (it contains the main function.) 
    2494 //      version(build) { pragma(include, "prime"); } 
    2495 ///endcode 
    2496  
    2497 ///topic Pragma 
    2498 ///pragma target 
    2499 ///desc This identifies the basename of the target file. 
    2500 //By default, the target name is based on the first file on the command line. 
    2501 //But if you include this pragma, the name identified in the pragma becomes 
    2502 //the default name. In either case, the -T switch overrides the default name. 
    2503 // 
    2504 // If two or more /i target pragmas are found, the first one is the one 
    2505 // that is used and the others are ignored (though mentioned if in 
    2506 // verbose mode). 
    2507 //Example: 
    2508 ///code 
    2509 //      //// Tell 'build' to create WhizzBang.exe 
    2510 //      version(build) { pragma(target, "WhizzBang"); } 
    2511 ///endcode 
    2512  
    2513 ///topic Pragma 
    2514 ///pragma build 
    2515 ///desc This identifies a file that needs an external program to build it. 
    2516 //Some applications need to link in object files created by C source, or 
    2517 //by a /i resource compiler, or whatever. This pragma identifies a file 
    2518 //that needs to be linked in, but cannot be created by the D compiler. The 
    2519 //format is /n 
    2520 ///code 
    2521 //    pragma(build, "FILENAME" [, "OPTIONS"] ...); 
    2522 ///endcode 
    2523 //where /i FILENAME is either the file to link in, or the file to use when 
    2524 //creating the file to link in. For example, if you had a Windows resource file 
    2525 //that needed to be compiled, you could code the pragma as either ... 
    2526 // 
    2527 ///code 
    2528 //    //// Compile the images into a resource obj and add images.res to linker. 
    2529 //    pragma(build, "images.rc"); 
    2530 ///endcode 
    2531 //or /n 
    2532 ///code 
    2533 //    //// Compile the images into a resource obj and add images.res to linker. 
    2534 //    pragma(build, "images.res"); 
    2535 ///endcode 
    2536 // 
    2537 //The first example specifies the source file to be passed to the resource 
    2538 //compiler and the second example specifies the output of the resource compiler. 
    2539 //In either case, this utility uses the rules in a /"Rule Definition File" to 
    2540 //decide what to do. 
    2541 // 
    2542 //The utility searches for the /i"FILENAME" in the currently defined 'import' 
    2543 //paths. 
    2544 // 
    2545 //The /i OPTIONS can be included if you need to pass any special values 
    2546 //to the external tool. There can be any number of these, but each one must 
    2547 //take the form ~<KEYWORD>=~<VALUE>. For example /n 
    2548 ///code 
    2549 //      pragma(build, "dbapi.c", "COPT=-wc -x", "HDR=abc.hp"); 
    2550 ///endcode 
    2551 //The OPTIONS values are used as replacement text for token in the 
    2552 //Rule Definition File's 'tool' specification. In the example above, 
    2553 //the tokens {COPT} and {HDR}, if found in the 'tool' line, would be 
    2554 //replaced with /i"-wc -x" and /i"abc.hp" respectively. 
    2555 // 
    2556 //The output file to the external tool is checked to see if it is still 
    2557 //up to date. 
    2558 // 
    2559 //The output file from the external tool is added to the linkage set. 
    2560 // 
    2561 //All such external programs are run before the D compiler is invoked. 
    2562 // 
    2563 //Example: 
    2564 ///code 
    2565 //      //// Tell 'build' that it needs to call an external program 
    2566 //      //// to build an up-to-date version of 'images.rc' 
    2567 //      version(build) { pragma(build, "images.rc"); } 
    2568 ///endcode 
    2569  
    2570 ///topic Rule Definition File 
    2571 ///info 
    2572 //Defines the rules used to build non-D source files. 
    2573 //This is not as advanced as the typical /b makefile abilities and is 
    2574 //only useful for simple situations. Specifically, it only caters for 
    2575 //applications that take a single input file to create the required 
    2576 //output file. 
    2577 // 
    2578 //The default Rule Definition File is called "default.rdf". It is found by 
    2579 //first looking in the directory where the utility is installed, and if 
    2580 //it is not found there, the directories in the PATH environment symbol 
    2581 //are scanned. 
    2582 // 
    2583 //The default RDF can be overridden by the -RDF command line switch. 
    2584 // 
    2585 //Each rule is defined in a set of four mandatory lines ... /n 
    2586 ///li rule=~<name> 
    2587 ///li source=~<extention> 
    2588 ///li target=~<extention> 
    2589 ///li tool=~<command pattern> 
    2590 // 
    2591 //Any other line in the file, not starting with one of the above keywords 
    2592 //is simply ignored (treated as comments). 
    2593 // 
    2594 //The /i"tool" line can contain special tokens. These are keywords enclosed 
    2595 //in braces. At compile time, the tokens are replaced by replacement text 
    2596 //taken from the pragma(build) statement. There are two predefined tokens 
    2597 //that can be used. /b"{@IN}" is replaced by the name of the input file, 
    2598 //and /b"{@OUT}" is replaced by the name of the output file. 
    2599 // 
    2600 ///code 
    2601 // ----- Windows Resource Compiler ----- 
    2602 // This uses ` pragma(/b'build', ~<sourcefile>.rc); ` 
    2603 // ------------------------------------- 
    2604 // rule=Resources 
    2605 // source=rc 
    2606 // target=res 
    2607 //tool=rc //r {@IN} //fo {@OUT} 
    2608 // 
    2609 // ------------------------------------- 
    2610 // DMD C linkage 
    2611 // This uses ` pragma(build, ~<sourcefile>.c, "COPT=~<options>", "HDR=~<whatever>"); ` 
    2612 // ------------------------------------- 
    2613 //rule=DMD C/C++ 
    2614 // source=c 
    2615 // target=obj 
    2616 // tool=dmc -c {COPT} {@IN} -o{@OUT} {HDR} 
    2617 // 
    2618 ///endcode 
    2619  
    2620 ///topic Pragma 
    2621 ///pragma build_def 
    2622 ///desc This supplies an option to be placed in an OptLink definition file. 
    2623 //You can have /i build create a customised OptLink definition file 
    2624 //by coding as many /i build_def pragmas as required. However, /i build will 
    2625 //only allow the first of each type of Definition File command to be used. THis 
    2626 //means that if you code ... /n 
    2627 ///code 
    2628 //      pragma (build_def, "EXETYPE DOS"); 
    2629 //      pragma (build_def, "EXETYPE NT"); 
    2630 ///endcode 
    2631 //Then the EXETYPE DOS will be used and the 'NT' line ignored. You can use 
    2632 //explicit build_def pragmas to override the default ones generated by 
    2633 // /i build for Windows programs or DLL libraries. 
    2634 // 
    2635 //The syntax for these pragma is /n 
    2636 ///code 
    2637 //          pragma(build_def, ~<QUOTED_STRING~> ); 
    2638 ///endcode 
    2639 // 
    2640 //Example: 
    2641 ///code 
    2642 //  version(build) { 
    2643 //    pragma (build_def, "VERSION 1.1"); 
    2644 //    version(DOS) { 
    2645 //      pragma (build_def, "EXETYPE DOS"); 
    2646 //    } 
    2647 //    version(WIN) { 
    2648 //      pragma (build_def, "EXETYPE NT"); 
    2649 //      pragma (build_def, "SUBSYSTEM WINDOWS,4.0"); 
    2650 //    } 
    2651 //  } 
    2652 ///endcode 
    2653 // 
    2654 //You can supply /b any text string and it is used verbatim. There is no 
    2655 // restrictions on what you can include in the pragma. 
    2656  
    2657 ///topic Auto Build Number 
    2658 ///info 
    2659 //Automatically Incremented Build Numbering for Modules 
    2660 //You can optionally specify that the /i build utility automatically 
    2661 //increments a build number for any module. You do this by supplying 
    2662 // a single line in your source code in the form ... /n 
    2663 ///code 
    2664 //      private import /b"~<modulename~>"_bn; 
    2665 ///endcode 
    2666 //Typically this line is placed immediately after the source file's 
    2667 ///b module statement, but that is not strictly necessary. 
    2668 // 
    2669 //By having this line in your code, /i build then uses a file with the 
    2670 // suffix "_bn.d" to maintain 
    2671 //the current build number for the ~<modulename~>. Note that /i build 
    2672 // will create this file if it doesn't exist. Also note that 
    2673 // /i build will update this file whenever the module file has been 
    2674 // updated or its object file needs to be rebuilt, so you really 
    2675 //shouldn't modify it manually. Any manual changes will be deleted 
    2676 // by /i build. /n 
    2677 // 
    2678 //Example: /n 
    2679 //If your module is called "parser.d" you would have the lines ... 
    2680 ///code 
    2681 //  module parser; 
    2682 //  private import parser_bn; 
    2683 ///endcode 
    2684 // 
    2685 //You can access the build number from within the module thus ... /n 
    2686 // 
    2687 ///code 
    2688 //          writefln("Build number is %d", auto_build_number); 
    2689 ///endcode 
    2690 //You can access the build numbers of other modules in you application 
    2691 // by importing the appropriate file and prefixing the references with 
    2692 // the module names. /n 
    2693 //Example: 
    2694 ///code 
    2695 //      module parser;  /// This module's name. 
    2696 //      private import parser_bn;   /// This module's B/N 
    2697 //      private import tokenizer_bn; /// Another module's B/N 
    2698 //      . . . 
    2699 //      writefln("Builds..."); 
    2700 //      writefln("  Parser %d", parser_bn.auto_build_number); 
    2701 //      writefln("  Tokens %d", tokenizer_bn.auto_build_number); 
    2702 ///endcode 
    2703 // 
    2704 //The "_bn.d" file created by /i build for this module would look like ... /n 
    2705 ///code 
    2706 //  module parser_bn; 
    2707 //  /// This file is automatically maintained by the BUILD utility, 
    2708 //  /// Please refrain from manually editing it. 
    2709 //  long auto_build_number = 77; 
    2710 ///endcode 
    2711 //Of course the number /i 77 is just an example. This number would actually 
    2712 // start at 1 and increment whenever /i build needed to create a new object 
    2713 //file for the module. 
    2714  
    2715 ///topic Command Line 
    2716 ///info 
    2717 //The /i build utility supplies the source file and optional switches via the command line. 
    2718 //The typical format of the /i build utility's command line is ... /n 
    2719 ///code 
    2720 //      /b build ~<sourcefile~> [ ~<switches~> ] [ ~<otherfiles~> ] 
    2721 ///endcode 
    2722 //You can however specify the files and switches in any order you like. 
    2723 // 
    2724 //Normally you would only supply a single file name to /i build, that being 
    2725 // the source file of the top-level file in the application. Typically 
    2726 // the one that has the 'main()' or 'WinMain()' function, though this is 
    2727 // not strictly necessary. 
    2728 // 
    2729 //If you run the utility without any files and without any switches, it 
    2730 // display a /i help screen with some details about the switches. That looks 
    2731 // like this ... 
    2732 ///code 
    2733 //  Path and Version : C:\Program Files\build.exe v3.6(339) 
    2734 //  Usage: build sourcefile [options objectfiles libraries] 
    2735 //    /b sourcefile D source file 
    2736 //    /b"-v"         Verbose (passed through to D) 
    2737 //    /b"-V"         Verbose (NOT passed through) 
    2738 //    /b"-names"     Displays the names of the files used to build the target. 
    2739 //    /b"-DCPATH~<path~> ~<path~>" is where the compiler has been installed. 
    2740 //               Only needed if the compiler is not in the system's 
    2741 //               PATH list. Used if you are testing an alternate 
    2742 //               version of the compiler. 
    2743 //    /b"-CFPATH~<path~> ~<path~>" is where the D config file has been installed. 
    2744 //    /b"-full"      Causes all source files, except ignored modules, 
    2745 //                to be compiled. 
    2746 //    /b"-link"      Forces the linker to be called instead of the librarian. 
    2747 //                (Only needed if the source files do not contain 
    2748 //                 main/WinMain) 
    2749 //    /b"-nolink"    Ensures that the linker is not called. 
    2750 //                (Only needed if main/WinMain is found in the source 
    2751 //                 files and you do NOT want an executable created.) 
    2752 //    /b"-lib"       Forces the object files to be placed in a library. 
    2753 //                (Only needed if main/WinMain is found in the source 
    2754 //                 files AND you want it in a library instead of 
    2755 //                 an executable.) 
    2756 //    /b"-nolib"     Ensures that the object files are not used to form 
    2757 //                a library. 
    2758 //                (Only needed if main/WinMain is not found in the source 
    2759 //                 files and you do NOT want a library. 
    2760 //    /b"-obj"       This is the same as having both -nolink and -nolib 
    2761 //                switches on the command line. It is just a shorthand. 
    2762 //    /b"-allobj"    Ensures that all object files are added to a 
    2763 //                library. 
    2764 //                (Normally only those in the same directory are added.) 
    2765 //    /b"-cleanup"   Ensures that all object files created during the run 
    2766 //                are removed at the end of the run, plus other work files. 
    2767 //    /b"-clean"     Same as -cleanup 
    2768 //    /b"-test"      Does everything as normal except it displays the commands 
    2769 //                  instead of running them. Also, the auto-build-numbers are 
    2770 //                  not incremented. 
    2771 //    /b"-RDF~<path~>"  Overrides the default Rule Definition File 
    2772 //    /b"-gui[:x.y]" Forces a GUI application to be created. The optional 
    2773 //                :x.y can be used to build an application for a 
    2774 //                specific version of Windows. eg. -gui:4.0 
    2775 //                (Only needed if WinMain is not found in the source files 
    2776 //                or if you wish to override the default Windows version) 
    2777 //    /b"-dll"       Forces a DLL library to be created. 
    2778 //                      (Only needed if DllMain is not found in the source files. 
    2779 //    /b"-LIBOPT~<opt~>" Allows you to pass ~<opt~> to the librarian 
    2780 //    /b"-X~<module~>" Packages and Modules to ignore (eg. -Xmylib) 
    2781 //    /b"-M~<module~>" Packages and Modules to notice (eg. -Mphobos) 
    2782 //    /b"-T~<targetname~>" The name of the target file to create. Normally 
    2783 //                the target name istaken from the first or only name 
    2784 //                of the command line. 
    2785 //    /b"-R~<y|n~>" Indicates whether to use a response file or command line 
    2786 //                   arguments with the compiler tools. 
    2787 //                 /b"-Ry" will cause a response to be used. 
    2788 //                 /b"-Rn" will cause command line arguments to be used. 
    2789 //                 /b"-R" will reverse the current usage. 
    2790 //                  Note that the default for Windows DigitalMars is to use a response file 
    2791 //                  but for all other environments it is to use command line arguments. 
    2792 //    /b"-info"      Displays the version and path of the Build application 
    2793 //    /b"-help"      Displays the full 'usage' help text. 
    2794 //    /b"-h"         Same as /-help, displays the full 'usage' help text. 
    2795 //    /b"-?   "      Same as /-help, displays the full 'usage' help text. 
    2796 //    /b"-silent"    Avoids unnecessary messages being displayed. 
    2797 //    /b"[...]"      All other options, objectfiles and libraries are 
    2798 //                passed to the compiler 
    2799 ///endcode 
    2800 // 
    2801 //See also /"Response File" 
    2802  
    2803 ///topic Switches 
    2804 ///info 
    2805 ///i Build supports a number of command line switches to control its default assumptions. 
    2806  
    2807  
    2808 ///topic switches 
    2809 ///switch -v 
    2810 ///desc Set /i verbose mode on for both /i build and for the compiler 
    2811  
    2812 ///topic switches 
    2813 ///switch -V 
    2814 ///desc Set /i verbose mode on for just /i build and not for the compiler 
    2815  
    2816 ///topic switches 
    2817 ///switch -names 
    2818 ///desc Displays the names of the files used in building the target. 
    2819  
    2820 ///topic switches 
    2821 ///switch -DCPATH 
    2822 ///desc  Identifies where the compiler has been installed. 
    2823 //Normally, /i build scans the PATH environment symbol to find where the 
    2824 // D compiler is located. However, if you need to use the compiler from 
    2825 // a different location, you would use this switch to tell /i build where 
    2826 // it is. 
    2827 // 
    2828 ///b"Note:" If you use this switch, and the current CFPATH value is 
    2829 //identical to the current DCPATH value, then this switch will change 
    2830 //both to the new value. The assumption is that the configuration 
    2831 //file is in the same directory as the compiler. If this is not the case, 
    2832 //you will also need to use the /-CFPATH switch. 
    2833 // 
    2834 //Example: 
    2835 ///code 
    2836 //  -DCPATHc:\old\dmd\bin 
    2837 ///endcode 
    2838  
    2839 ///topic switches 
    2840 ///switch -CFPATH 
    2841 ///desc Identifies where the D config file has been installed. 
    2842 //Normally, /i build looks in the same place that the compiler is 
    2843 // installed in, but if you need to use a different configuration 
    2844 // path from that, you would use this switch to tell /i build where 
    2845 // it is. 
    2846 // 
    2847 //Example: 
    2848 ///code 
    2849 //  -CFPATHc:\myproject\configs 
    2850 ///endcode 
    2851  
    2852 ///topic switches 
    2853 ///switch -full 
    2854 ///desc Causes all source files, except ignored modules, to be compiled. 
    2855 //Normally, /i build only compiles a source file if it's object file 
    2856 //is out of date or missing. This switch forces all source files to be 
    2857 // recompiled, even if not strictly required. 
    2858 // 
    2859 ///b "Note:" Modules in the /i ignore list are still ignored though. 
    2860  
    2861 ///topic switches 
    2862 ///switch -link 
    2863 ///desc Forces the linker to be called instead of the librarian. 
    2864 //Normally, if /i build does not find a main() or WinMain() function 
    2865 // in the source files, it creates a library to contain the object 
    2866 //files. But when this switch is used, /i build will attempt to 
    2867 // create an application by calling the linker rather than the librarian. 
    2868 // 
    2869 //You would typically use this if the main() function was being supplied 
    2870 //from an existing library file rather than one you your source files. 
    2871  
    2872 ///topic switches 
    2873 ///switch -nolink 
    2874 ///desc  Ensures that the linker is not called. 
    2875 //Normally, if /i build finds a main() or WinMain() function, it 
    2876 //tries to create an application by calling the linker. If you use 
    2877 // this switch however, the linker will not be called. 
    2878 // 
    2879 //You would typically do this if you wanted to create a library that 
    2880 //stores your 'main' function in it, in which case you'd also use the /-lib 
    2881 // switch. But you could just create a set of object files without linking 
    2882 // them with this switch. 
    2883  
    2884 ///topic switches 
    2885 ///switch -lib 
    2886 ///desc Forces the object files to be placed in a library. 
    2887 //Normally, if /i build finds a main() or WinMain() function, it 
    2888 //tries to create an application by calling the linker. But if you 
    2889 // use this switch, the librarian is called instead of the linker. 
    2890 // 
    2891 //You would typically do this if you wanted to create a library that 
    2892 //stores your 'main' function in it, in which case you'd also use the /-nolink 
    2893 //switch. 
    2894  
    2895 ///topic switches 
    2896 ///switch -obj 
    2897 ///desc Shorthand for using both /"-nolink" and /"-nolib" switches. 
    2898 //This is literally the same has if you had placed both -nolink and 
    2899 //-nolib on the command line. As this is a common way to just compile 
    2900 //modules to get the object files for them, without doing anything else, 
    2901 //a neat shorthand is available. 
    2902  
    2903 ///topic switches 
    2904 ///switch -nolib 
    2905 ///desc Ensures that the object files are not used to form a library. 
    2906 //Normally, if /i build does not find a main() or WinMain() function, 
    2907 // it calls the librarian to create a library for all your object files. 
    2908 //But if you use this switch, the librarian is not called. 
    2909 // 
    2910 //Typically, you would do this if you just wanted to create one or more 
    2911 // object files and do nothing else. 
    2912  
    2913 ///topic switches 
    2914 ///switch -allobj 
    2915 ///desc Ensures that all object files are added to a library. 
    2916 //Normally, /i build will only create a library using the object files 
    2917 // that are in the same directory as the new library. You would use 
    2918 // this switch if you wanted all object files created by this build 
    2919 //session to be included in the library. 
    2920  
    2921 ///topic switches 
    2922 ///switch -cleanup 
    2923 ///desc Ensures that all working files created during the run are removed. 
    2924 //Normally, /i build does not delete any object files or working files 
    2925 //when it finishes a session. You can use this switch to have /i build 
    2926 // clean up after itself. This will remove all object files created 
    2927 // in this run, plus any .rsp, .lsp, .bak, .map, .lst, .def files. 
    2928 // 
    2929 // /b Note: This can also be supplied as /b"-clean" as an alias. 
    2930  
    2931 ///topic switches 
    2932 ///switch -LIBOPT 
    2933 ///desc Allows commandline options to be passed to the librarian. 
    2934 //Example: 
    2935 ///code 
    2936 //    (Set the page size to 32Kb) 
    2937 //    -LIBOPT-p32 
    2938 // 
    2939 //    (Embedded spaces enclosed in quotes.) 
    2940 //    "-LIBOPT -l -i" 
    2941 ///endcode 
    2942  
    2943 ///topic switches 
    2944 ///switch -R 
    2945 ///desc Determines if the compiler tools use a response file or not. 
    2946 //For /i DigitalMars tools in the Windows environment, a response file is 
    2947 // the default, but for /i other tools and other operating systems the 
    2948 // default is to use command line arguments. 
    2949 // 
    2950 //The switch has three formats: /n 
    2951 // -Ry to use a response file /n 
    2952 // -Rn to use command line arguments /n 
    2953 // -R to reverse the current setting. 
    2954 // 
    2955 //The use of a response file is only really needed when the command line 
    2956 //arguments are going to be more than the operating system can handle 
    2957 //on a single command line. However, it is always a safe option, so if 
    2958 //in doubt you may as well use it. 
    2959 // 
    2960 //A response file contains all the arguments that would have gone on the 
    2961 //command line. They are arranged as one argument per line. 
    2962 // 
    2963 //Not all tools respect the response file idea however the Windows based 
    2964 // DigitalMars tools do understand it. 
    2965 // 
    2966 // Without a response file the compiler might be invoked thus: 
    2967 ///code 
    2968 //  dmd -op -release appmain.d somemod.obj -IC:\DLibs 
    2969 ///endcode 
    2970 //But with a response file, these arguments are first written out to 
    2971 //a text file (the response file) and the compiler is invoked : 
    2972 ///code 
    2973 //  dmd @appmain.rsp 
    2974 ///endcode 
    2975 //The /i "appmain.rsp" would contain the lines : 
    2976 ///code 
    2977 //  -op 
    2978 //  -release 
    2979 //  appmain.d 
    2980 //  somemod.obj 
    2981 //  -IC:\DLibs 
    2982 ///endcode 
    2983  
    2984 ///topic switches 
    2985 ///switch -test 
    2986 ///desc Does a test run only. No compiling, linking or library work is done. 
    2987 //This will display the command lines instead of running them. It can be used 
    2988 //to see what would happen without actually building anything. 
    2989  
    2990 ///topic switches 
    2991 ///switch -RDF 
    2992 ///desc Defines a file to override the default /"Rule Definition File" 
    2993 //The default file is called "default.rdf". If you need to provide 
    2994 //an alternate file, you can use this switch. 
    2995 // 
    2996 //Example: 
    2997 ///code 
    2998 //    -RDFmyrules.xyz 
    2999 ///endcode 
    3000  
    3001 ///topic switches 
    3002 ///switch -dll 
    3003 ///desc Forces a DLL library to be created. 
    3004 ///b"Note:" This only applies to Windows environment. 
    3005 // 
    3006 //Normally, if /i build finds a DllMain() function it automatically 
    3007 // creates a DLL library. However, if you need to force a DLL 
    3008 // library, you would use this switch. 
    3009  
    3010 ///topic switches 
    3011 ///switch -gui 
    3012 ///desc Forces a GUI application to be created. 
    3013 ///b"Note:" This only applies to Windows environment. 
    3014 // 
    3015 //Normally, if /i build finds a WinMain() function it automatically 
    3016 // creates a GUI application. However, if you need to force a GUI 
    3017 // application, you would use this switch. 
    3018 // 
    3019 //This switch can also be used to specify which version of Windows to 
    3020 // build the application for. To do this, it takes the format of 
    3021 //-gui:X.Y where /i"X.Y" is the Windows version number. Use 4.0 
    3022 // for Windows NT, 2000, and ME, and 5.0 for Windows XP. 
    3023 // 
    3024 //By default, /i build uses the version of Windows it is running under. 
    3025  
    3026 ///topic switches 
    3027 ///switch -info 
    3028 ///desc Displays the version and path of the /i build application 
    3029  
    3030 ///topic switches 
    3031 ///switch -help 
    3032 ///desc Displays the full text of the Usage information. 
    3033 //This has the aliases of "-h" and "-?" 
    3034  
    3035 ///topic switches 
    3036 ///switch -silent 
    3037 ///desc Prevents unnecessary messages being displayed. 
    3038 //Some messages are just informational and under some circumstances they 
    3039 //can interfer with reading the output. 
    3040  
    3041 ///topic switches 
    3042 ///switch -X 
    3043 ///desc Identifies a module or package to ignore 
    3044 //Normally, /i build assumes that all imported modules are available 
    3045 //to be recompiled if required. You would use this switch if you explictly 
    3046 // did not want /i build to recompile a module. 
    3047 // 
    3048 ///b"Note:" The /i Phobos package of modules is automatically ignored. This 
    3049 // means that /i build does not try to recompile phobos. 
    3050 // 
    3051 //Example - ignore the 'parser' module (or package) 
    3052 ///code 
    3053 //      -Xparser 
    3054 ///endcode 
    3055  
    3056 ///topic switches 
    3057 ///switch -M 
    3058 ///desc Identifies a module or a package to notice (not ignore) 
    3059 //You would use this to name any module that is not part of the target's 
    3060 //dependancies, or is one of the /i ignored modules. 
    3061 // 
    3062 //You can use this switch to recompile /i phobos. 
    3063 // 
    3064 //Example (notice the Phobos package): 
    3065 ///code 
    3066 //  -Mphobos 
    3067 ///endcode 
    3068  
    3069 ///topic switches 
    3070 ///switch -T 
    3071 ///desc Identifies the target name to build. 
    3072 //Normally, /i build derives the target name from the first file name 
    3073 //on the command line, or from the pragma(target) if present. 
    3074 //If however, you wish to override that, use this switch. 
    3075 // 
    3076 ///b"Note:" This switch allows the use of a special token, /b"{Target}", 
    3077 //which is replaced by the default target name. You can use 
    3078 //to create a generic /"Response File" that can be used for building 
    3079 //any application. 
    3080 // 
    3081 //Example 
    3082 ///code 
    3083 //      -Ttestapp 
    3084 // 
    3085 //      -Ttest_(Target}  # Generate a name based on the default name. 
    3086 ///endcode 
    3087  
    3088 ///topic Response File 
    3089 ///info 
    3090 //A response file is a file that contains command line values. 
    3091 // 
    3092 //You can specify all or any command line values in a 
    3093 //response file. Each value appears in its own line in the 
    3094 //response file and you reference this file by prefixing 
    3095 //its name with an '@' symbol on the command line. 
    3096 // 
    3097 //You may place comments in a response file. A comment starts 
    3098 // with a /b'#' character and extends to the end of the line. 
    3099 // 
    3100 //Example: 
    3101 ///code 
    3102 //   build @final 
    3103 ///endcode 
    3104 //where a file called 'final.brf' contains the command 
    3105 //line values, including other response file references. 
    3106 // 
    3107 //Example: (contents of final.brf) 
    3108 ///code 
    3109 //    # This creates a production (release) edition of the app. 
    3110 //    -T{Target}_release  # Set the name of the executable. 
    3111 //    -release   # Don't generate runtime checks. 
    3112 //    -full      # Force compilation of all files. 
    3113 //    -cleanup   # remove work files when completed 
    3114 //    -inline    # Allow inlining to occur 
    3115 ///endcode 
    3116 // 
    3117 //The command line for your build could then look like ... 
    3118 ///code 
    3119 //    build myapp @final 
    3120 ///endcode 
    3121 // 
    3122 //If the response file reference is just a single '@' then 
    3123 // build looks for a file called 'build.brf' 
    3124 // 
    3125 //You can any number of response file references on a command line. They 
    3126 // are processed in the order they appear. 
    3127  
    3128  
    3129 ///topic To Do 
    3130 ///info 
    3131 //Ideas that have yet to be implemented. 
    3132 //Note that some of these may never be implemented but they are still 
    3133 //listed here as a reminder. 
    3134 // 
    3135 ///li Support the syntax "version(n)" 
    3136 ///li Be able to build a directory. 
    3137 //<ul> 
    3138 ///li If no source file is supplied on the command line, 
    3139 // build will scan the current folder looking for a source file 
    3140 // that contains 'main'. 
    3141 ///li If a directory name is supplied on the command line, 
    3142 // build will scan it looking for a source file that contains 'main'. 
    3143 //</ul> 
    3144 ///li Be able to supply multiple 'main' source files on command line. 
    3145 ///li Be able to update a library rather than just create libraries. 
    3146 ///li Support the concept of a 'Plugin' block of code. /n 
    3147 ///code 
    3148 // version (build) pragma(plugin, ~<tool>[,delim=xxx],[, ~<parms>] ) { [body] } 
    3149 ///endcode 
    3150 //This block would be replaced by the stdout data of calling 'tool ~<params>' and 
    3151 // sending it the content of ~<body> via stdin. 
    3152 ///li Support limited preprocessor capability. /n 
    3153 //Something like pragma(macro, ~<preprocessor commands>); and replacing 
    3154 //source text of the form @{tokenname}@ with the value of the token. 
    3155  
    3156 ///topic DLL Libraries 
    3157 ///info 
    3158 //How to create a DLL library using Build. 
    3159 //When Build finds a DllMain() function, or the -dll switch is used, it 
    3160 //creates a special type of Module Definition file, and sets the target to 
    3161 //to be a DLL file. The Module Definition file generated takes the form ... 
    3162 ///code 
    3163 //    LIBRARY "~<targetname>.dll"; 
    3164 //    EXETYPE NT 
    3165 //    SUBSYSTEM WINDOWS,~<version> 
    3166 //    CODE PRELOAD DISCARDABLE SHARED EXECUTE 
    3167 //    DATA PRELOAD SINGLE WRITE 
    3168 ///endcode 
    3169 // 
    3170 //You can replace any of these by explicitly coding a pragma(build_def) 
    3171 //with different options than these defaults shown here. 
    3172 // 
    3173 //Also, if you have the program /b implib in your path, it will be run 
    3174 //after the DLL file is created, in order to also create a /b".lib" 
    3175 //library to interface with the DLL. Build currently supports both the 
    3176 //DigitalMars version and the Borland (Inprise) version of /b implib. 
     2476 
     2477/* ============= The User Manual ====================================== 
     2478__ /topic Introduction 
     2479__ /info 
     2480__ This is a utility to build an application using the D programming language. 
     2481__ It does this by examining the source file supplied on the command line 
     2482__ to work out its dependant files, and then determines which need to be 
     2483__  compiled and which need to be linked to create the executable. 
     2484__ 
     2485__ Alternatively, it can be used to create a Library file rather than an 
     2486__  executable. 
     2487__ 
     2488__ The aim of the utility is to help remove the need for /i make files 
     2489__  or similar devices. 
     2490 
     2491__ /topic Pragma 
     2492__ /info 
     2493__ The /b build utility supports the use of various pragma statements. 
     2494__ A pragma is a special statement embedded in the source code that 
     2495__  provides information to tools reading the source code. 
     2496__ 
     2497__ They take the forms ... 
     2498__ /code 
     2499__       /b"pragma(" ~<name~> /b");" 
     2500__       /b"pragma(" ~<name~> /b"," ~<option~> [ /b","~<option~>] /b");" 
     2501__ /endcode 
     2502__ 
     2503__ If the D compiler doesn't recognise the pragma, it will fail. So to 
     2504__  'hide' them from the compiler, you need to wrap them in a /b version 
     2505__  block. All the pragmas used by this utility need to be enclosed in 
     2506__  a /i build version. 
     2507__ 
     2508__ Example: 
     2509__ /code 
     2510__       version(build) { pragma(nolink); } 
     2511__ /endcode 
     2512 
     2513__ /topic Pragma 
     2514__ /pragma link 
     2515__ /desc This nominates one or more libraries that are required to be linked in. 
     2516__ If your applications needs code from a library to be linked in, rather than 
     2517__  supplying source code, you can tell /i build which libraries are needed. 
     2518__ This can happen when using a library provided by a third-party. 
     2519__ 
     2520__ Example 1: 
     2521__ /code 
     2522__       /// This app needs the MyGUI.lib library to be used. 
     2523__       version(build) { pragma(link, MyGUI); } 
     2524__ /endcode 
     2525__ 
     2526__ Example 2: 
     2527__ /code 
     2528__       /// This app needs the a DB library and TCP library to be used. 
     2529__       version(build) { pragma(link, EuDB, TCP4Win); } 
     2530__ /endcode 
     2531 
     2532__ /topic Pragma 
     2533__ /pragma nolink 
     2534__ /desc This identifies that the current module is not to be be linked in. 
     2535__ Normally, each object file created by the compiler is linked in, but 
     2536__  if the supplied source file is just a stub for code which is externally 
     2537__  defined in a library, then you do not need the 'stub' object file. 
     2538__ 
     2539__ Example: 
     2540__ /code 
     2541__       version(build) { pragma(nolink); } 
     2542__ /endcode 
     2543 
     2544__ /topic Pragma 
     2545__ /pragma include 
     2546__ /desc This identifies a required file which is not otherwise imported. 
     2547__ In some applications, especially ones converted over from C, it is 
     2548__ possible that the file on the /i Build command line does not directly 
     2549__ or indirectly import a required file. In those situations, you can 
     2550__ use this pragma to tell build to include it in the compilation checking 
     2551__ process. 
     2552__ 
     2553__ Example: 
     2554__ /code 
     2555__       // Tell 'build' that prime.d must be included (it contains the main function.) 
     2556__       version(build) { pragma(include, "prime"); } 
     2557__ /endcode 
     2558 
     2559__ /topic Pragma 
     2560__ /pragma target 
     2561__ /desc This identifies the basename of the target file. 
     2562__ By default, the target name is based on the first file on the command line. 
     2563__ But if you include this pragma, the name identified in the pragma becomes 
     2564__ the default name. In either case, the -T switch overrides the default name. 
     2565__ 
     2566__  If two or more /i target pragmas are found, the first one is the one 
     2567__  that is used and the others are ignored (though mentioned if in 
     2568__  verbose mode). 
     2569__ Example: 
     2570__ /code 
     2571__       //// Tell 'build' to create WhizzBang.exe 
     2572__       version(build) { pragma(target, "WhizzBang"); } 
     2573__ /endcode 
     2574 
     2575__ /topic Pragma 
     2576__ /pragma build 
     2577__ /desc This identifies a file that needs an external program to build it. 
     2578__ Some applications need to link in object files created by C source, or 
     2579__ by a /i resource compiler, or whatever. This pragma identifies a file 
     2580__ that needs to be linked in, but cannot be created by the D compiler. The 
     2581__ format is /n 
     2582__ /code 
     2583__     pragma(build, "FILENAME" [, "OPTIONS"] ...); 
     2584__ /endcode 
     2585__ where /i FILENAME is either the file to link in, or the file to use when 
     2586__ creating the file to link in. For example, if you had a Windows resource file 
     2587__ that needed to be compiled, you could code the pragma as either ... 
     2588__ 
     2589__ /code 
     2590__     //// Compile the images into a resource obj and add images.res to linker. 
     2591__     pragma(build, "images.rc"); 
     2592__ /endcode 
     2593__ or /n 
     2594__ /code 
     2595__     //// Compile the images into a resource obj and add images.res to linker. 
     2596__     pragma(build, "images.res"); 
     2597__ /endcode 
     2598__ 
     2599__ The first example specifies the source file to be passed to the resource 
     2600__ compiler and the second example specifies the output of the resource compiler. 
     2601__ In either case, this utility uses the rules in a /"Rule Definition File" to 
     2602__ decide what to do. 
     2603__ 
     2604__ The utility searches for the /i"FILENAME" in the currently defined 'import' 
     2605__ paths. 
     2606__ 
     2607__ The /i OPTIONS can be included if you need to pass any special values 
     2608__ to the external tool. There can be any number of these, but each one must 
     2609__ take the form ~<KEYWORD>=~<VALUE>. For example /n 
     2610__ /code 
     2611__       pragma(build, "dbapi.c", "COPT=-wc -x", "HDR=abc.hp"); 
     2612__ /endcode 
     2613__ The OPTIONS values are used as replacement text for token in the 
     2614__ Rule Definition File's 'tool' specification. In the example above, 
     2615__ the tokens {COPT} and {HDR}, if found in the 'tool' line, would be 
     2616__ replaced with /i"-wc -x" and /i"abc.hp" respectively. 
     2617__ 
     2618__ The output file to the external tool is checked to see if it is still 
     2619__ up to date. 
     2620__ 
     2621__ The output file from the external tool is added to the linkage set. 
     2622__ 
     2623__ All such external programs are run before the D compiler is invoked. 
     2624__ 
     2625__ Example: 
     2626__ /code 
     2627__       //// Tell 'build' that it needs to call an external program 
     2628__       //// to build an up-to-date version of 'images.rc' 
     2629__       version(build) { pragma(build, "images.rc"); } 
     2630__ /endcode 
     2631 
     2632__ /topic Rule Definition File 
     2633__ /info 
     2634__ Defines the rules used to build non-D source files. 
     2635__ This is not as advanced as the typical /b makefile abilities and is 
     2636__ only useful for simple situations. Specifically, it only caters for 
     2637__ applications that take a single input file to create the required 
     2638__ output file. 
     2639__ 
     2640__ The default Rule Definition File is called "default.rdf". It is found by 
     2641__ first looking in the directory where the utility is installed, and if 
     2642__ it is not found there, the directories in the PATH environment symbol 
     2643__ are scanned. 
     2644__ 
     2645__ The default RDF can be overridden by the -RDF command line switch. 
     2646__ 
     2647__ Each rule is defined in a set of four mandatory lines ... /n 
     2648__ /li rule=~<name> 
     2649__ /li source=~<extention> 
     2650__ /li target=~<extention> 
     2651__ /li tool=~<command pattern> 
     2652__ 
     2653__ Any other line in the file, not starting with one of the above keywords 
     2654__ is simply ignored (treated as comments). 
     2655__ 
     2656__ The /i"tool" line can contain special tokens. These are keywords enclosed 
     2657__ in braces. At compile time, the tokens are replaced by replacement text 
     2658__ taken from the pragma(build) statement. There are two predefined tokens 
     2659__ that can be used. /b"{@IN}" is replaced by the name of the input file, 
     2660__ and /b"{@OUT}" is replaced by the name of the output file. 
     2661__ 
     2662__ /code 
     2663__  ----- Windows Resource Compiler ----- 
     2664__  This uses ` pragma(/b'build', ~<sourcefile>.rc); ` 
     2665__  ------------------------------------- 
     2666__  rule=Resources 
     2667__  source=rc 
     2668__  target=res 
     2669__ tool=rc //r {@IN} //fo {@OUT} 
     2670__ 
     2671__  ------------------------------------- 
     2672__  DMD C linkage 
     2673__  This uses ` pragma(build, ~<sourcefile>.c, "COPT=~<options>", "HDR=~<whatever>"); ` 
     2674__  ------------------------------------- 
     2675__ rule=DMD C/C++ 
     2676__  source=c 
     2677__  target=obj 
     2678__  tool=dmc -c {COPT} {@IN} -o{@OUT} {HDR} 
     2679__ 
     2680__ /endcode 
     2681 
     2682__ /topic Pragma 
     2683__ /pragma build_def 
     2684__ /desc This supplies an option to be placed in an OptLink definition file. 
     2685__ You can have /i build create a customised OptLink definition file 
     2686__ by coding as many /i build_def pragmas as required. However, /i build will 
     2687__ only allow the first of each type of Definition File command to be used. THis 
     2688__ means that if you code ... /n 
     2689__ /code 
     2690__       pragma (build_def, "EXETYPE DOS"); 
     2691__       pragma (build_def, "EXETYPE NT"); 
     2692__ /endcode 
     2693__ Then the EXETYPE DOS will be used and the 'NT' line ignored. You can use 
     2694__ explicit build_def pragmas to override the default ones generated by 
     2695__  /i build for Windows programs or DLL libraries. 
     2696__ 
     2697__ The syntax for these pragma is /n 
     2698__ /code 
     2699__           pragma(build_def, ~<QUOTED_STRING~> ); 
     2700__ /endcode 
     2701__ 
     2702__ Example: 
     2703__ /code 
     2704__   version(build) { 
     2705__     pragma (build_def, "VERSION 1.1"); 
     2706__     version(DOS) { 
     2707__       pragma (build_def, "EXETYPE DOS"); 
     2708__     } 
     2709__     version(WIN) { 
     2710__       pragma (build_def, "EXETYPE NT"); 
     2711__       pragma (build_def, "SUBSYSTEM WINDOWS,4.0"); 
     2712__     } 
     2713__   } 
     2714__ /endcode 
     2715__ 
     2716__ You can supply /b any text string and it is used verbatim. There is no 
     2717__  restrictions on what you can include in the pragma. 
     2718 
     2719__ /topic Auto Build Number 
     2720__ /info 
     2721__ Automatically Incremented Build Numbering for Modules 
     2722__ You can optionally specify that the /i build utility automatically 
     2723__ increments a build number for any module. You do this by supplying 
     2724__  a single line in your source code in the form ... /n 
     2725__ /code 
     2726__       private import /b"~<modulename~>"_bn; 
     2727__ /endcode 
     2728__ Typically this line is placed immediately after the source file's 
     2729__ /b module statement, but that is not strictly necessary. 
     2730__ 
     2731__ By having this line in your code, /i build then uses a file with the 
     2732__  suffix "_bn.d" to maintain 
     2733__ the current build number for the ~<modulename~>. Note that /i build 
     2734__  will create this file if it doesn't exist. Also note that 
     2735__  /i build will update this file whenever the module file has been 
     2736__  updated or its object file needs to be rebuilt, so you really 
     2737__ shouldn't modify it manually. Any manual changes will be deleted 
     2738__  by /i build. /n 
     2739__ 
     2740__ Example: /n 
     2741__ If your module is called "parser.d" you would have the lines ... 
     2742__ /code 
     2743__   module parser; 
     2744__   private import parser_bn; 
     2745__ /endcode 
     2746__ 
     2747__ You can access the build number from within the module thus ... /n 
     2748__ 
     2749__ /code 
     2750__           writefln("Build number is %d", auto_build_number); 
     2751__ /endcode 
     2752__ You can access the build numbers of other modules in you application 
     2753__  by importing the appropriate file and prefixing the references with 
     2754__  the module names. /n 
     2755__ Example: 
     2756__ /code 
     2757__       module parser;  /// This module's name. 
     2758__       private import parser_bn;   /// This module's B/N 
     2759__       private import tokenizer_bn; /// Another module's B/N 
     2760__       . . . 
     2761__       writefln("Builds..."); 
     2762__       writefln("  Parser %d", parser_bn.auto_build_number); 
     2763__       writefln("  Tokens %d", tokenizer_bn.auto_build_number); 
     2764__ /endcode 
     2765__ 
     2766__ The "_bn.d" file created by /i build for this module would look like ... /n 
     2767__ /code 
     2768__   module parser_bn; 
     2769__   /// This file is automatically maintained by the BUILD utility, 
     2770__   /// Please refrain from manually editing it. 
     2771__   long auto_build_number = 77; 
     2772__ /endcode 
     2773__ Of course the number /i 77 is just an example. This number would actually 
     2774__  start at 1 and increment whenever /i build needed to create a new object 
     2775__ file for the module. 
     2776 
     2777__ /topic Command Line 
     2778__ /info 
     2779__ The /i build utility supplies the source file and optional switches via the command line. 
     2780__ The typical format of the /i build utility's command line is ... /n 
     2781__ /code 
     2782__       /b build ~<sourcefile~> [ ~<switches~> ] [ ~<otherfiles~> ] 
     2783__ /endcode 
     2784__ You can however specify the files and switches in any order you like. 
     2785__ 
     2786__ Normally you would only supply a single file name to /i build, that being 
     2787__  the source file of the top-level file in the application. Typically 
     2788__  the one that has the 'main()' or 'WinMain()' function, though this is 
     2789__  not strictly necessary. 
     2790__ 
     2791__ If you run the utility without any files and without any switches, it 
     2792__  display a /i help screen with some details about the switches. That looks 
     2793__  like this ... 
     2794__ /code 
     2795__   Path and Version : C:\Program Files\build.exe v3.6(339) 
     2796__   Usage: build sourcefile [options objectfiles libraries] 
     2797__     /b sourcefile D source file 
     2798__     /b"-v"         Verbose (passed through to D) 
     2799__     /b"-V"         Verbose (NOT passed through) 
     2800__     /b"-names"     Displays the names of the files used to build the target. 
     2801__     /b"-DCPATH~<path~> ~<path~>" is where the compiler has been installed. 
     2802__                Only needed if the compiler is not in the system's 
     2803__                PATH list. Used if you are testing an alternate 
     2804__                version of the compiler. 
     2805__     /b"-CFPATH~<path~> ~<path~>" is where the D config file has been installed. 
     2806__     /b"-full"      Causes all source files, except ignored modules, 
     2807__                 to be compiled. 
     2808__     /b"-link"      Forces the linker to be called instead of the librarian. 
     2809__                 (Only needed if the source files do not contain 
     2810__                  main/WinMain) 
     2811__     /b"-nolink"    Ensures that the linker is not called. 
     2812__                 (Only needed if main/WinMain is found in the source 
     2813__                  files and you do NOT want an executable created.) 
     2814__     /b"-lib"       Forces the object files to be placed in a library. 
     2815__                 (Only needed if main/WinMain is found in the source 
     2816__                  files AND you want it in a library instead of 
     2817__                  an executable.) 
     2818__     /b"-nolib"     Ensures that the object files are not used to form 
     2819__                 a library. 
     2820__                 (Only needed if main/WinMain is not found in the source 
     2821__                  files and you do NOT want a library. 
     2822__     /b"-obj"       This is the same as having both -nolink and -nolib 
     2823__                 switches on the command line. It is just a shorthand. 
     2824__     /b"-allobj"    Ensures that all object files are added to a 
     2825__                 library. 
     2826__                 (Normally only those in the same directory are added.) 
     2827__     /b"-cleanup"   Ensures that all object files created during the run 
     2828__                 are removed at the end of the run, plus other work files. 
     2829__     /b"-clean"     Same as -cleanup 
     2830__     /b"-test"      Does everything as normal except it displays the commands 
     2831__                   instead of running them. Also, the auto-build-numbers are 
     2832__                   not incremented. 
     2833__     /b"-RDF~<path~>"  Overrides the default Rule Definition File 
     2834__     /b"-gui[:x.y]" Forces a GUI application to be created. The optional 
     2835__                 :x.y can be used to build an application for a 
     2836__                 specific version of Windows. eg. -gui:4.0 
     2837__                 (Only needed if WinMain is not found in the source files 
     2838__                 or if you wish to override the default Windows version) 
     2839__     /b"-dll"       Forces a DLL library to be created. 
     2840__                       (Only needed if DllMain is not found in the source files. 
     2841__     /b"-LIBOPT~<opt~>" Allows you to pass ~<opt~> to the librarian 
     2842__     /b"-X~<module~>" Packages and Modules to ignore (eg. -Xmylib) 
     2843__     /b"-M~<module~>" Packages and Modules to notice (eg. -Mphobos) 
     2844__     /b"-T~<targetname~>" The name of the target file to create. Normally 
     2845__                 the target name istaken from the first or only name 
     2846__                 of the command line. 
     2847__     /b"-R~<y|n~>" Indicates whether to use a response file or command line 
     2848__                    arguments with the compiler tools. 
     2849__                  /b"-Ry" will cause a response to be used. 
     2850__                  /b"-Rn" will cause command line arguments to be used. 
     2851__                  /b"-R" will reverse the current usage. 
     2852__                   Note that the default for Windows DigitalMars is to use a response file 
     2853__                   but for all other environments it is to use command line arguments. 
     2854__     /b"-info"      Displays the version and path of the Build application 
     2855__     /b"-help"      Displays the full 'usage' help text. 
     2856__     /b"-h"         Same as /-help, displays the full 'usage' help text. 
     2857__     /b"-?   "      Same as /-help, displays the full 'usage' help text. 
     2858__     /b"-silent"    Avoids unnecessary messages being displayed. 
     2859__     /b"[...]"      All other options, objectfiles and libraries are 
     2860__                 passed to the compiler 
     2861__ /endcode 
     2862__ 
     2863__ See also /"Response File" 
     2864 
     2865__ /topic Switches 
     2866__ /info 
     2867__ /i Build supports a number of command line switches to control its default assumptions. 
     2868 
     2869 
     2870__ /topic switches 
     2871__ /switch -v 
     2872__ /desc Set /i verbose mode on for both /i build and for the compiler 
     2873 
     2874__ /topic switches 
     2875__ /switch -V 
     2876__ /desc Set /i verbose mode on for just /i build and not for the compiler 
     2877 
     2878__ /topic switches 
     2879__ /switch -names 
     2880__ /desc Displays the names of the files used in building the target. 
     2881 
     2882__ /topic switches 
     2883__ /switch -DCPATH 
     2884__ /desc  Identifies where the compiler has been installed. 
     2885__ Normally, /i build scans the PATH environment symbol to find where the 
     2886__  D compiler is located. However, if you need to use the compiler from 
     2887__  a different location, you would use this switch to tell /i build where 
     2888__  it is. 
     2889__ 
     2890__ /b"Note:" If you use this switch, and the current CFPATH value is 
     2891__ identical to the current DCPATH value, then this switch will change 
     2892__ both to the new value. The assumption is that the configuration 
     2893__ file is in the same directory as the compiler. If this is not the case, 
     2894__ you will also need to use the /-CFPATH switch. 
     2895__ 
     2896__ Example: 
     2897__ /code 
     2898__   -DCPATHc:\old\dmd\bin 
     2899__ /endcode 
     2900 
     2901__ /topic switches 
     2902__ /switch -CFPATH 
     2903__ /desc Identifies where the D config file has been installed. 
     2904__ Normally, /i build looks in the same place that the compiler is 
     2905__  installed in, but if you need to use a different configuration 
     2906__  path from that, you would use this switch to tell /i build where 
     2907__  it is. 
     2908__ 
     2909__ Example: 
     2910__ /code 
     2911__   -CFPATHc:\myproject\configs 
     2912__ /endcode 
     2913 
     2914__ /topic switches 
     2915__ /switch -full 
     2916__ /desc Causes all source files, except ignored modules, to be compiled. 
     2917__ Normally, /i build only compiles a source file if it's object file 
     2918__ is out of date or missing. This switch forces all source files to be 
     2919__  recompiled, even if not strictly required. 
     2920__ 
     2921__ /b "Note:" Modules in the /i ignore list are still ignored though. 
     2922 
     2923__ /topic switches 
     2924__ /switch -link 
     2925__ /desc Forces the linker to be called instead of the librarian. 
     2926__ Normally, if /i build does not find a main() or WinMain() function 
     2927__  in the source files, it creates a library to contain the object 
     2928__ files. But when this switch is used, /i build will attempt to 
     2929__  create an application by calling the linker rather than the librarian. 
     2930__ 
     2931__ You would typically use this if the main() function was being supplied 
     2932__ from an existing library file rather than one you your source files. 
     2933 
     2934__ /topic switches 
     2935__ /switch -nolink 
     2936__ /desc  Ensures that the linker is not called. 
     2937__ Normally, if /i build finds a main() or WinMain() function, it 
     2938__ tries to create an application by calling the linker. If you use 
     2939__  this switch however, the linker will not be called. 
     2940__ 
     2941__ You would typically do this if you wanted to create a library that 
     2942__ stores your 'main' function in it, in which case you'd also use the /-lib 
     2943__  switch. But you could just create a set of object files without linking 
     2944__  them with this switch. 
     2945 
     2946__ /topic switches 
     2947__ /switch -lib 
     2948__ /desc Forces the object files to be placed in a library. 
     2949__ Normally, if /i build finds a main() or WinMain() function, it 
     2950__ tries to create an application by calling the linker. But if you 
     2951__  use this switch, the librarian is called instead of the linker. 
     2952__ 
     2953__ You would typically do this if you wanted to create a library that 
     2954__ stores your 'main' function in it, in which case you'd also use the /-nolink 
     2955__ switch. 
     2956 
     2957__ /topic switches 
     2958__ /switch -obj 
     2959__ /desc Shorthand for using both /"-nolink" and /"-nolib" switches. 
     2960__ This is literally the same has if you had placed both -nolink and 
     2961__ -nolib on the command line. As this is a common way to just compile 
     2962__ modules to get the object files for them, without doing anything else, 
     2963__ a neat shorthand is available. 
     2964 
     2965__ /topic switches 
     2966__ /switch -nolib 
     2967__ /desc Ensures that the object files are not used to form a library. 
     2968__ Normally, if /i build does not find a main() or WinMain() function, 
     2969__  it calls the librarian to create a library for all your object files. 
     2970__ But if you use this switch, the librarian is not called. 
     2971__ 
     2972__ Typically, you would do this if you just wanted to create one or more 
     2973__  object files and do nothing else. 
     2974 
     2975__ /topic switches 
     2976__ /switch -allobj 
     2977__ /desc Ensures that all object files are added to a library. 
     2978__ Normally, /i build will only create a library using the object files 
     2979__  that are in the same directory as the new library. You would use 
     2980__  this switch if you wanted all object files created by this build 
     2981__ session to be included in the library. 
     2982 
     2983__ /topic switches 
     2984__ /switch -cleanup 
     2985__ /desc Ensures that all working files created during the run are removed. 
     2986__ Normally, /i build does not delete any object files or working files 
     2987__ when it finishes a session. You can use this switch to have /i build 
     2988__  clean up after itself. This will remove all object files created 
     2989__  in this run, plus any .rsp, .lsp, .bak, .map, .lst, .def files. 
     2990__ 
     2991__  /b Note: This can also be supplied as /b"-clean" as an alias. 
     2992 
     2993__ /topic switches 
     2994__ /switch -LIBOPT 
     2995__ /desc Allows commandline options to be passed to the librarian. 
     2996__ Example: 
     2997__ /code 
     2998__     (Set the page size to 32Kb) 
     2999__     -LIBOPT-p32 
     3000__ 
     3001__     (Embedded spaces enclosed in quotes.) 
     3002__     "-LIBOPT -l -i" 
     3003__ /endcode 
     3004 
     3005__ /topic switches 
     3006__ /switch -R 
     3007__ /desc Determines if the compiler tools use a response file or not. 
     3008__ For /i DigitalMars tools in the Windows environment, a response file is 
     3009__  the default, but for /i other tools and other operating systems the 
     3010__  default is to use command line arguments. 
     3011__ 
     3012__ The switch has three formats: /n 
     3013__  -Ry to use a response file /n 
     3014__  -Rn to use command line arguments /n 
     3015__  -R to reverse the current setting. 
     3016__ 
     3017__ The use of a response file is only really needed when the command line 
     3018__ arguments are going to be more than the operating system can handle 
     3019__ on a single command line. However, it is always a safe option, so if 
     3020__ in doubt you may as well use it. 
     3021__ 
     3022__ A response file contains all the arguments that would have gone on the 
     3023__ command line. They are arranged as one argument per line. 
     3024__ 
     3025__ Not all tools respect the response file idea however the Windows based 
     3026__  DigitalMars tools do understand it. 
     3027__ 
     3028__  Without a response file the compiler might be invoked thus: 
     3029__ /code 
     3030__   dmd -op -release appmain.d somemod.obj -IC:\DLibs 
     3031__ /endcode 
     3032__ But with a response file, these arguments are first written out to 
     3033__ a text file (the response file) and the compiler is invoked : 
     3034__ /code 
     3035__   dmd @appmain.rsp 
     3036__ /endcode 
     3037__ The /i "appmain.rsp" would contain the lines : 
     3038__ /code 
     3039__   -op 
     3040__   -release 
     3041__   appmain.d 
     3042__   somemod.obj 
     3043__   -IC:\DLibs 
     3044__ /endcode 
     3045 
     3046__ /topic switches 
     3047__ /switch -test 
     3048__ /desc Does a test run only. No compiling, linking or library work is done. 
     3049__ This will display the command lines instead of running them. It can be used 
     3050__ to see what would happen without actually building anything. 
     3051 
     3052__ /topic switches 
     3053__ /switch -RDF 
     3054__ /desc Defines a file to override the default /"Rule Definition File" 
     3055__ The default file is called "default.rdf". If you need to provide 
     3056__ an alternate file, you can use this switch. 
     3057__ 
     3058__ Example: 
     3059__ /code 
     3060__     -RDFmyrules.xyz 
     3061__ /endcode 
     3062 
     3063__ /topic switches 
     3064__ /switch -dll 
     3065__ /desc Forces a DLL library to be created. 
     3066__ /b"Note:" This only applies to Windows environment. 
     3067__ 
     3068__ Normally, if /i build finds a DllMain() function it automatically 
     3069__  creates a DLL library. However, if you need to force a DLL 
     3070__  library, you would use this switch. 
     3071 
     3072__ /topic switches 
     3073__ /switch -gui 
     3074__ /desc Forces a GUI application to be created. 
     3075__ /b"Note:" This only applies to Windows environment. 
     3076__ 
     3077__ Normally, if /i build finds a WinMain() function it automatically 
     3078__  creates a GUI application. However, if you need to force a GUI 
     3079__  application, you would use this switch. 
     3080__ 
     3081__ This switch can also be used to specify which version of Windows to 
     3082__  build the application for. To do this, it takes the format of 
     3083__ -gui:X.Y where /i"X.Y" is the Windows version number. Use 4.0 
     3084__  for Windows NT, 2000, and ME, and 5.0 for Windows XP. 
     3085__ 
     3086__ By default, /i build uses the version of Windows it is running under. 
     3087 
     3088__ /topic switches 
     3089__ /switch -info 
     3090__ /desc Displays the version and path of the /i build application 
     3091 
     3092__ /topic switches 
     3093__ /switch -help 
     3094__ /desc Displays the full text of the Usage information. 
     3095__ This has the aliases of "-h" and "-?" 
     3096 
     3097__ /topic switches 
     3098__ /switch -silent 
     3099__ /desc Prevents unnecessary messages being displayed. 
     3100__ Some messages are just informational and under some circumstances they 
     3101__ can interfer with reading the output. 
     3102 
     3103__ /topic switches 
     3104__ /switch -X 
     3105__ /desc Identifies a module or package to ignore 
     3106__ Normally, /i build assumes that all imported modules are available 
     3107__ to be recompiled if required. You would use this switch if you explictly 
     3108__  did not want /i build to recompile a module. 
     3109__ 
     3110__ /b"Note:" The /i Phobos package of modules is automatically ignored. This 
     3111__  means that /i build does not try to recompile phobos. 
     3112__ 
     3113__ Example - ignore the 'parser' module (or package) 
     3114__ /code 
     3115__       -Xparser 
     3116__ /endcode 
     3117 
     3118__ /topic switches 
     3119__ /switch -M 
     3120__ /desc Identifies a module or a package to notice (not ignore) 
     3121__ You would use this to name any module that is not part of the target's 
     3122__ dependancies, or is one of the /i ignored modules. 
     3123__ 
     3124__ You can use this switch to recompile /i phobos. 
     3125__ 
     3126__ Example (notice the Phobos package): 
     3127__ /code 
     3128__   -Mphobos 
     3129__ /endcode 
     3130 
     3131__ /topic switches 
     3132__ /switch -T 
     3133__ /desc Identifies the target name to build. 
     3134__ Normally, /i build derives the target name from the first file name 
     3135__ on the command line, or from the pragma(target) if present. 
     3136__ If however, you wish to override that, use this switch. 
     3137__ 
     3138__ /b"Note:" This switch allows the use of a special token, /b"{Target}", 
     3139__ which is replaced by the default target name. You can use 
     3140__ to create a generic /"Response File" that can be used for building 
     3141__ any application. 
     3142__ 
     3143__ Example 
     3144__ /code 
     3145__       -Ttestapp 
     3146__ 
     3147__       -Ttest_(Target}  # Generate a name based on the default name. 
     3148__ /endcode 
     3149 
     3150__ /topic Response File 
     3151__ /info 
     3152__ A response file is a file that contains command line values. 
     3153__ 
     3154__ You can specify all or any command line values in a 
     3155__ response file. Each value appears in its own line in the 
     3156__ response file and you reference this file by prefixing 
     3157__ its name with an '@' symbol on the command line. 
     3158__ 
     3159__ You may place comments in a response file. A comment starts 
     3160__  with a /b'#' character and extends to the end of the line. 
     3161__ 
     3162__ Example: 
     3163__ /code 
     3164__    build @final 
     3165__ /endcode 
     3166__ where a file called 'final.brf' contains the command 
     3167__ line values, including other response file references. 
     3168__ 
     3169__ Example: (contents of final.brf) 
     3170__ /code 
     3171__     # This creates a production (release) edition of the app. 
     3172__     -T{Target}_release  # Set the name of the executable. 
     3173__     -release   # Don't generate runtime checks. 
     3174__     -full      # Force compilation of all files. 
     3175__     -cleanup   # remove work files when completed 
     3176__     -inline    # Allow inlining to occur 
     3177__ /endcode 
     3178__ 
     3179__ The command line for your build could then look like ... 
     3180__ /code 
     3181__     build myapp @final 
     3182__ /endcode 
     3183__ 
     3184__ If the response file reference is just a single '@' then 
     3185__  build looks for a file called 'build.brf' 
     3186__ 
     3187__ You can any number of response file references on a command line. They 
     3188__  are processed in the order they appear. 
     3189 
     3190 
     3191__ /topic To Do 
     3192__ /info 
     3193__ Ideas that have yet to be implemented. 
     3194__ Note that some of these may never be implemented but they are still 
     3195__ listed here as a reminder. 
     3196__ 
     3197__ /li Support the syntax "version(n)" 
     3198__ /li Be able to build a directory. 
     3199__ <ul> 
     3200__ /li If no source file is supplied on the command line, 
     3201__  build will scan the current folder looking for a source file 
     3202__  that contains 'main'. 
     3203__ /li If a directory name is supplied on the command line, 
     3204__  build will scan it looking for a source file that contains 'main'. 
     3205__ </ul> 
     3206__ /li Be able to supply multiple 'main' source files on command line. 
     3207__ /li Be able to update a library rather than just create libraries. 
     3208__ /li Support the concept of a 'Plugin' block of code. /n 
     3209__ /code 
     3210__  version (build) pragma(plugin, ~<tool>[,delim=xxx],[, ~<parms>] ) { [body] } 
     3211__ /endcode 
     3212__ This block would be replaced by the stdout data of calling 'tool ~<params>' and 
     3213__  sending it the content of ~<body> via stdin. 
     3214__ /li Support limited preprocessor capability. /n 
     3215__ Something like pragma(macro, ~<preprocessor commands>); and replacing 
     3216__ source text of the form @{tokenname}@ with the value of the token. 
     3217 
     3218__ /topic DLL Libraries 
     3219__ /info 
     3220__ How to create a DLL library using Build. 
     3221__ When Build finds a DllMain() function, or the -dll switch is used, it 
     3222__ creates a special type of Module Definition file, and sets the target to 
     3223__ to be a DLL file. The Module Definition file generated takes the form ... 
     3224__ /code 
     3225__     LIBRARY "~<targetname>.dll"; 
     3226__     EXETYPE NT 
     3227__     SUBSYSTEM WINDOWS,~<version> 
     3228__     CODE PRELOAD DISCARDABLE SHARED EXECUTE 
     3229__     DATA PRELOAD SINGLE WRITE 
     3230__ /endcode 
     3231__ 
     3232__ You can replace any of these by explicitly coding a pragma(build_def) 
     3233__ with different options than these defaults shown here. 
     3234__ 
     3235__ Also, if you have the program /b implib in your path, it will be run 
     3236__ after the DLL file is created, in order to also create a /b".lib" 
     3237__ library to interface with the DLL. Build currently supports both the 
     3238__ DigitalMars version and the Borland (Inprise) version of /b implib. 
     3239*/ 
  • trunk/Source/build_bn.d

    r34 r35  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 839
     4long auto_build_number = 856
  • trunk/Source/source_bn.d

    r34 r35  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 629
     4long auto_build_number = 646
  • trunk/Source/util/bmscanner_bn.d

    r34 r35  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 249; 
     4long auto_build_number = 319; 
  • trunk/Source/util/fdt_bn.d

    r34 r35  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 451
     4long auto_build_number = 468
  • trunk/Source/util/fileex_bn.d

    r34 r35  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 394
     4long auto_build_number = 411
  • trunk/Source/util/linetoken_bn.d

    r34 r35  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 318
     4long auto_build_number = 335
  • trunk/Source/util/pathex_bn.d

    r34 r35  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 474
     4long auto_build_number = 491
  • trunk/Source/util/str_bn.d

    r34 r35  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 446
     4long auto_build_number = 463