blob: 380c6c6436b4b321a8a90700f3dab740be324cef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
########################################################################
# Copyright 2023, Alejandro Colomar <alx@kernel.org>
# SPDX-License-Identifier: GPL-3.0-or-later
########################################################################
ifndef MAKEFILE_BUILD_PDF_INCLUDED
MAKEFILE_BUILD_PDF_INCLUDED := 1
include $(MAKEFILEDIR)/build/_.mk
include $(MAKEFILEDIR)/build/groff.mk
include $(MAKEFILEDIR)/cmd.mk
include $(MAKEFILEDIR)/src.mk
DEFAULT_GROPDFFLAGS :=
EXTRA_GROPDFFLAGS :=
GROPDFFLAGS := $(DEFAULT_GROPDFFLAGS) $(EXTRA_GROPDFFLAGS)
GROPDF := gropdf
_PDFMAN_troff := $(patsubst $(MANDIR)/%,$(_MANDIR)/%.pdf.troff,$(NONSO_MAN) $(NONSO_MDOC))
_PDFMAN_MAN_set := $(patsubst $(MANDIR)/%,$(_MANDIR)/%.pdf.set,$(NONSO_MAN))
_PDFMAN_MDOC_set:= $(patsubst $(MANDIR)/%,$(_MANDIR)/%.pdf.set,$(NONSO_MDOC))
_PDFMAN := $(patsubst $(MANDIR)/%,$(_MANDIR)/%.pdf,$(NONSO_MAN) $(NONSO_MDOC))
$(_PDFMAN_troff): %.pdf.troff: %.eqn | $$(@D)/
$(info EQN $@)
! ($(EQN) -Tpdf $(EQNFLAGS) <$< 2>&1 >$@) \
| $(GREP) ^ >&2
$(_PDFMAN_MAN_set): %.pdf.set: %.pdf.troff | $$(@D)/
$(info TROFF $@)
! ($(TROFF) -Tpdf $(TROFFFLAGS_MAN) <$< 2>&1 >$@) \
| $(GREP) ^ >&2
$(_PDFMAN_MDOC_set): %.pdf.set: %.pdf.troff | $$(@D)/
$(info TROFF $@)
! ($(TROFF) -Tpdf $(TROFFFLAGS_MDOC) <$< 2>&1 >$@) \
| $(GREP) ^ >&2
$(_PDFMAN): %.pdf: %.pdf.set | $$(@D)/
$(info GROPDF $@)
$(GROPDF) $(GROPDFFLAGS) <$< >$@
.PHONY: build-pdf-eqn
build-pdf-eqn: $(_PDFMAN_troff);
.PHONY: build-pdf-troff-man
build-pdf-troff-man: $(_PDFMAN_MAN_set);
.PHONY: build-pdf-troff-mdoc
build-pdf-troff-mdoc: $(_PDFMAN_MDOC_set);
.PHONY: build-pdf-troff
build-pdf-troff: build-pdf-troff-man build-pdf-troff-mdoc;
.PHONY: build-pdf-gropdf
build-pdf-gropdf: $(_PDFMAN);
.PHONY: build-pdf
build-pdf: build-pdf-gropdf;
endif # include guard
|