Table of Contents
The bt_make module will be deprecated soon; you are encouraged to avoid using it. It has been superseded by bt_logic; use this one and report your feelings to get a better program.
A target defines how to do a specific task with source or object files, like compiling them, installing binaries, etc. A package has several standard targets associated to it, which are described below:
Builds the source package. This includes libraries, binary programs or whatever else that can be "built" in some way.
Cleans the source package in a soft way. This means that the package can be rebuilt without the need of reconfiguring it.
Cleans the source package in a hard way. This leaves the package as it was when the distribution file was unpacked. Implies a regular soft clean.
Installs all result files coming from a build.
Targets can be built inside a directory if it mets two conditions: it contains a Makefile.bt file and it is inside a package. Furthermore, the package needs must be configured; see Chapter 4, Automatic package configuration.
In Buildtool, the process of building a target is done by the bt_make module. See next section.
buildtool make [-B] [-e] [-i] [-k] [-N] [-n] [-q] [-r] [-s] [-t] [-W] [-X] [-D variable] [-d flags] [-f makefile] [-I directory] [-j max_jobs] [-J private] [-m directory] [-T file] [-V variable] [variable=value] [target...]
The bt_make module is a program designed to simplify the maintenance of other programs. Its input is a list of specifications as to the files upon which programs and other files depend. If the file Makefile.bt exists, it is read for this list of specifications. If it does not exist, the file Makefile is read. If the file .depend exists, it is read.
The following options are recognized:
-B
Try to be backwards compatible by executing a single shell per command and by executing the commands to make the sources of a dependency line in sequence.
-D variable
Define variable to be 1, in the global context.
-d flags
Turn on debugging, and specify which portions of make are to print debugging information. flags is one or more of the following:
Print all possible debugging information; equivalent to specifying all of the debugging flags.
Print debugging information about archive searching and caching.
Print debugging information about conditional evaluation.
Print debugging information about directory searching and caching.
Print the input graph before making anything.
Print the input graph after making everything, or before exiting on error.
Print debugging information about running multiple shells.
Print debugging information about making targets, including modification dates.
Print debugging information about suffix-transformation rules.
Print debugging information about target list maintenance.
Print debugging information about variable assignment.
Run shell commands with [-x] so the actual commands are printed as they are executed.
-e
Specify that environment variables override macro assignments within makefiles.
-f makefile
Specify a makefile to read instead of the default Makefile.bt and if makefile is -, standard input is read. Multiple makefile's may be specified, and are read in the order specified.
-I directory
Specify a directory in which to search for makefiles and included makefiles. The system makefile directory (or directories, see the [-m] option) is automatically included as part of this list.
-i
Ignore non-zero exit of shell commands in the makefile. Equivalent to specifying - before each command line in the makefile.
-J private
This option should not be specified by the user.
When the [-j] option is in use in a recursive build, this option is passed by a make to child makes to allow all the make processes in the build to cooperate to avoid overloading the system.
-j max_jobs
Specify the maximum number of jobs that make may have running at any one time. Turns compatibility mode off, unless the [-B] flag is also specified.
-k
Continue processing after errors are encountered, but only on those targets that do not depend on the target whose creation caused the error.
-m directory
Specify a directory in which to search for sys.mk and makefiles included via the <...> style. Multiple directories can be added to form a search path. This path will override the default system include path. Furthermore the system include path will be appended to the search path used for /quot;..." style inclusions (see the [-I] option).
-N
Display the commands which would have been executed, but do not actually execute any of them; useful for debugging top-level makefiles without descending into subdirectories.
-n
Display the commands that would have been executed, but do not actually execute them unless the target depends on the .MAKE special source (see below).
-q
Do not execute any commands, but exit 0 if the specified targets are up-to-date and 1, otherwise.
-r
Do not use the built-in rules specified in the system makefile.
-s
Do not echo any commands as they are executed. Equivalent to specifying @ before each command line in the makefile.
-T tracefile
When used with the [-j] flag, append a trace record to tracefile for each job started and completed.
-t
Rather than re-building a target as specified in the makefile, create it or update its modification time to make it appear up-to-date.
-V variable
Print bt_make's idea of the value of variable, in the global context. Do not build any targets. Multiple instances of this option may be specified; the variables will be printed one per line, with a blank line for each null or undefined variable.
-W
Treat any warnings during makefile parsing as errors.
-X
Don't export variables passed on the command line to the environment individually. Variables passed on the command line are still exported via the MAKEFLAGS environment variable. This option may be useful on systems which have a small limit on the size of command arguments.
variable=value
Set the value of the variable variable to value. Normally, all values passed on the command line are also exported to sub-makes in the environment. The [-X] flag disables this behavior.
This section shows several examples on how to build targets inside a source package. Remember that the package must be configured before any target can be built.
To build a source package and generate binary (or target) files, simply issue:
$ buildtool make
To install the package after it has been built:
$ buildtool make install
To do a soft clean:
$ buildtool make clean
To do a complete clean:
$ buildtool make cleandir