mirror of
https://github.com/freedoom/freedoom.git
synced 2025-08-31 20:16:55 -04:00
manual: Add build targets for printable manual
Specifying `media=print` changes Asciidoctor so that URLs are included inline in a way that can be read in printed media. For printed manuals this is obviously what we want, though we should still keep the regular version around for the binary distributions, since they retain the internal links.
This commit is contained in:
parent
398a7c01f4
commit
9979dacb09
1 changed files with 9 additions and 1 deletions
|
@ -11,11 +11,15 @@
|
||||||
ASCIIDOCTOR_FLAGS = -a pdf-page-size=A5
|
ASCIIDOCTOR_FLAGS = -a pdf-page-size=A5
|
||||||
MANUAL_ADOC_FILES=$(wildcard freedoom-manual-??.adoc)
|
MANUAL_ADOC_FILES=$(wildcard freedoom-manual-??.adoc)
|
||||||
MANUAL_PDF_FILES=$(subst .adoc,.pdf,$(MANUAL_ADOC_FILES))
|
MANUAL_PDF_FILES=$(subst .adoc,.pdf,$(MANUAL_ADOC_FILES))
|
||||||
|
PRINT_PDF_FILES=$(subst .adoc,-print.pdf,$(MANUAL_ADOC_FILES))
|
||||||
COVER_PDF_FILES=cover-en.pdf cover-es.pdf cover-fr.pdf
|
COVER_PDF_FILES=cover-en.pdf cover-es.pdf cover-fr.pdf
|
||||||
COVER_SVG_FILES=$(patsubst %.pdf,cover/%.svg,$(COVER_PDF_FILES))
|
COVER_SVG_FILES=$(patsubst %.pdf,cover/%.svg,$(COVER_PDF_FILES))
|
||||||
|
|
||||||
all: $(MANUAL_PDF_FILES)
|
all: $(MANUAL_PDF_FILES)
|
||||||
|
|
||||||
|
# `make print` builds all the PDFs for printed versions of the manuals.
|
||||||
|
print: covers $(PRINT_PDF_FILES)
|
||||||
|
|
||||||
# We only build the cover PDFs if the user explicitly runs `make covers`;
|
# We only build the cover PDFs if the user explicitly runs `make covers`;
|
||||||
# this is because it requires Inkscape and we don't want it as a build
|
# this is because it requires Inkscape and we don't want it as a build
|
||||||
# dependency. Most users won't ever need these, we only use them when we're
|
# dependency. Most users won't ever need these, we only use them when we're
|
||||||
|
@ -25,6 +29,9 @@ covers: $(COVER_PDF_FILES)
|
||||||
freedoom-manual-%.pdf: freedoom-manual-%.adoc
|
freedoom-manual-%.pdf: freedoom-manual-%.adoc
|
||||||
-asciidoctor-pdf $(ASCIIDOCTOR_FLAGS) $< -o $@
|
-asciidoctor-pdf $(ASCIIDOCTOR_FLAGS) $< -o $@
|
||||||
|
|
||||||
|
freedoom-manual-%-print.pdf: freedoom-manual-%.adoc
|
||||||
|
-asciidoctor-pdf $(ASCIIDOCTOR_FLAGS) -a media=print $< -o $@
|
||||||
|
|
||||||
cover/cover-%.svg: cover/cover-%.sed cover/template.svg
|
cover/cover-%.svg: cover/cover-%.sed cover/template.svg
|
||||||
sed -f $< < cover/template.svg > $@
|
sed -f $< < cover/template.svg > $@
|
||||||
|
|
||||||
|
@ -32,7 +39,8 @@ cover-%.pdf: cover/cover-%.svg cover/serpentipede.png cover/minigunner.png
|
||||||
inkscape -o $@ $<
|
inkscape -o $@ $<
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(MANUAL_PDF_FILES) $(COVER_PDF_FILES) $(COVER_SVG_FILES)
|
$(RM) $(MANUAL_PDF_FILES) $(COVER_PDF_FILES) $(COVER_SVG_FILES) \
|
||||||
|
$(PRINT_PDF_FILES)
|
||||||
|
|
||||||
# Inkscape can't process files in parallel, it has to be sequential:
|
# Inkscape can't process files in parallel, it has to be sequential:
|
||||||
.NOTPARALLEL: covers
|
.NOTPARALLEL: covers
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue