BUILD.LIB.MK(5)

πŸ“¦ version 3.1, in nixos 26.05, nixpkgs unstable

πŸ¦‹ 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++ (*.cc or *.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 (see csoft.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 to Yes, the install target will install the library files; otherwise it will be a no-op. Defaults to No. πŸ™ˆ
  • LIB_SHARED β€” if set to Yes, a shared library will be built. Default is No. πŸ”₯
  • LIB_MODULE β€” if set to Yes, a dlopen(3) compatible module will be built. Default is No. 🧩
  • 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/dir and -lfoo specify shared libraries. πŸ”—
  • USE_LIBTOOL β€” if set to Yes, use libtool(1) to build the libraries. If set to No, generate the library using the traditional method involving ar(1), ranlib(1), and -fPIC. πŸ› οΈ
  • LIBTOOL β€” path to GNU libtool(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 the CC environment variable, or "cc". βš™οΈ
  • CFLAGS β€” compiler flags for C sources. Defaults to the CFLAGS environment variable. 🌈
  • CXXFLAGS β€” compiler flags for C++ sources. Defaults to the CXXFLAGS environment 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 to nasm. πŸ’€
  • ASMFLAGS β€” compiler flags for assembler. Defaults to -g -w-orphan-labels. πŸ”§
  • LEX β€” path to the lex(1) lexical analyzer generator. πŸŒ€
  • YACC β€” path to the yacc(1) parser generator. πŸŒͺ️
  • LFLAGS β€” options for lex(1), defaults to ''. πŸͺ„
  • YFLAGS β€” options for yacc(1), defaults to -d. πŸŽ€
  • LIBL β€” libraries to use for Lex lexers. Defaults to -ll. πŸ“š
  • WINDRES β€” (Specific to the win32 platform) path to the windres(1) utility, which generates windows resource files. πŸͺŸ
  • WINRES β€” (Specific to the win32 platform) resource file to use with windres(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 to DATAFILES, except that the specified files must exist in the source directory. πŸ—‚οΈ
  • INCLDIR β€” library header files will be installed into this directory. See build.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