Table of Contents
Bakefile rulesets define lots of variables; this chapter provides brief summary of variables that are available for makefile writers.
These variables are meant to be changed using -D command line argument (see manual page for details).
Variable name | Description | Default |
---|---|---|
OPTIONS_FILE | If set, then user-configurable part of generated makefile (i.e. options list) is written into another file instead that the makefile will include. OPTIONS_FILE value must be relative to OUTPUT_FILE. | (not set, empty) |
WRITE_OPTIONS_FILE | If OPTIONS_FILE is set and WRITE_OPTIONS_FILE is 1, then file OPTIONS_FILE is created. If 0, then it is not, but it is still included by the main makefile. This allows you to generate options file shared by lots of subproject makefiles and don't repeatedly generate it. | 1 |
Variables for fine-tuning Bakefile's output (rarely needed):
Variable name | Description | Default |
---|---|---|
VARS_DONT_ELIMINATE | Bakefile normally eliminates all unused variables from the output. In some rare situations, it may not detect that a variable is used, in which case you can tell it to keep the variable by adding its name to this variable. So far this is only useful if the variables is used in makefile code included using fragment. | (empty) |
LIB_PAGESIZE | Set this variable to a large power of two if your linker (on Windows) complains that page size is too small when building static library. | 4096 |
Variable name | Description | Default |
---|---|---|
SRCDIR | Directory to which names of source files are relative to. This value is relative to OUTPUT_FILE. | . |
BUILDDIR | Directory where object files and executables are built. This value is relative to OUTPUT_FILE. | (depends on format) |
These are standard installation directories as used on Unix (most notably in Autoconf). They are used by install target if the backend supports it. They are defined on all platforms. You can change their values freely (unless you are using Autoconf backend).
Variable name | Description | Default |
---|---|---|
PREFIX | Base directory for installed files. | /usr/local on Unix |
BINDIR | Directory where programs are installed. | $(PREFIX)/bin on Unix |
LIBDIR | Directory where libraries are installed. | $(PREFIX)/lib on Unix |
INCLUDEDIR | Directory where C and C++ headers are installed. | $(PREFIX)/include on Unix |
DATADIR | Directory where data files are installed. | $(PREFIX)/share on Unix |
All of these are variables defined to either 0 or 1, with the exception of autoconf format backend where they are options.
Variable name | Description |
---|---|
PLATFORM_UNIX | UNIX variant |
PLATFORM_WIN32 | 32bit Windows |
PLATFORM_MSDOS | MS-DOS |
PLATFORM_MAC | Mac OS X or Mac Classic |
PLATFORM_MACOSX | Mac OS X |
PLATFORM_OS2 | OS/2 |
PLATFORM_BEOS | BeOS |
Variable name | Description | |
---|---|---|
BAKEFILE_VERSION | String with Bakefile version number. The version is formed from three numbers delimined by period. Read only. | |
OPTIONS | Space-separation list of options defined in the makefiles. Note that the value of this variable changes during processing as new options are defined! | |
INPUT_FILE | Name of input file. The name is always absolute path. Read only. | |
INPUT_FILE_ARG | Same as INPUT_FILE, but the name is in exactly same form as it was passed on command line, it's not made absolute as in case of INPUT_FILE. | |
OUTPUT_FILE | Name of the file where generated native makefile will be written. Read only. | |
FORMAT | Format of makefile currently being generated, e.g. autoconf. Always constant expression. | |
COMPILER | Short identifier of used compiler (e.g. "bcc" or "vc6"). This variable is only defined for Windows compilers and is guaranteed to evaluate to constant expression. | |
TOOLSET | What kind of tools the makefile uses. Use this to determine what commands to put into command tags. Can be one of win32, unix. Always a constanst expression. | |
LF | Line feed character (\n in C). | |
TAB | Tabelator character (\t in C). | |
DOLLAR | Dollar sign ($). | |
SPACE | Space character (" "). Note that SPACE is not evaluated and so you can't use it in places where constant expression is expected. | |
DIRSEP | Character used to separate directory components in paths on target platform (/ on Unix, \ on Windows). |
Variable name | Description | Default |
---|---|---|
AUTOCONF_MACROS_FILE | Where configure.in macros for setting options and conditional variables (mostly AC_SUBST calls) are written. This file must be included by your configure.in script. Set it to empty string to disable creation of this file (e.g. for subprojects of main project, see also OPTIONS_FILE ). | autoconf_inc.m4 |