Summary

NBuild lets you compile your projects consisting of many source files with dependencies to other NBuild project. Directives for NBuild are contained in comments within source files themselves, thus eliminating the need for any extra files and simplifying things a lot [at least for me].

ChangeLog:

  • 2006/07/26
    • fix incorrect comment behaviour
  • 2006/07/23
    • rewritten nbuild to tcl:
      • faster startup
      • support for Nemerle, C#, VB and Boo sources
      • if you MDEPEND on something and it DEPENDs on something else those won't crap your builddir
  • 2006/07/12
    • initial public release

Usage

NBuild can be invoked like this:

nbuild <sourcefile>...

Where each sourcefile can contain NBuild directives in commented lines (the whole line must be a comment), where directive is separated from its parameters with a colon. For example:

// APPTYPE: exe
// DEPEND: ../somproject/someproject.n
// MDEPEND: ../somemacro/somemacro.n
// OPTION: -Ot
// OPTION: -L
// OPTION: C:\Program Files\Some Folder
// GLOBALOPTION: -g

Supported directives

  • TARGET specifies target file name, defaults to <sourcefile>.exe or <sourcefile>.dll depending on application type
  • APPTYPE specifies application type, can be one of the following:
    exe - a console executable
    winexe - a windows executable
    dll or lib or library - a library assembly
  • SOURCE includes a specified file in current compilation (path relative to sourcefile)
  • DEPEND builds another project that this project depends on (path relative to sourcefile) in build target directory and adds reference to its target to current compilation
  • MDEPEND builds another project that this project depends on (path relative to sourcefile) in that project's directory and adds reference to its target to current compilation (useful for depending on projects with macros, because generally macro assembly is not needed for target after compilation, thus the M prefix for DEPEND)
  • OPTION specifies any additional compiler argument
  • REFERENCE specifies any additional reference that this target requires
  • GLOBALOPTION specifies any additional compiler argument that will be added to all compilations below and including this sourcefile.