BUILD.PROG.MK(5)
β¨ BUILD.PROG.MK(5) β¨
okay so bestie, welcome to build.prog.mk β the bsdbuild module, and it's literally the one that compiles executables for you π
(this is the build.prog.mk(5) page, File Formats Manual, in case you were wondering π)
πΈ SYNOPSIS πΈ
.include <bsd.prog.mk>
that's it. that's the whole vibe. one line and you're in π«Ά
π DESCRIPTION π
So the build.prog.mk module is what you use to compile an executable program out of a bunch of source files. Iconic. And it comes with built-in support for sources in all of these languages, no cap:
- C (
*.c) - C++ (
*.ccor*.cpp) - Objective C (
*.m) - Assembler (
*.asm) - Lex (
*.l) - Yacc (
*.y)
like it just knows. main character energy tbh π
π₯ TARGETS π₯
${PROG}β compiles/links the${PROG}executable from the source files you specified. the whole point, honestly.${GMONOUT}β compiles/links a profiled version of${PROG}. fancy.clean-progβ cleans up the object files and executable files. self care β¨cleandir-progβ cleans up for packaging.install-progβ installs the program into the target installation directory (peepcsoft.common.mk(5)for that one).deinstall-progβ uninstalls the program from the installation directory. we love a reversible decision π
π¦ VARIABLES π¦
PROGβ filename of the target executable. heads up: platform-specific transforms may get applied to the name, so it might not come out exactly as you typed it πPROG_TYPEβ the type of application. set it to βCLIβ for a command-line utility, βGUIβ for a graphical interface, or βDAEMONβ for a server program. defaults to βCLIβ. what this setting actually means is platform-specific β and on the Windows platform, it tells the compiler to pick the appropriate PE header subsystem πͺBINDIRβ target installation directory for executables (usually set by configure).PROG_INSTALLβ if you set it to βYesβ, the install target will install the program, otherwise it's a no-op. defaults to βYesβ.PROG_GUIDβ a Global Unique Identifier (GUID) for the program. exact interpretation is platform-specific π€·GMONOUTβ output filename for the profiled version of the program.CCβ compiler for C, C++ and Objective C sources. defaults to βccβ.CFLAGSβ compiler flags for C sources. defaults to β-O2 -gβ.CXXFLAGSβ compiler flags for C++ sources. defaults to ββ (yes, empty, it's giving minimalism).OBJCFLAGSβ compiler flags for Objective C sources. defaults to β${CFLAGS}β.CPPFLAGSβ compiler preprocessor flags, for sources in all languages that feature 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 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}. important: these files must have been generated from the build process β meaning if you're using a separate build with--srcdir, the files you specify must exist in the build directory. don't come for me, that's just how it is πDATAFILES_SRCβ files to install into${DATADIR}. handled similarly toDATAFILES, except these specified files must exist in the source directory. see the difference? iconic.CONFDIRβ system-wide configuration files get installed into this directory. it's usually set relative to β${SYSCONFDIR}β, for example β${SYSCONFDIR}/MyApplicationβ.CONFβ list of configuration files to install into${CONFDIR}. but bestie, listen β the install target will not override existing configuration files. instead it prints a βThe following configuration files have been preservedβ message. respectful king behavior honestly π«ΆCONF_OVERWRITEβ overwrite any existing configuration file on installation. default is "No".
β οΈ note the difference betweenDATAFILES(lives in the build directory) andDATAFILES_SRC(lives in the source directory) β mixing them up is a whole mood killer.
π SEE ALSO π
π HISTORY π
build.prog.mk first appeared in BSDBuild 1.0 β¨
BSDBuild is based on the 4.4BSD build system. heritage! legacy! we stan π
that's the whole page bestie, go compile something cute ππ
Debian Β· July 18, 2007 Β· BUILD.PROG.MK(5) β mwah, that's the source and the date, signin' off π
β¨
π¦ where this page comes from
- nixos 26.05: bsdbuild 3.1
- nixpkgs unstable: bsdbuild 3.1
- Copyright (c) 2007 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