= Welcome to '''Bud''' = (Note: [wiki:Build_Remaining This utility is known as 'Bud', and the project is still known as 'Build']) This is a tool to assist developers in building applications written in the [http://www.digitalmars.com/d D Language]. It's main purpose is to reduce the need for developers to keep track of which files are needed to be compiled and/or linked to form either an execuable file or library file. You can follow the latest [wiki:BuildNews news] for Bud or check out the [wiki:BuildChangeLog change log] or browse its [http://svn.dsource.org/projects/build/trunk/Docs/User_Manual.html documentation] online. == Project Status == Other that the apparent [http://www.dsource.org/projects/build/attachment/wiki/WikiStart/bud-3-1.04-ported-to-D2.tar.gz?format=raw port of the 3.04 files to D2] that was attached to this page in 2011 by user "jaye", development seems to have stalled after [changeset:58 changeset 58] on 2009-07-06. == Similar Tools == * [http://dlang.org/rdmd.html RDMD]: companion to the dmd compiler that simplifies the typical edit-compile-link-run or edit-make-run cycle to a rapid edit-run cycle * [http://code.dlang.org/about DUB]: build tool for D projects with support for automatically retrieving dependencies and integrating them in the build process == Resources == The [http://www.dsource.org/forums/viewforum.php?f=52 discussion forum] is a valuable source of information and feedback too. The latest downloads (Version 3.04 - October 16th, 2006) are * [http://trac.dsource.org/projects/build/browser/downloads/bud_win_3.04.exe?format=raw Windows Executable (without debug code)] * [http://trac.dsource.org/projects/build/browser/downloads/bud_win_3.04.dbg.exe?format=raw Windows Executable (with debug code)] * [http://trac.dsource.org/projects/build/browser/downloads/bud-3.04.doc.zip?format=raw Documentation] * [http://trac.dsource.org/projects/build/browser/downloads/bud-3.04.src.zip?format=raw Source files] '''NOTE: Needs D v0.163 or higher to compile''' '''UPDATE on 01 March 2011: here is a port of the 3.04 files to D2, tested only on Linux and Mac OSX x86_64, but might work on Windows too.''' * [http://www.dsource.org/projects/build/attachment/wiki/WikiStart/bud-3-1.04-ported-to-D2.tar.gz?format=raw Update of 3.04 code to D2] == Compilation on Unix == If you have no existing binary, the executable must be built with the makefile first: {{{ make -f Makefile.unix }}} It is still imperative to build a final binary with the utility itself: {{{ ./build build -full -op ln -s build bud }}} == Background == Most developers coming from C/C++ are familiar with the need for ''makefiles'' when building applications that have more than a couple of files involved. The usual process would be that whenever a new source file was created for the application, the developer would also update the makefile file to add then new file's name to the list of files needed to build the application. This is extra housekeeping for the developer, and as such is a chore and is occasionally overlooked. '''Bud''' eases this chore by examining the source files on its command line and determines all specific files are actually needed by the application, and whether or not they need recompiling. After doing this, it then launches the compiler, linker, and librarian as required to build the intended target file. No ''makefiles'' are required. '''Bud''' is very flexible and its behaviour can be controlled by various command line switches and configuration files. == Usage == The utility's [http://svn.dsource.org/projects/build/trunk/Docs/User_Manual.html main documentation] describes the functions and options in much greater detail, so I'll just give a brief outline here of typical usages. The common usage for '''Bud''' is just to name the top most file in the application's hierarchy of source files on its command line. {{{ bud myapp }}} This will cause the utility to inspect the file ''myapp.d'' for references to other source files, such as '''import''' and '''pragma''' statements. It does this recursively to find all the files needed for the application. It then checks each of these files to see if their compiled version is up-to-date with respect to the ''target'' file. In most cases, the ''target'' is the executable file you are trying to build, but this may also be a library you are building. For each file that is not up-to-date, it adds it to the list of files to compile. After all needed files are checked it launches the compiler (if required) to create object files, and then, in the case of an executable target, launches the linker. If building a library it launches the librarian instead of the linker. '''Commonly Used Switches''' {{{ -cleanup Ensures that all working files created during the run are removed. -full Causes all source files, except ignored modules, to be compiled. -info Displays the version and path of the Bud application -names Displays the names of the files used in building the target. -noautoimport Prevents source file paths from being added to the list of Import Roots -obj Just creates object files. No linker or librarian is launched. -od Nominates the temporary file directory. -run Runs the application after successful linking. -silent Prevents unnecessary messages being displayed. -T Identifies the target name to Bud. -test Does a test run only. No compiling, linking or library work is done. -V Set verbose mode on for just Bud and not for the compiler -X Identifies a module or package to ignore }}}