blob: 17aec29450aeff624fe7a47a0a5bb32b606447f7 [file] [log] [blame]
Martin Rothbfdb4892022-10-28 22:25:02 -06001## SPDX-License-Identifier: GPL-2.0-only
Stefan Reinauer37414ca2003-11-22 15:15:47 +00002#
Uwe Hermannd2a5a5a2009-04-18 14:18:20 +00003# Makefile for coreboot paper.
Stefan Reinauer37414ca2003-11-22 15:15:47 +00004# hacked together by Stefan Reinauer <stepan@openbios.org>
5#
6
7PDFLATEX=pdflatex -t a4
8
9FIGS=codeflow.pdf hypertransport.pdf
10
Martin Roth3b891022023-05-29 23:06:52 -060011all: sphinx corebootPortingGuide.pdf
Stefan Reinauer37414ca2003-11-22 15:15:47 +000012
Martin Rothfd8854e2023-02-10 09:56:40 -070013SVG2PDF=$(shell command -v svg2pdf)
14INKSCAPE=$(shell command -v inkscape)
15CONVERT=$(shell command -v convert)
Stefan Reinauer37414ca2003-11-22 15:15:47 +000016
Stefan Reinauerebf25892009-04-21 21:45:11 +000017codeflow.pdf: codeflow.svg
Uwe Hermann67ee8f82009-05-12 14:24:25 +000018ifneq ($(strip $(SVG2PDF)),)
Stefan Reinauerebf25892009-04-21 21:45:11 +000019 svg2pdf $< $@
Uwe Hermann67ee8f82009-05-12 14:24:25 +000020else ifneq ($(strip $(INKSCAPE)),)
21 inkscape $< --export-pdf=$@
22else ifneq ($(strip $(CONVERT)),)
23 convert $< $@
24endif
Stefan Reinauer37414ca2003-11-22 15:15:47 +000025
Stefan Reinauerebf25892009-04-21 21:45:11 +000026hypertransport.pdf: hypertransport.svg
Uwe Hermann67ee8f82009-05-12 14:24:25 +000027ifneq ($(strip $(SVG2PDF)),)
Stefan Reinauerebf25892009-04-21 21:45:11 +000028 svg2pdf $< $@
Uwe Hermann67ee8f82009-05-12 14:24:25 +000029else ifneq ($(strip $(INKSCAPE)),)
30 inkscape $< --export-pdf=$@
31else ifneq ($(strip $(CONVERT)),)
32 convert $< $@
33endif
Stefan Reinauer37414ca2003-11-22 15:15:47 +000034
Martin Roth4b18a922017-06-03 20:16:01 -060035corebootPortingGuide.toc: $(FIGS) corebootBuildingGuide.tex
Stefan Reinauer37414ca2003-11-22 15:15:47 +000036 # 2 times to make sure we have a current toc.
Martin Roth4b18a922017-06-03 20:16:01 -060037 $(PDFLATEX) corebootBuildingGuide.tex
38 $(PDFLATEX) corebootBuildingGuide.tex
Stefan Reinauer37414ca2003-11-22 15:15:47 +000039
Martin Roth4b18a922017-06-03 20:16:01 -060040corebootPortingGuide.pdf: $(FIGS) corebootBuildingGuide.tex corebootPortingGuide.toc
41 $(PDFLATEX) corebootBuildingGuide.tex
Stefan Reinauer37414ca2003-11-22 15:15:47 +000042
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +020043sphinx:
44 $(MAKE) -f Makefile.sphinx html
45
46clean-sphinx:
47 $(MAKE) -f Makefile.sphinx clean
48
49clean: clean-sphinx
Jonathan Neuschäferbdebc892018-09-25 23:15:16 +020050 rm -f *.aux *.idx *.log *.toc *.out $(FIGS)
Stefan Reinauer37414ca2003-11-22 15:15:47 +000051
52distclean: clean
Jonathan Neuschäferbdebc892018-09-25 23:15:16 +020053 rm -f corebootPortingGuide.pdf
Tom Hiller651b11b2018-08-18 19:20:16 -040054
55livesphinx:
Patrick Georgi0cd93662019-01-28 19:23:40 +010056 $(MAKE) -f Makefile.sphinx livehtml SPHINXOPTS="$(SPHINXOPTS)"
Martin Rothe441b312023-05-29 23:02:10 -060057
Martin Roth34e43f62023-05-29 23:05:09 -060058test:
59 @echo "Test for logging purposes - Failing tests will not fail the build"
60 -$(MAKE) -f Makefile.sphinx clean && $(MAKE) -K -f Makefile.sphinx html
61 -$(MAKE) -f Makefile.sphinx clean && $(MAKE) -K -f Makefile.sphinx doctest
62
Martin Rothe441b312023-05-29 23:02:10 -060063help:
64 @echo "all - Builds coreboot porting guide PDF (outdated)"
65 @echo "sphinx - Builds html documentation in _build directory"
66 @echo "clean - Cleans intermediate files"
67 @echo "clean-sphinx - Removes sphinx output files"
68 @echo "distclean - Removes PDF files as well"
Martin Roth34e43f62023-05-29 23:05:09 -060069 @echo "test - Runs documentation tests"
Martin Rothe441b312023-05-29 23:02:10 -060070 @echo
71 @echo " Makefile.sphinx builds - run with $(MAKE) -f Makefile-sphinx [target]"
72 @echo
73 @$(MAKE) -s -f Makefile.sphinx help 2>/dev/null
74
75.phony: help livesphinx sphinx test
76.phony: distclean clean clean-sphinx