Documentation: Update 4.21 release notes for upcoming release
[coreboot.git] / Documentation / Makefile
blob54306a278cb2c78ae62647b7c2258393b8e5c466
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
8 BUILDDIR ?= _build
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)),)
20 svg2pdf $< $@
21 else ifneq ($(strip $(INKSCAPE)),)
22 inkscape $< --export-pdf=$@
23 else ifneq ($(strip $(CONVERT)),)
24 convert $< $@
25 endif
27 hypertransport.pdf: hypertransport.svg
28 ifneq ($(strip $(SVG2PDF)),)
29 svg2pdf $< $@
30 else ifneq ($(strip $(INKSCAPE)),)
31 inkscape $< --export-pdf=$@
32 else ifneq ($(strip $(CONVERT)),)
33 convert $< $@
34 endif
36 $(BUILDDIR):
37 mkdir -p $(BUILDDIR)
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
47 sphinx: $(BUILDDIR)
48 $(MAKE) -f Makefile.sphinx html BUILDDIR="$(BUILDDIR)"
50 clean-sphinx:
51 $(MAKE) -f Makefile.sphinx clean BUILDDIR="$(BUILDDIR)"
53 clean: clean-sphinx
54 rm -f *.aux *.idx *.log *.toc *.out $(FIGS)
56 distclean: clean
57 rm -f corebootPortingGuide.pdf
59 livesphinx: $(BUILDDIR)
60 $(MAKE) -f Makefile.sphinx livehtml SPHINXOPTS="$(SPHINXOPTS)" BUILDDIR="$(BUILDDIR)"
62 test:
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
67 help:
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"
74 @echo
75 @echo " Makefile.sphinx builds - run with $(MAKE) -f Makefile-sphinx [target]"
76 @echo
77 @$(MAKE) -s -f Makefile.sphinx help 2>/dev/null
79 .phony: help livesphinx sphinx test
80 .phony: distclean clean clean-sphinx