aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-03-24 12:55:15 +0100
committerAlejandro Colomar <alx@kernel.org>2024-03-24 13:14:24 +0100
commit4e21945517abbffbc4b0daeeb7a54747fa55e059 (patch)
treec30b3268ac5fb081f3f6bdb0d4017aee42b0f661
parent6f2143f17bea41f7dc886b27705ede7f6f818ad7 (diff)
downloadman-pages-4e21945517abbffbc4b0daeeb7a54747fa55e059.tar.gz
share/mk/, scripts/LinuxManBook/build.sh: Embed script in the makefiles
This is done for simplifying, and as a side effect, it also allows much more control on the script (e.g., TROFFFLAGS). Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rwxr-xr-xscripts/LinuxManBook/build.sh25
-rw-r--r--share/mk/build/book.mk22
2 files changed, 12 insertions, 35 deletions
diff --git a/scripts/LinuxManBook/build.sh b/scripts/LinuxManBook/build.sh
deleted file mode 100755
index fcb8b8362b..0000000000
--- a/scripts/LinuxManBook/build.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env -Sbash
-# Copyright 2023-2024, Alejandro Colomar <alx@kernel.org>
-# SPDX-License-Identifier: GPL-3.0-or-later
-
-
-test -v CAT || CAT=cat;
-test -v PRECONV || PRECONV=preconv;
-test -v PIC || PIC=pic;
-test -v TBL || TBL=tbl;
-test -v EQN || EQN=eqn;
-test -v TROFF || TROFF=troff;
-test -v GROPDF || GROPDF=gropdf;
-
-
-(
- $CAT "$(dirname "$0")"/LMBfront.roff;
- $CAT "$(dirname "$0")"/an.tmac;
- "$(dirname "$0")"/prepare.pl "$1";
-) \
-| $PRECONV \
-| $PIC \
-| $TBL \
-| $EQN -Tpdf \
-| $TROFF -Tpdf -F"$(dirname "$0")" -dpaper=a4 \
-| $GROPDF -F"$(dirname "$0")" -pa4;
diff --git a/share/mk/build/book.mk b/share/mk/build/book.mk
index 761334fd35..5b2bf0ef64 100644
--- a/share/mk/build/book.mk
+++ b/share/mk/build/book.mk
@@ -20,7 +20,6 @@ include $(MAKEFILEDIR)/configure/version.mk
LMBDIR := $(CURDIR)/scripts/LinuxManBook
-BUILDLMB := $(LMBDIR)/build.sh
BOOK := $(DISTNAME).pdf
@@ -29,15 +28,18 @@ _BOOK := $(_BOOKDIR)/$(BOOK)
$(_BOOK): $(_MANPAGES) $(wildcard $(LMBDIR)/* $(LMBDIR)/*/*) | $$(@D)/
- $(info $(INFO_)Build $@)
- CAT='$(CAT)' \
- PRECONV='$(PRECONV)' \
- PIC='$(PIC)' \
- TBL='$(TBL)' \
- EQN='$(EQN)' \
- TROFF='$(TROFF)' \
- GROPDF='$(GROPDF)' \
- $(BUILDLMB) $(_MANDIR) \
+ $(info $(INFO_)GROPDF $@)
+ ( \
+ $(CAT) "$(LMBDIR)"/LMBfront.roff; \
+ $(CAT) "$(LMBDIR)"/an.tmac; \
+ "$(LMBDIR)"/prepare.pl "$(_MANDIR)"; \
+ ) \
+ | $(PRECONV) \
+ | $(PIC) \
+ | $(TBL) \
+ | $(EQN) -Tpdf \
+ | $(TROFF) -Tpdf -F"$(LMBDIR)" -dpaper=a4 $(TROFFFLAGS) \
+ | $(GROPDF) -F"$(LMBDIR)" -pa4 $(GROPDFFLAGS) \
| $(SPONGE) $@