BUILD.LIB.MK(5)
π¦ build.lib.mk(5) β bsdbuildβs library-compilation era π¦
Okay bestie, welcome to build.lib.mk(5) from the File Formats Manual β this is the page for the bsdbuild module that handles compilation of libraries. Itβs lowkey iconic, no cap.
β¨ NAME β¨
build.lib.mk β bsdbuild β compilation of libraries. Yup, thatβs the whole vibe: it compiles static and/or shared libraries, and itβs literally about to make your build feel like main character energy. π
πΈ SYNOPSIS πΈ
.include <bsd.lib.mk>
π DESCRIPTION π
The build.lib.mk module compiles static and/or shared libraries from a set of source files. For shared libraries, it uses a bundled copy of GNU libtool. The module provides built-in support for sources in the following languages:
- C (
*.c) - C++ (
*.ccor*.cpp) - Objective C (
*.m) - Assembler (
*.asm) - Lex (
*.l) - Yacc (
*.y)
π TARGETS π
lib${LIB}.aβ compile the source files into a static library. slay. β¨lib${LIB}.laβ compile the source files into static and shared libraries using libtool. and yes, libtool comes bundled with BSDBuild. π«Άclean-libβ clean up object and library files. self-care. π§cleandir-libβ clean up for packaging. π¦install-libβ install library files to the target installation directory (seecsoft.common.mk(5)). πdeinstall-libβ uninstall libraries from the installation directory. bye bestie. π
π VARIABLES π
LIBβ name of target library. Platform-specific transforms will be applied to the name. π―LIBDIRβ target installation directory for libraries (usually set by configure). πLIB_INSTALLβ if set toYes, the install target will install the library files; otherwise it will be a no-op. Defaults toNo. πLIB_SHAREDβ if set toYes, a shared library will be built. Default isNo. π₯LIB_MODULEβ if set toYes, adlopen(3)compatible module will be built. Default isNo. π§©LIB_GUIDβ a Global Unique Identifier (GUID) for the library. Exact interpretation is platform-specific. πͺͺLIB_MAJORβ major version number for shared libraries. 1οΈβ£LIB_MINORβ minor version number for shared libraries. 2οΈβ£LIB_REVISIONβ revision number for shared libraries. πLIBSβ specify other libraries to link against this library. Bare filename arguments are interpreted as archive files ("foo.a"or"foo.la"). Arguments of the form-L/path/to/dirand-lfoospecify shared libraries. πUSE_LIBTOOLβ if set toYes, uselibtool(1)to build the libraries. If set toNo, generate the library using the traditional method involvingar(1),ranlib(1), and-fPIC. π οΈLIBTOOLβ path to GNUlibtool(1). This is usually set by the configure script. BSDBuild-generated configure scripts will select BSDBuildβs bundled copy of libtool by default (recommended), but an alternate libtool may be specified using--with-libtool=PATH. πLIBTOOLOPTSβ specify general libtool arguments (passed before--mode). Defaults to"--quiet". π€«LIBTOOLOPTS_SHAREDβ specify extra libtool arguments for linking of shared libraries. πLIBTOOLOPTS_STATICβ specify extra libtool arguments for linking of static libraries. π§±CCβ compiler for C, C++ and Objective C sources. Defaults to theCCenvironment variable, or"cc". βοΈCFLAGSβ compiler flags for C sources. Defaults to theCFLAGSenvironment variable. πCXXFLAGSβ compiler flags for C++ sources. Defaults to theCXXFLAGSenvironment variable. π¦OBJCFLAGSβ compiler flags for Objective C sources. Defaults to${CFLAGS}. πCPPFLAGSβ compiler preprocessor flags, for sources in all languages featuring a C preprocessor. π§ASMβ compiler for assembler sources. Defaults tonasm. πASMFLAGSβ compiler flags for assembler. Defaults to-g -w-orphan-labels. π§LEXβ path to thelex(1)lexical analyzer generator. πYACCβ path to theyacc(1)parser generator. πͺοΈLFLAGSβ options forlex(1), defaults to''. πͺYFLAGSβ options foryacc(1), defaults to-d. πLIBLβ libraries to use for Lex lexers. Defaults to-ll. πWINDRESβ (Specific to the win32 platform) path to thewindres(1)utility, which generates windows resource files. πͺWINRESβ (Specific to the win32 platform) resource file to use withwindres(1). π§ΎDATAFILESβ list of data files to install into${DATADIR}. The files must have been generated from the build process (i.e., if using a separate build with--srcdir, the specified files must exist in the build directory). πDATAFILES_SRCβ files to install into${DATADIR}. This variable is handled similarly toDATAFILES, except that the specified files must exist in the source directory. ποΈINCLDIRβ library header files will be installed into this directory. Seebuild.common.mk(5). πINCLβ list of library header files. πCONFDIRβ system-wide configuration files will be installed into this directory. It is usually set relative to${SYSCONFDIR}, for example${SYSCONFDIR}/MyLibrary. π οΈ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 π
β HISTORY β
build.lib.mk first appeared in BSDBuild 1.0. β¨
BSDBuild is based on the 4.4BSD build system. π§
β Debian edition of BUILD.LIB.MK(5), dated July 18, 2007, signing off with a library-sized π
π¦ where this page comes from
- nixos 26.05: bsdbuild 3.1
- nixpkgs unstable: bsdbuild 3.1
- Copyright (c) 2007-2014 Hypertriton, Inc. <http://www.hypertriton.com/>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms