aboutsummaryrefslogtreecommitdiff
path: root/documentation/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/Makefile')
-rw-r--r--documentation/Makefile47
1 files changed, 29 insertions, 18 deletions
diff --git a/documentation/Makefile b/documentation/Makefile
index 457f6add0b..2ca9c0c82a 100644
--- a/documentation/Makefile
+++ b/documentation/Makefile
@@ -1,19 +1,20 @@
# Generate the FreeBSD documentation
#
-# Copyright (c) 2020-2022, The FreeBSD Documentation Project
-# Copyright (c) 2020-2022, Sergio Carlavilla <carlavilla@FreeBSD.org>
+# Copyright (c) 2020-2025, The FreeBSD Documentation Project
+# Copyright (c) 2020-2025, Sergio Carlavilla <carlavilla@FreeBSD.org>
#
# Targets intended for use on the command line
#
-# all (default) - generate the books TOC and compile all the documentation
+# all (default) - generate books and articles without generating the
+# PDFs or EPUBs
# clean - removes generated files
# run - serves the built documentation site for local browsing
# pdf - build PDF versions of the articles and books.
# html - build HTML versions of the articles and books for
-# offline use.
-# If variable DOC_HTML_ARCHIVE is set, all documents will be
-# archived/compressed, and only these files will be kept in the public
-# directory.
+# offline use.
+# If variable DOC_HTML_ARCHIVE is set, all documents will be
+# archived/compressed, and only these files will be kept in the
+# public directory.
# epub - build EPUB versions of the articles and books (Experimental).
#
# The run target uses hugo's built-in webserver to make the documentation site
@@ -32,13 +33,23 @@ BOOKONLY_LANGS= mn
ALL_LANGUAGES= bn-bd da de el en es fr hu id it ja ko mn nl pl pt-br ru tr zh-cn zh-tw
LOCALBASE?= /usr/local
+USE_RUBYGEMS?= NO
+GEM_PATH?=
-RUBY_CMD = ${LOCALBASE}/bin/ruby
+.if ${USE_RUBYGEMS} == "YES"
+GEMBASE?= ${GEM_PATH}
+.else
+GEMBASE?= ${LOCALBASE}
+.endif
+
+RUBY_CMD ?= ${LOCALBASE}/bin/ruby
HUGO_CMD = ${LOCALBASE}/bin/hugo
-HUGO_ARGS?= --verbose --minify
-HUGO_OFFLINE_ARGS?= --environment offline --verbose --minify
-ASCIIDOCTOR_CMD= ${LOCALBASE}/bin/asciidoctor
-ASCIIDOCTORPDF_CMD= ${LOCALBASE}/bin/asciidoctor-pdf
+HUGO_ARGS?= --minify
+HUGO_OFFLINE_ARGS?= --environment offline --minify
+ROUGIFY_CMD= ${GEMBASE}/bin/rougify
+ASCIIDOCTOR_CMD= ${GEMBASE}/bin/asciidoctor
+ASCIIDOCTORPDF_CMD= ${GEMBASE}/bin/asciidoctor-pdf
+ASCIIDOCTOREPUB3_CMD= ${GEMBASE}/bin/asciidoctor-epub3
.if defined(DOC_LANG) && !empty(DOC_LANG)
LANGUAGES= ${DOC_LANG:S/,/ /g}
@@ -54,8 +65,8 @@ RUBYLIB = ../shared/lib
.export RUBYLIB
RUN_DEPENDS= ${HUGO_CMD} \
- ${LOCALBASE}/bin/asciidoctor \
- ${LOCALBASE}/bin/rougify
+ ${ASCIIDOCTOR_CMD} \
+ ${ROUGIFY_CMD}
.ifndef HOSTNAME
. ifdef BIND
@@ -111,13 +122,13 @@ requirements:
.endfor
requirements-pdf:
-.if !exists(${LOCALBASE}/bin/asciidoctor-pdf)
- @(echo ${LOCALBASE}/bin/asciidoctor-pdf not found, please run 'pkg install rubygem-asciidoctor-pdf'; exit 1)
+.if !exists(${ASCIIDOCTORPDF_CMD})
+ @(echo ${ASCIIDOCTOR_CMD} not found, please install rubygem-asciidoctor-pdf; exit 1)
.endif
requirements-epub:
-.if !exists(${LOCALBASE}/bin/asciidoctor-epub3)
- @(echo ${LOCALBASE}/bin/asciidoctor-epub3 not found, please run 'pkg install rubygem-asciidoctor-epub3'; exit 1)
+.if !exists(${ASCIIDOCTOREPUB3_CMD})
+ @(echo ${ASCIIDOCTOREPUB3_CMD} not found, please install rubygem-asciidoctor-epub3; exit 1)
.endif
starting-message: .PHONY