Changeset 254

Show
Ignore:
Timestamp:
04/14/07 22:40:20 (1 year ago)
Author:
aldacron
Message:

[General]
* all console output from the build script is now prefixed with '[BuildMe?]' in order to distinguish from toolchain output.
[Docs]
* added to build.html a section about the new install script
* adjusted the background of pre tags to make them more distinguishable from some of the headers

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/buildme.d

    r253 r254  
    161161void cleanLib() 
    162162{ 
    163     printf("Deleting all %s files from the lib subdirectory...\n", toCString(libExt)); 
     163    printf("[BuildMe] Deleting all %s files from the lib subdirectory...\n", toCString(libExt)); 
    164164    execute(delCmd ~ "lib" ~ pathSep ~ "*" ~ libExt); 
    165     printf("Finished!\n\n"); 
     165    printf("[BuildMe] Finished!\n\n"); 
    166166} 
    167167 
     
    193193    void scanForPackages() 
    194194    { 
    195         printf("\nScanning for buildable packages...\n\n"); 
     195        printf("\n[BuildMe] Scanning for buildable packages...\n\n"); 
    196196 
    197197        // cycle through every Derelict directory to find buildable packages 
     
    210210        } 
    211211 
    212         printf("Finished!\n\n"); 
     212        printf("[BuildMe] Finished!\n\n"); 
    213213    } 
    214214 
     
    218218        if(findStr(packageName, "Derelict") != 0) 
    219219        { 
    220             printf("Nothing to do for directory \'%s\'\n", toCString(packageName)); 
     220            printf("[BuildMe] Nothing to do for directory \'%s\'\n", toCString(packageName)); 
    221221        } 
    222222        else 
     
    246246 
    247247        // create the temporary brf 
    248         printf("Preparing to build package %s in %s mode...\n", toCString(packageName), toCString(modeToString())); 
     248        printf("[BuildMe] Preparing to build package %s in %s mode...\n", toCString(packageName), toCString(modeToString())); 
    249249        if(!createBRF(packageName, path)) 
    250250            return false; 
    251251 
    252252        // call out to build with the name of the temp brf as an arg 
    253         printf("Building %s...\n", toCString(packageName)); 
     253        printf("[BuildMe] Building %s...\n", toCString(packageName)); 
    254254        if(execute(_name ~ " @" ~ _tempBRFName) != 0) 
    255255        { 
     
    260260        { 
    261261            // delete the temporary brf 
    262             printf("Deleting temporary Build Response File...\n\n"); 
     262            printf("[BuildMe] Deleting temporary Build Response File...\n\n"); 
    263263            execute(delCmd ~ _tempBRFName); 
    264264        } 
     
    279279    bool createBRF(char[] packageName, char[] path) 
    280280    { 
    281         printf("Reading build tool arguments...\n"); 
     281        printf("[BuildMe] Reading build tool arguments...\n"); 
    282282 
    283283        char[] txt;         // holds the contents of the forbud file 
     
    289289        if(txt is null) 
    290290        { 
    291             printf("Could not find %s\n", toCString(path)); 
     291            printf("[BuildMe] Could not find %s\n", toCString(path)); 
    292292            return false; 
    293293        } 
     
    313313 
    314314        // write the temporary brf to disk 
    315         printf("Creating temporary Build Response File...\n"); 
     315        printf("[BuildMe] Creating temporary Build Response File...\n"); 
    316316 
    317317        writeFile(_tempBRFName, brf); 
  • trunk/docs/build.html

    r251 r254  
    11<html lang="en"> 
    22<head> 
    3    <title>Building Derelict</title> 
    4    <link rel="stylesheet" type="text/css" href="styles.css"> 
     3    <title>Building Derelict</title> 
     4    <link rel="stylesheet" type="text/css" href="styles.css"> 
    55</head> 
    66<body> 
     
    2828</p> 
    2929 
    30 <div class="important">Derelict has built-in support for  
    31 <a href="http://www.dsource.org/projects/tango">Tango</a>. but currently the 
    32 build script cannot be executed in a Tango-enabled environment. If you need to 
    33 use Derelict with Tango, you must do so using the method recommended above (with 
    34 Bud or Rebuild).</div> 
    35  
    36 <h3>Requirements</h3> 
    37 Currently, the build script requires that <a href="http://www.dsource.org/projects/build"> 
    38 Bud</a> be on your PATH. If it is not, the script will fail. 
    39  
    40 <h3>Execution</h3> 
    41 To execute the build script, cd to $DERELICT_HOME and use one of the following 
    42 command lines: 
     30<h3>Setting Up An Import Directory</h3> 
     31Whether you run the build script or not, when you compile applications using 
     32Derelict you need to let the compiler know where it can find the Derelict source 
     33modules. The directory tree of the Derelict distribution is designed to for ease 
     34of maintenance. Each package is clearly segregated into its own directory. Because 
     35of this structure, when compiling a Derelict application you have to pass the path 
     36to each package you use to the compiler. For example, if building an app using 
     37DerelictSDL and DerelictGL, you need to do something like this: 
    4338 
    4439<pre> 
    45     dmd -run buildme.d 
    46     gdmd -run buildme.d 
     40bud myapp.d -IDerelictDir/DerelictGL -IDerelictDir/DerelictSDL -IDerelictDir/DerelictUtil 
     41</pre> 
     42 
     43When using response files, this is a non-issue. However, many people prefer to 
     44have all of their D modules in a single import tree. For a long time, Derelict 
     45users who wanted such a setup had to copy the Derelict modules to their import 
     46tree manually, or use a custom script. As a result, Derelict now includes a very 
     47basic install script written in D. Given a root directory, this script will 
     48create a subdirectory 'derelict' and copy all derelict modules into that tree. Then 
     49you can add all of the to the import path with a single command line switch, 
     50'-IRootDir'. 
     51 
     52The following command line will execute the install script (if  you are using 
     53GDC, replace 'dmd' with 'gdmd': 
     54 
     55<pre> 
     56    dmd -run install.d RootDir 
     57</pre> 
     58 
     59'RootDir' is a required argument and should be the complete path to the directory 
     60in which you want to install the Derelict modules. Note that this does not copy 
     61any Derelict libraries (remember, you do not need to build the Derelict libraries 
     62if you use a build tool like Bud or Rebuild to compile your D apps). 
     63 
     64This simple script is provided as a convenience. While I will certainly respond 
     65to bug reports, I make no promises about enhancing its functionality. 
     66 
     67<div class="important">Derelict has built-in support for 
     68<a href="http://www.dsource.org/projects/tango">Tango</a>. However, currently the 
     69neither the install script nor the build script (described below) can be executed 
     70in a Tango-enabled environment. If you need to use Derelict with Tango, you must 
     71do so using the method recommended above (with Bud or Rebuild).</div> 
     72 
     73<h3>TheBuild Script</h3> 
     74Currently, the build script requires that <a href="http://www.dsource.org/projects/build"> 
     75Bud</a> be on your PATH. If it is not, the script will fail. To execute the 
     76build script, cd to $DERELICT_HOME and use one of the following command lines: 
     77 
     78<pre> 
     79    dmd -run buildme.d 
     80    gdmd -run buildme.d 
    4781</pre> 
    4882 
    4983The first is the command line to use with DMD. The second is for GDC. In the rest 
    50 of this document, 'dmd' will be used for example command lines. Anytime you see 
    51 'dmd', you can replace it with 'gdmd' to use the same command line with GDC. 
     84of this document, 'dmd' will be used for all example command lines. Anytime you 
     85see 'dmd', you can replace it with 'gdmd' to use the same command line with GDC. 
    5286 
    53 <h3>Options</h3
     87<h4>Options</h4
    5488Before executing the build script, you need to decide which libraries you want 
    5589to build and how you want to build them. There are a few command line options 
     
    5791may be passed in any order. 
    5892 
    59 <h4>Debug or Release?</h4> 
    6093By default, each package will be built in Release mode. You can specify debug 
    6194mode by passing 'debug' on the command line: 
    6295 
    6396<pre> 
    64    dmd -run buildme.d debug 
     97    dmd -run buildme.d debug 
    6598</pre> 
    6699 
    67100The script also accepts 'release' as a command line argument. 
    68  
    69 <h4>Options for Bud</h4> 
    70101 
    71102The build script generates a temporary Bud Response File that is deleted at the 
     
    75106 
    76107<pre> 
    77    dmd -run buildme.d nodelbrf 
     108    dmd -run buildme.d nodelbrf 
    78109</pre> 
    79110 
     
    108139 
    109140<pre> 
    110    cd $DERELICT_HOME 
    111    dmd -run buildme.d DerelictAL DerelictUtil 
     141    cd $DERELICT_HOME 
     142    dmd -run buildme.d DerelictAL DerelictUtil 
    112143</pre> 
    113144 
     
    119150 
    120151<pre> 
    121    cd $DERELICT_HOME 
    122    dmd -run buildme.d cleanlib 
     152    cd $DERELICT_HOME 
     153    dmd -run buildme.d cleanlib 
    123154</pre> 
    124155 
     
    127158be ignored. If it is not first, it will be ignored. 
    128159 
    129 <h3>Troubleshooting</h3
     160<h4>Troubleshooting</h4
    130161If you have any problems building Derelict with Bud, you may direct them to the 
    131162<a href="http://www.dsource.org/forums/viewforum.php?f=19&sid=d6f86cfb804d7c8727af1f58cd327d2c">Derelict Forums</a> 
  • trunk/docs/styles.css

    r252 r254  
    2727pre { 
    2828    color           : #000080; 
    29     background-color: #BBB
     29    background-color: #E6EAEC
    3030    font-weight     : bold; 
    3131}