DESCRIPTION

The build.prog.mk module compiles a set of source files and links the resulting object files with any required libraries into a target executable. It supports source in the following languages:
  • Ada (*.adb, *.ads)
  • Assembler (*.asm)
  • C (*.c)
  • C++ (*.cc or *.cpp)
  • Lex (*.l)
  • Objective C (*.m)
  • Yacc (*.y)

TARGETS

${PROG} Compile/link the ${PROG} executable from the specified source files.
clean-prog Clean up object and executable files.
cleandir-prog Clean up for packaging.
install-prog Install program to the target installation directory (see build.common.mk).
deinstall-prog Uninstall program from the installation directory.

VARIABLES

SRCS List of source files to compile into the target executable.
SRCS_GENERATED List of source files (subset of ${SRCS}) which are auto-generated. Files in this list will be processed before anything else is compiled.
PROG Filename of target executable. Platform-specific transforms may be applied to the name.
PROG_TYPE Platform-specific program type. Set to "CLI" (command-line utility), "GUI" (graphical user interface) or "DAEMON" (server program). Defaults to "CLI".
PROG_INSTALL Program can be installed. Defaults to "Yes". Setting this to "No" makes the install target a no-op.
PROG_PREFIX Prepend this string to installed executable name.
PROG_SUFFIX Append this string to installed executable name.
PROG_TRANSFORM Apply this sed expression to installed executable name.
PROG_GUID An optional Global Unique Identifier (GUID).
ADA Compiler for Ada sources. Defaults to "ada" or "gcc".
ADABIND Ada binder. Defaults to "gnatbind".
CC Compiler for C, C++ and Objective C sources. Defaults to "cc", "clang" or "gcc".
PROG_PROFILE Set "Yes" to compile with profiling instrumentation.
PROG_LINKER_TYPE Set to "C" for C-style linker or "ADA" to use the Ada linker. By default, select based on the exclusive presence of *.adb and *.ads files in ${SRCS}.
ADAFLAGS Compiler flags for Ada sources.
ADABFLAGS Flags to pass to the Ada binder.
CFLAGS Compiler flags for C sources. Defaults to "-O2 -g".
CXXFLAGS Compiler flags for C++ sources. Defaults to "".
OBJCFLAGS Compiler flags for Objective C sources. Defaults to "${CFLAGS}".
CPPFLAGS C preprocessor flags. Defaults to "".
ASM Compiler for assembler sources. Defaults to "nasm".
ASMFLAGS Compiler flags for assembler. Defaults to "-g -w-orphan-labels".
LEX Path to the lex lexical analyzer generator.
YACC Path to the yacc parser generator.
LFLAGS Options for lex. Defaults to "".
YFLAGS Options for yacc. Defaults to "-d".
LIBL Libraries to use for Lex lexers. Defaults to "-ll".
WINDRES (win32) Path to the windres utility.
WINRES (win32) Windows resource files for windres.
DATAFILES List of data files to install into ${DATADIR}. The files must exist in the build directory (which may be separate from the source directory if configure --srcdir was used).
DATAFILES_SRC Files to install into ${DATADIR}. This variable is handled similarly to DATAFILES, except that the specified files must exist in the source directory.
BINDIR Target installation directory for executables.
CONFDIR System-wide configuration files will be installed into this directory. Typically set to "${SYSCONFDIR}" or "${SYSCONFDIR}/MyApplication".
CONF List of configuration files to install into ${CONFDIR}. Note that the install target will not override existing configuration files, instead it will output a The following configuration files have been preserved message.
CONF_OVERWRITE Overwrite any existing configuration file on installation. Default is "No".

SEE ALSO

build.common.mk, build.lib.mk

HISTORY

build.prog.mk first appeared in BSDBuild 1.0.

BSDBuild is based on the 4.4BSD build system.

Csoft.net ElectronTubeStore.com