A simple build system.
```shell
$ PARAM0=... ./bob.sh [function] [targets]
```
or:
```sh
# File: ./my_bob.sh
export PARAM0="..."
export PARAM1="..."
export PARAM2="..."
export PARAM3="..."
# ...
source ./bob.sh
```
```shell
$ ./my_bob.sh [function] [targets]
```
If the first target specified in targets is "all", then it is
expanded to be all subdirectories in $BOB_ROOT/targets which
contain a Makefile named $BOB_MAKEFILE_NAME.
Where function is one of:
The build command will iterate through all targets specified. If a target is
found, its dependencies are built first then the target itself. In case of a
circular dependency, the dependency is built before the parent target.
The clean command will delete the build.complete file and invoke `make clean`
on all specified targets.
NOTE: The build and clean commands redirect their output to the same `Makefile.log`
file
Rebuild is an alias for running a clean operation then a build operation on each
specified target.
NOTE: This is not the same as `./bob.sh clean [targets] && ./bob.sh build [targets]`
NOTE: Instead of running `make clean`, rebuild runs `make prepare-rebuild`
The mkpatch command will use git to generate a patch between the current state of
the target and the clean version of the source code.
See targets/toolA or toolB to see the base implementation of a valid Makefile.
bob.sh will call into Makefiles to attain more information about a given target.
It is important to distinguish target Makefiles, located in folders within the
"targets" subdirectory ("bob target(s)"), and the targets of those Makefiles, actions
or files the Makefile can build.
bob.sh calls the following targets within a target's Makefile:
A phony target that actually builds the source code provided in the SOURCE_CODE
variable.
A phony target that preforms additional cleaning work.
A phony which prepares the source code for a future build.
Echoes the version number of the bob target.
Echoes none, one, or a series of space separated bob targets
which must be built prior to the current bob target.
Echoes none, one, or a series of space separated URLs
of which one may be chosen to download a .tar* source
code archive from.
Echoes either nothing or "disabled" to disable the creation and
copying of the source directory to $srcbuild and $srcclean.
Echoes the desired basename of the bob target to override the
default $target-$version.
Echoes the absolute path to the source directory which should
be used for the bob target.
Echoes the name of the bob target whose source directory should
be used.
bob.sh makes available the following environment variables when
calling Makefile targets:
The root directory in which the bob.sh, targets, and .autogen
directories can be found. This value may be overwritten by the
user.
A value passed when bob.sh calls a Makefile's build, clean, or
prepare-rebuild targets. Its value is of the format:
"$BOB_BUILD/$basename/src".
The same as "$BOB_ROOT/targets".
A two component version string "$major.$minor".
To enable debugging information (set -x) set `BOB_DEBUG` to "yes".
Status files such as build.complete/fail, rebuild.complete/fail may
be disabled by setting `BOB_DISABLE_STATUS_FILES` to "yes".
The .autogen directory is created by bob.sh to maintain various internal directories that
must not be modified by the user in normal operation.
Contains copies of each bob targets' clean source code - prior to patching; exactly as
extracted from the source code archive.
Contains subdirectories for each target. Within each subdirectory is anohter subdirectory
named "src" which contains a copy of the patched source code - this is the directory specified
in the SOURCE_DIR variable passed to the build, clean, and prepare-rebuild Makefile targets.
The parent of the "src" directory may be used by the Makefile targets to store out of source
tree files.