summaryrefslogtreecommitdiffstats
path: root/share/mk/build/catman/eqn.mk
diff options
context:
space:
mode:
Diffstat (limited to 'share/mk/build/catman/eqn.mk')
-rw-r--r--share/mk/build/catman/eqn.mk27
1 files changed, 27 insertions, 0 deletions
diff --git a/share/mk/build/catman/eqn.mk b/share/mk/build/catman/eqn.mk
new file mode 100644
index 0000000..48b6e75
--- /dev/null
+++ b/share/mk/build/catman/eqn.mk
@@ -0,0 +1,27 @@
+# Copyright 2021-2024, Alejandro Colomar <alx@kernel.org>
+# SPDX-License-Identifier: LGPL-3.0-only WITH LGPL-3.0-linking-exception
+
+
+ifndef MAKEFILE_BUILD_CATMAN_EQN_INCLUDED
+MAKEFILE_BUILD_CATMAN_EQN_INCLUDED := 1
+
+
+include $(MAKEFILEDIR)/build/pre/tbl.mk
+include $(MAKEFILEDIR)/configure/build-depends/grep.mk
+include $(MAKEFILEDIR)/configure/build-depends/groff-base.mk
+
+
+_CATMAN_troff := $(patsubst %.eqn,%.cat.troff,$(_MAN_eqn))
+
+
+$(_CATMAN_troff): %.cat.troff: %.eqn $(MK) | $$(@D)/
+ $(info $(INFO_)EQN $@)
+ ! ($(EQN) -T$(NROFF_OUT_DEVICE) $(EQNFLAGS) <$< 2>&1 >$@) \
+ | $(GREP) ^ >&2
+
+
+.PHONY: build-catman-eqn
+build-catman-eqn: $(_CATMAN_troff);
+
+
+endif # include guard