| 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 | */ |
|---|
| 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 | */ |
|---|