MakeKit Manual

Brian Koropoff


I. Guide
1. Setting Up Your Project
Directory Layout
Build Files
Installing MakeKit
Configuring
Building
2. Conventions and Patterns
Life in Shell
Keyword Parameters
Quoting and Lists
Special Variables
File Layout
Finding Your Files
Target Notation
3. C Language Projects
Building Programs
Finding Header Files
Linking To Libraries
Building Libraries
Groups
Pre-compiled Headers
Configuration Tests
Test Basics
Checking For Headers
Checking For Libraries
Checking For Functions
Checking For Types
Checking For Sizes of Types
II. Reference
a. Utility Functions
mk_absolute_path — Make path absolute
mk_append_list — Append to list variable
mk_are_same_path — Test if two paths are identical
mk_basename — Strip leading directory from filename
mk_canonical_path — Canonicalize file system path
mk_capture_lines — Capture output of command as list
mk_clone — Clone files and directories
mk_dirname — Strip last component from filename
mk_fail — Print error message and abort
mk_fnmatch — Perform glob matching on path
mk_fnmatch_compile — Compile glob patterns to a function
mk_function_exists — Check if a function is defined
mk_get — Get value of variable
mk_get_file_mode — Get mode of file or directory in octal
mk_here_list — Read quoted list from here document
mk_mkdir — Recursively create directories
mk_mkdirname — Create leading directories for filename
mk_msg — Print message to the user
mk_normalize_path — Normalize path
mk_parse_params — Parse special parameters
mk_pop_vars — Restore variables
mk_push_vars — Save variables
mk_quote — Quote string for the shell
mk_quote_list — Quote list of strings for the shell
mk_read_line — Read a line from stdin
mk_readlink — Read target of symlink
mk_require_params — Check for missing keyword parameters
mk_resolve_resource — Find resource in search path
mk_run_or_fail — Run a command and abort on failure
mk_run_quiet_or_fail — Run a command quietly and abort on failure
mk_set — Set value of variable
mk_unquote_list — Unquote list into positional parameters
mk_varname — Convert a string to a variable name
mk_warn — Print warning
b. Core Functionality
MK_HOME — MakeKit home directory
MK_OBJECT_DIR — Intermediate file directory
MK_OBJECT_SUBDIR — Current object subdirectory
MK_ROOT_DIR — Root build directory
MK_RUN_DIR — Run directory
MK_SHELL — POSIX-compliant shell
MK_SOURCE_DIR — Source directory
MK_SOURCE_SUBDIR — Current source subdirectory
MK_STAGE_DIR — Staging directory
core — Core build logic
MK_DEBUG — Controls debug mode
mk_cache — Cache test result
mk_check_cache — Check for cached test result
mk_declare — Declare special variables
mk_deprecated — Note deprecated function usage
mk_get_export — Get value of exported variable
mk_multi_target — Define a rule that generates multiple targets
mk_output_file — Output a file with variable substitutions
mk_pretty_path — Convert path to pretty form
mk_pretty_target — Convert fully-qualified target to pretty form
mk_resolve_target — Resolve target to fully-qualified form
mk_stage — Install files or directories into staging area
mk_stamp_target — Define a stamp file target
mk_symlink — Create symlink in staging area
mk_target — Define a build rule
mk_option — Define an option
path — System path information
MK_BASELIBDIR — Base install directory for libraries
MK_BINDIR — Install directory for user executables
MK_DATADIR — Shared data directory
MK_DATAROOTDIR — Root shared data directory
MK_DOCDIR — Documentation directory
MK_EPREFIX — Install prefix for architecture-dependent files
MK_HTMLDIR — HTML documentation directory
MK_INCLUDEDIR — Install directory for header files
MK_LIBDIR — Install directory for libraries
MK_LIBEXECDIR — Install directory for program executables
MK_LOCALSTATEDIR — Local state directory
MK_MANDIR — UNIX man page directory
MK_PREFIX — Install prefix for architecture-independent files
MK_SBINDIR — Install directory for system executables
MK_SYSCONFDIR — System configuration directory
platform — Platform detection and targeting support
MK_ARCH — Target CPU architecture
MK_BUILD_ARCH — Build CPU architecture
MK_BUILD_DISTRO — Build OS distribution
MK_BUILD_DISTRO_ARCHETYPE — Build OS distribution archetype
MK_BUILD_DISTRO_VERSION — Build OS distribution version
MK_BUILD_ISAS — Build system ISAs
MK_BUILD_OS — Build OS
MK_DISTRO — Target OS distribution
MK_DISTRO_ARCHETYPE — Target OS distribution archetype
MK_DISTRO_VERSION — Target OS distribution version
MK_DLO_EXT — Dynamically-loadable object file extension for target system
MK_HOST_ARCH — Host CPU architecture
MK_HOST_DISTRO_ARCHETYPE — Host OS distribution archetype
MK_HOST_DISTRO_VERSION — Host OS distribution version
MK_HOST_ISAS — Host system ISAs
MK_HOST_OS — Build OS
MK_ISA — Target instruction set architecture
MK_ISAS — ISA list for target system
MK_LIB_EXT — Library file extension for target system
MK_MULTIARCH — Multiarch style for target system
MK_OS — Target OS
mk_compat_do — Execute commands for alternate ISAs
mk_compat_done — End mk_compat_do
mk_multiarch_do — Execute commands for multiple ISAs
mk_multiarch_done — End mk_multiarch_do
mk_system — Set target system
program — Program finding
mk_check_program — Check for program on build system
mk_check_programs — Check for programs on build system
c. Compiler Module
compiler — Build C/C++ projects
MK_CC — C compiler
MK_CC_LD_STYLE — Linker style for C
MK_CC_STYLE — Style of C compiler
MK_CFLAGS — Global C compiler flags
MK_CPPFLAGS — Global C preprocessor flags
MK_CXX — C++ compiler
MK_CXXFLAGS — Global C++ compiler flags
MK_CXX_LD_STYLE — Linker style for C++
MK_CXX_STYLE — Style of C++ compiler
MK_HEADERDEPS — Common header dependencies
MK_ISA_CFLAGS — Per-ISA C compiler flags
MK_ISA_CPPFLAGS — Per-ISA C preprocessor flags
MK_ISA_CXXFLAGS — Per-ISA C++ compiler flags
MK_ISA_LDFLAGS — Per-ISA linker flags
MK_LDFLAGS — Global linker compiler flags
MK_LIBDEPS — Common library dependencies
MK_RPATHFLAGS — Runtime library path flags
mk_check_endian — Check endianness of system
mk_check_function — Check for a function
mk_check_functions — Check for functions
mk_check_header — Check for a header
mk_check_headers — Check for headers
mk_check_lang — Set language for configure checks
mk_check_libraries — Check for libraries
mk_check_library — Check for a library
mk_check_member — Check for a member of type
mk_check_members — Check for members of types
mk_check_sizeof — Check size of a type
mk_check_sizeofs — Check sizes of several types
mk_check_type — Check for a type
mk_check_types — Check for types
mk_compile — Build an object file
mk_compiler_warnings — Turn on compiler warnings
mk_config_header — Create config header
mk_define — Define a macro in config header
mk_defname — Convert a string to #define form
mk_dlo — Build a dynamically loadable object
mk_group — Build a source group
mk_headers — Install headers
mk_library — Build a library
mk_pch — Build pre-compiled header
mk_prebuilt_library — Stage a pre-built library
mk_program — Build a program
mk_try_compile — Try to compile a code snippet
mk_try_link — Try to compile and link a code snippet
d. Chaining Modules
chain-autotools — Chain into autotools C/C++ projects
mk_chain_autotools — Build autotools source component
chain-compiler — Chain into foreign C/C++ build systems
mk_chain_compiler — Chain into C/C++ component with foreign build system
mk_chain_compiler_stage — C/C++-oriented stage function for chaining
chain-generic — Chain into foreign build systems
mk_chain_generic — Chain into component with foreign build system
mk_chain_generic_stage — Generic stage function for chaining
e. Fetch Module
fetch — Remote file fetching and unpacking
mk_fetch — Fetch remote file
mk_fetch_unpack — Fetch and unpack archive
mk_unpack — Unpack archive
f. DocBook Module
mk_check_docbook — Check for DocBook prerequisites on the build system
mk_check_docbook_pdf — Check for PDF-specific DocBook prerequisites on the build system
mk_docbook_html — Generate html documentation
mk_docbook_man — Generate UNIX man pages
mk_docbook_pdf — Generate PDF documentation
mk_have_docbook — Test if DocBook processing is available
mk_have_docbook_pdf — Test if DocBook pdf processing is available
g. Doxygen Module
mk_check_doxygen — Check for Doxygen on the build system
mk_doxygen_html — Generate html documentation
mk_have_doxygen — Test if doxygen was found
h. MoonUnit Module
moonunit — Build MoonUnit tests
MK_MOONUNIT_DIR — Unit test output directory
mk_check_moonunit — Check for MoonUnit
mk_have_moonunit — Test if MoonUnit was found
mk_moonunit — Build a MoonUnit test library
mk_moonunit_test — Define a MoonUnit test target
i. Package Modules
mk_deb_do — Begin Debian package definition
mk_deb_done — End Debian package definition
mk_deb_sub_do — Begin Debian subpackage definition
mk_deb_sub_done — End Debian subpackage definition
mk_freebsd_do — Begin FreeBSD package definition
mk_freebsd_done — End FreeBSD package definition
mk_freebsd_enabled — Test if FreeBSD package building is enabled
mk_package_dirs — Specify inclusion of directory in current package
mk_package_patterns — Package targets matching a set of patterns
mk_package_targets — Include specified targets in current package
mk_rpm_do — Begin RPM package definition
mk_rpm_done — End RPM package definition
mk_rpm_enabled — Test if RPM building is enabled
mk_rpm_sub_do — Begin RPM subpackage definition
mk_rpm_sub_done — End RPM subpackage definition