BUILD.WWW.MK(5)
π
BUILD.WWW.MK(5) β the build.www.mk module, bestie edition
okay so this is a page from the File Formats Manual, and it's literally all about build.www.mk β the bsdbuild module for HTML document preprocessing. yes it's a build-system manpage. yes it's actually kind of iconic once you get it. sit down, grab a strawberry drink π, and let's go.
β¨ NAME β¨
build.www.mk β bsdbuild, but make it HTML document preprocessing π
π¦ SYNOPSIS π¦
.include <bsd.www.mk>
that's it. that's the whole incantation. slay.
πΈ DESCRIPTION πΈ
so the build.www.mk module is the one that generates a whole set of HTML documents β in different languages and character set variants β starting from an HTML source file plus one or more templates. how? by teaming up the m4(1) macro processor with the xsltproc(1) XSLT processor. dream team, no cap.
here's what it recognizes as source types π
- HTML+M4 documents (
*.htm) - Cascading style sheets (
*.css-in) - M4 macro packages (
*.m4)
and from those sources? build.www.mk can generate:
- Cascading style sheets (
*.css) - HTML documents in multiple languages/character sets
- HTTP variant data (
*.html.var)
it's giving pipeline. it's giving β¨transformationβ¨.
π TARGETS π
${HTML}β the source you generate HTML documents from (it can totally include M4 macro calls and use optional XSL transforms).${CSS}β the source you generate cascading style sheets from (may include M4 macro calls, iykyk).clean-wwwβ cleans up the generated files.cleandir-wwwβ cleanup for packaging.install-wwwβ installs HTML documents into the target installation directoryHTMLDIR, overwriting any existing document ifHTML_OVERWRITEis'Yes'. and ifHTML_INSTSOURCEis'Yes', then all the files needed for re-generating the documents also get installed into the target directory (including aMakefile). full package, bestie π«Άdeinstall-wwwβ uninstalls documents from the installation directory. bye bestie π
π VARIABLES π
HTMLβ the documents to generate and install. if multilingual support isn't required, use the.htmlextension. otherwise, specify the.html.varextension (documents get generated for each combination of language and character set β and that.html.varfile may then be used directly by Apache'smod_negotiationor equivalent). lowkey powerful.M4β path to them4(1)macro processor.M4FLAGSβ extra flags to pass tom4.XSLTPROCβ path to thexsltproc(1)XSLT processor.PERLβ path to theperl(1)interpreter.ICONVβ path to theiconv(1)utility, needed to generate the character set variants.BASEDIRβ directory containing the macro files. (Default ="m4")XSLDIRβ directory containing XSLT source files. (Default ="xsl") β οΈ note thatml.xslis required for multi-lingual support.DTDβ the DTD to specify at the beginning of the generated document (defaults to HTML 4.01 Transitional).TEMPLATEβ template to use for preprocessing the HTML source. it must reside inBASEDIRand use the.m4extension.CSS_TEMPLATEβ same vibe asTEMPLATE, except it's used to preprocess CSS source.LANGUAGESβ a space-separated list of translations available for the documents specified in${HTML}. see the βMULTI-LINGUAL SUPPORTβ section for more deets πDEF_LANGUAGEβ the default language.XSLβ space-separated list of XSLT stylesheets to apply to the documents. (Default ="ml.xsl")CLEANFILESβ extra files to remove in the βcleanβ target.HTMLDIRβ installation directory. the special value'none'indicates that the βinstallβ operation should be a no-op. (Default ="none")HTML_OVERWRITEβ don't overwrite existing documents in the βinstallβ phase. (Default ="No")HTML_INSTSOURCEβ install the HTML source, templates, XSLT stylesheets and all other files needed to be able to re-generate the documents in the installation directory, including aMakefile. (Default ="Yes")
bestie warning π¨:HTMLDIRdefaults to"none", which means install is a no-op by default. don't come crying to me that nothing installed. check your variable first π
π MULTI-LINGUAL SUPPORT π
okay so the LANGUAGES variable specifies a list of languages in which the documents in HTML are available. and since the ml.xsl XSLT stylesheet is applied by default, HTML documents (usually encoded in UTF-8) can contain multiple translations in a single file. so efficient. so main character.
the language-specific parts are separated using the '<ml>' tag, like so:
<ml lang="en">Hello</ml>
<ml lang="fr">Bonjour</ml>
bonjour indeed π¦
π SEE ALSO π
β HISTORY β
build.www.mk first appeared in BSDBuild 1.0. iconic behavior.
BSDBuild is based on the 4.4BSD build system. periodt.
and that's the whole page, bestie π this one shipped from Debian and it's dated July 18, 2007 β vintage but still serving. go build something beautiful, and remember: ${HTML} is the moment, clean-www is the self-care π§
π¦ where this page comes from
- nixos 26.05: bsdbuild 3.1
- nixpkgs unstable: bsdbuild 3.1
- Copyright (c) 2008-2015 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