Bud Utility © 2006, Derek Parnell, Melbourne
(table of contents)

Topic: Profile File

The utility's profile is used to specify various values for the utility. The file is called build.pfl. You can have from zero to three profile files because the Bud utility looks in each of three places for a profile file, and it uses each one that it finds. It looks in the folder that Bud is installed, then in the folder that the compiler is installed, and finally in the current folder.
 
The profile file consists of one or more command lines. Each command line is specified in a single text line, but you can have any number of command lines in the configuration file. Supported Commands
The commands currently supported are ...
CMDLINE
You can specify all command line switch values with this configuration option. You can also specify multiple switches on the same option line.
CMDLINE=-inline -w
Environment Symbol Substitution
Before each configuration file option line is processed, it is first checked for any references to Environment symbols. Each reference is replaced by the value of that symbol. References take the form %<SYMNAME>%
There are two special symbols: @D is replaced by the compiler's path, and @P is replaced by the compiler's configuration file's path.

Example: Assuming you had set BUILDOPTS=-w -g

CMDLINE=%BUILDOPTS%    # Allow switches to be passed via enviroment symbol.
would mean that "-w -g" would be automatically placed on the utility's commandline whenever you ran it.
 
Groups
It is possible to specify groups of configuration options that are only applied if explictly nominated on the command line. A group starts with a line in the format [<groupname>] where groupname can be any text that doesn't include spaces. A group ends on the last line before the next group in the file.

Example: a Group

   [dbg] # To produce a debug edition of an application.
   CMDLINE=-unittest
   CMDLINE=--release
   CMDLINE=--inline
   CMDLINE=-g
   CMDLINE=-w
   CMDLINE=-full
   CMDLINE=-T{Target}_{Group}
All the options lines before the first group are known as the default options because these are always applied. To apply the options in a group you need to specify which group(s) you want on the command line, or via a . The group name is prepended with a plus sign on the command line. To apply the 'debug' group in the above example, you place on the command line +dbg
 
Comments
You may place comments in a configuration file. A comment starts with a # character and extends to the end of the line.
 
Blank lines are ignored.

Example:

build myapp.d +final
where if a group called '[final]' is contained in any configuration file, the options in that group are used.

Example: contents of [final]

    # This creates a production (release) edition of the app.
    [final]
    CMDLINE=-T{Target}_{Group}  # Set the name of the executable.
    CMDLINE=-release   # Don't generate runtime checks.
    CMDLINE=-full      # Force compilation of all files.
    CMDLINE=-cleanup   # remove work files when completed
    CMDLINE=-inline    # Allow inlining to occur
    CMDLINE=--debug*   # Turn off any debug switches
    CMDLINE=--unittest # Turn off any unittest switches
    CMDLINE=--w        # Turn off warnings
    CMDLINE=--g        # Turn off embedded debug symbolic info.
You can any number of configuration file group references on a command line. They are processed in the order they appear.

Generated by Ddoc, Mon Oct 16 11:03:25 2006