1 ## SPDX-License-Identifier: GPL-2.0-only
3 # Makefile for coreboot paper.
4 # hacked together by Stefan Reinauer <stepan@openbios.org>
7 PDFLATEX
= pdflatex
-t a4
10 FIGS
=codeflow.pdf hypertransport.pdf
12 all: sphinx corebootPortingGuide.pdf
14 SVG2PDF
=$(shell command
-v svg2pdf
)
15 INKSCAPE
=$(shell command
-v inkscape
)
16 CONVERT
=$(shell command
-v convert
)
18 codeflow.pdf
: codeflow.svg
19 ifneq ($(strip $(SVG2PDF
)),)
21 else ifneq ($(strip $(INKSCAPE
)),)
22 inkscape
$< --export-pdf
=$@
23 else ifneq ($(strip $(CONVERT
)),)
27 hypertransport.pdf
: hypertransport.svg
28 ifneq ($(strip $(SVG2PDF
)),)
30 else ifneq ($(strip $(INKSCAPE
)),)
31 inkscape
$< --export-pdf
=$@
32 else ifneq ($(strip $(CONVERT
)),)
39 corebootPortingGuide.toc
: $(FIGS
) corebootBuildingGuide.
tex
40 # 2 times to make sure we have a current toc.
41 $(PDFLATEX
) corebootBuildingGuide.
tex
42 $(PDFLATEX
) corebootBuildingGuide.
tex
44 corebootPortingGuide.pdf
: $(FIGS
) corebootBuildingGuide.
tex corebootPortingGuide.toc
45 $(PDFLATEX
) corebootBuildingGuide.
tex
48 $(MAKE
) -f Makefile.sphinx html BUILDDIR
="$(BUILDDIR)"
51 $(MAKE
) -f Makefile.sphinx
clean BUILDDIR
="$(BUILDDIR)"
54 rm -f
*.aux
*.idx
*.log
*.toc
*.out
$(FIGS
)
57 rm -f corebootPortingGuide.pdf
59 livesphinx
: $(BUILDDIR
)
60 $(MAKE
) -f Makefile.sphinx livehtml SPHINXOPTS
="$(SPHINXOPTS)" BUILDDIR
="$(BUILDDIR)"
63 @echo
"Test for logging purposes - Failing tests will not fail the build"
64 -$(MAKE
) -f Makefile.sphinx
clean && $(MAKE
) -K
-f Makefile.sphinx html
65 -$(MAKE
) -f Makefile.sphinx
clean && $(MAKE
) -K
-f Makefile.sphinx doctest
68 @echo
"all - Builds coreboot porting guide PDF (outdated)"
69 @echo
"sphinx - Builds html documentation in _build directory"
70 @echo
"clean - Cleans intermediate files"
71 @echo
"clean-sphinx - Removes sphinx output files"
72 @echo
"distclean - Removes PDF files as well"
73 @echo
"test - Runs documentation tests"
75 @echo
" Makefile.sphinx builds - run with $(MAKE) -f Makefile-sphinx [target]"
77 @
$(MAKE
) -s
-f Makefile.sphinx help
2>/dev
/null
79 .phony
: help livesphinx sphinx
test
80 .phony
: distclean clean clean-sphinx