BUILD.WWW.MK(5)

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

πŸ’… 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 directory HTMLDIR, overwriting any existing document if HTML_OVERWRITE is 'Yes'. and if HTML_INSTSOURCE is 'Yes', then all the files needed for re-generating the documents also get installed into the target directory (including a Makefile). 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 .html extension. otherwise, specify the .html.var extension (documents get generated for each combination of language and character set β€” and that .html.var file may then be used directly by Apache's mod_negotiation or equivalent). lowkey powerful.
  • M4 β€” path to the m4(1) macro processor.
  • M4FLAGS β€” extra flags to pass to m4.
  • XSLTPROC β€” path to the xsltproc(1) XSLT processor.
  • PERL β€” path to the perl(1) interpreter.
  • ICONV β€” path to the iconv(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 that ml.xsl is 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 in BASEDIR and use the .m4 extension.
  • CSS_TEMPLATE β€” same vibe as TEMPLATE, 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 a Makefile. (Default = "Yes")
bestie warning 🚨: HTMLDIR defaults 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