The module generates a set of HTML documents (or code fragments), possibly in multiple language variants, from an HTML source file. The HTML source is processed by m4 macro processor in conjunction with the multi-language preprocessor mlproc. The following source types are recognized:
  • HTML4/HTML5 + M4 sources (*.htm)
  • M4 macro packages (*.m4)
  • JavaScript sources (*.js)
  • Cascading style sheets (*.css-in)

From those sources, is able to generate:
  • Minified HTML documents/fragments (*.html.<lang>)
  • Matching HTTP variant data (*.html.var)
  • Minified, translated JavaScript (*.<lang>.js)
  • Minified cascading style sheets (*.css)

${HTML} Source from which to generate HTML documents. The source may include M4 macro calls, multi-language "<ml>" tags, and "$_(gettext)" sequences (see mlproc for details).
${JS} JavaScript source files. The source is only fed through mlproc, and may include "$_(gettext)" sequences.
${CSS} Source from which to generate cascading style sheets (may include M4 macro calls).
clean-www Clean up the generated files.
cleandir-www Clean up for packaging.
install-www Install HTML documents to the target installation directory HTMLDIR, overwriting any existing document if HTML_OVERWRITE is Yes. If HTML_INSTSOURCE is Yes, all files needed for re-generating the documents are also installed into the target directory (including a Makefile).
deinstall-www Uninstall documents from the installation directory.

HTML Documents to generate and install. If multilingual support is not required, use the .html extension. Otherwise, specify the .html.var extension (documents will be generated for each combination of language and character set -- the .html.var file may then be used directly by Apache's mod_negotiation or equivalent).
M4 Path to the m4 macro processor.
M4FLAGS Extra flags to pass to m4.
MINIFIER Path to HTML/CSS minifier (such as html-minifier).
MINIFIERFLAGS Flags to minifier (for HTML).
MINIFIERFLAGSCSS Flags to minifier (for CSS).
MLPROC Path to the mlproc preprocessor (part of BSDBuild).
MLPROCFLAGS Arguments to mlproc. For gettext-style translation, the -L and -D arguments should be specified.
PERL Path to the perl interpreter.
ICONV Path to the iconv utility, needed to generate the character set variants.
BASEDIR Directory containing the macro files (Default = "m4").
DTD Insert at beginning of generated documents (default: "<!DOCTYPE html>").
TEMPLATE Template to use for preprocessing the HTML source. It must reside in BASEDIR and use the .m4 extension.
CSS_TEMPLATE Similarly to TEMPLATE, but used to preprocess CSS source.
LANGUAGES Space-separated list of translations available for the documents specified in ${HTML}. See the section MULTI-LINGUAL SUPPORT for more details.
DEF_LANGUAGE The default language.
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, JS/stylesheets and all other files needed to be able to re-generate the documents in the installation directory, including a Makefile. (Default = "Yes").

The LANGUAGES variable specifies a list of languages in which the documents specified in HTML are available. If documents are fed to mlproc (the default), they may contain translations enclosed in <ml> tags, like so:
	<ml lang="en">Hello</ml>
	<ml lang="fr">Bonjour</ml>

Sequences such as "$_(foo)" will also be translated using gettext (see mlproc for details).


HISTORY first appeared in BSDBuild 1.0.

BSDBuild is based on the 4.4BSD build system.