buildpp


buildpp(1)

buildpp(1)

NAME

buildpp - A build system like make, but without makefiles

SYNOPSIS

buildpp [-clean] [-usecolours] [-verbose] [-girlie] [-test] targets

DESCRIPTION

The purpose of buildpp.pl is to build source code into programs and libraries (currently only programs are supported (tested)). It is primarily intended for C and C++ but it should be possible to use other languages. It is intended to support building the application under different systems, currently Windows, Linux and MacOSX is tested, the requirements of the operation-system are a "recent" version of perl and a compiler.

OPTIONS

-clean
Removes all files in the build directory, all files will be remove without regard to whom made them. NEVER put any files in the build directory! The build directory is specified with $buildDir it defaults to "build/". If $cleanConfirm is true buildpp.pl will request you to confirm the clean action, the default is 1 (true).

-distcc
Overwrites $useDistcc and sets it true. Use distcc when compiling. Prefixes the compiler command with "distcc ", if you don't set the number of threads to use with -j it will count the number of hosts in the environment variable DISTCC_HOSTS and uses this value.

-j
Overwrites $numberOfThreads, this is the number of threads to use when compiling .o files. Useful when having more than one CPU or "cluster" compiling.

-usecolours or -usecolors or -c
Overwrites $useColours and sets it true. Buildpp will colourise the output if $useColours is true, the default is 0 (false).

-verbose or -v
Overwrites $verbose and sets it true. Buildpp will output extra information if $verbose is true, the default is 0 (false).

-girlie
Overwrites $girlie and sets it true. Buildpp will tell you things you probably don't want to know if $girlie is true, the default is 0 (false).

-test
Test the target after building it (it must be executable or buildpp will look for its file in vane, complaining about it). If you specify something like -test="Hello World" Hello World will be given on the commandline to the target.

FILES

modulelist contains a newline separated list of pathes where the code files are stored. The pathes are searched recursively. A new feature is the possibility to specify paths that should't be searched, this is done by putting a ! in front of the path. Exclusion paths must be specified before any inclusion pathes. If you wish to define an inclusion path beginning with a ! write it like this ./!weirdPathName. It is also important that the paths matches, "!src/brokenStuff" , "./src" won't work as expected but "!./src/brokenStuff", "./src" and "!src/brokenStuff" , "src" will.

localbuild.pl Is read to determine the local build configuration, allowing to configure things that are specific for a build under a certain platform. The file is read using readConfigFile

BUILDPP VARIABLES AND FUNCTIONS

Here is a list of the internal variables and functions of buildpp that you may change in the localbuild.pl file or any file it includes with readConfigFile

readConfigFile("filename") Tries to reads an extra file and parse its contents, it will only generate a warning if it can't find it. However if the file fails to parse, buildpp.pl stops.

autoTarget() Tries to determine the OS we are running under and sets $target accordingly.

%osHash A hash from regEx's for OS names to $target values (DEFAULT=see buildpp.pl)

$target The current build target, empty for no specific target. Usually set using autoTarget(). (DEFAULT="") see CODE COMMENTS for more info.

parseArguments() Makes buildpp.pl read the arguments and options from the command line. buildpp.pl will call this if you don't. However it won't call it if you have already called it. It is possible to call this function more that once if needed. You only need to call this function if you modify %argumentHash.

%argumentHash The option that is feed to Getopt::Long when reading options. Modify this to define your own options for buildpp.pl. eg. $argumentHash{"cross"} = \$crossCompile; to define a new option -cross that sets $crossCompile true when you call parseArguments(). See the perl documentation for Getopt::Long for more information (DEFAULT=see buildpp.pl)

$testProgram The program used when testing exe files. You could set this to "wine " when cross compiling to windows or "gdb " when compiling debug versions (DEFAULT="").

COMPILING AND LINKING VARIABLES

$lazyLinking if lazyLinking is set true (1) you don't need to specify link comments it links with everything that you #include "" with. Inside the source code you may locally overwrite the global $lazyLinking variable with //#lazylinking on or //#lazylinking off (DEFAULT=0).

$compiler The program to use as a compiler (DEFAULT="g++").

$cflags The default flags used when compiling code into object files (DEFAULT="-c -Wall ") see CODE COMMENTS for more info.

$includeSuffix Defines the suffixes that if included with #include "" will become part of the dependencies. Used in a regEx therefore the weird syntax (DEFAULT="\\.h|\\.cpp").

$codeSuffix The suffix that your code files have, DON'T put a dot in front (DEFAULT="cpp").

$objectSuffix The suffix to put after object files, DON'T put a dot in front (DEFAULT="o").

$linker The program to use as a linker (DEFAULT="g++") see CODE COMMENTS for more info.

$ldflags The default flags used when linking object files together (DEFAULT="") see CODE COMMENTS for more info.

$exeSuffix The suffix to put after executable files, DON'T put a dot in front (DEFAULT="").

$buildDir The dir where buildpp.pl generates files (.o .exe and .d files) if it dos't exist it will be created. WARNING ALL files here will be deleted on clean! (DEFAULT="build/").

$cleanConfirm If true you are requested to confirm when cleaning (DEFAULT=1).

$useDistcc) If true all compile commands will be prefixed with "distcc " (DEFAULT=0), additional if $numberOfThreads has't been set it will be set to the number of hosts in the environment variable DISTCC_HOSTS

$numberOfThreads The number of threads to use when compiling object files (DEFAULT=1)

CALLBACKS

$postProcessingRef is a reference to a function that is called for each executable file created. This could for instance be used to call strip on your executables when generating release versions. See the default function in buildpp.pl for arguments. (DEFAULT=\&defaultPostProcessing)

$autoProcessingRef is a reference to a function that is called for each file with a .auto suffix found during the first "Reading module list and compiling file list" parse. The default behaviour is to try to execute the file See the default function in buildpp.pl for arguments. (DEFAULT=\&defaultAutoProcessing)

DISPLAY CONTROLS

$colourVerbose, $colourNormal, $colourError, $colourAction, $colourExternal, $colourWarning, $colourGirlie Colour definitions for different types of output (DEFAULTS $colourVerbose = "\033[33m", $colourNormal = "\033[37;40m", $colourError = "\033[33;41m", $colourAction = "\033[32m", $colourExternal = "\033[36m" $colourWarning = "\033[33m", $colourGirlie = "\033[35m" )

$useColours See -usecolours. If false the colour entrys will not be used, note that it is not all terminals that understands the colourcodes (DEFAULT=0).

$verbose Displays lots of information if true (DEFAULT=0).

$girlie If true displays information that you normally don't need nor want (DEFAULT=0).

$showCompilerCommand If true always shows the command used for compilation (else just on error) (DEFAULT=0).

$showLinkerCommand If true always shows the command used for linking (else just on error) (DEFAULT=0).

AUTHOR

Visti Andresen (sftalpa at users.sourceforge.net)