blob: ec1e1a4d35d86f04f0e5c816ef012d9ae254ca0c [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
Felix Singerf036b1d2023-06-16 06:26:05 +02007BUILDDIR ?= _build
Simon Glass7de2fa32023-08-21 13:08:00 -06008SPHINXOPTS ?= -j auto
9
10export SPHINXOPTS
Stefan Reinauer37414ca2003-11-22 15:15:47 +000011
Felix Singer60be9fe2023-08-25 15:40:25 +000012all: sphinx
Stefan Reinauer37414ca2003-11-22 15:15:47 +000013
Felix Singerf036b1d2023-06-16 06:26:05 +020014$(BUILDDIR):
15 mkdir -p $(BUILDDIR)
Martin Roth4d8da8e2023-05-29 23:09:54 -060016
Felix Singerf036b1d2023-06-16 06:26:05 +020017sphinx: $(BUILDDIR)
18 $(MAKE) -f Makefile.sphinx html BUILDDIR="$(BUILDDIR)"
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +020019
20clean-sphinx:
Felix Singerf036b1d2023-06-16 06:26:05 +020021 $(MAKE) -f Makefile.sphinx clean BUILDDIR="$(BUILDDIR)"
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +020022
23clean: clean-sphinx
Jonathan Neuschäferbdebc892018-09-25 23:15:16 +020024 rm -f *.aux *.idx *.log *.toc *.out $(FIGS)
Stefan Reinauer37414ca2003-11-22 15:15:47 +000025
26distclean: clean
Jonathan Neuschäferbdebc892018-09-25 23:15:16 +020027 rm -f corebootPortingGuide.pdf
Tom Hiller651b11b2018-08-18 19:20:16 -040028
Felix Singerf036b1d2023-06-16 06:26:05 +020029livesphinx: $(BUILDDIR)
Simon Glass7de2fa32023-08-21 13:08:00 -060030 $(MAKE) -f Makefile.sphinx livehtml BUILDDIR="$(BUILDDIR)"
Martin Rothe441b312023-05-29 23:02:10 -060031
Martin Roth34e43f62023-05-29 23:05:09 -060032test:
33 @echo "Test for logging purposes - Failing tests will not fail the build"
34 -$(MAKE) -f Makefile.sphinx clean && $(MAKE) -K -f Makefile.sphinx html
35 -$(MAKE) -f Makefile.sphinx clean && $(MAKE) -K -f Makefile.sphinx doctest
36
Martin Rothe441b312023-05-29 23:02:10 -060037help:
Felix Singer60be9fe2023-08-25 15:40:25 +000038 @echo "all - Builds all documentation targets"
Martin Rothe441b312023-05-29 23:02:10 -060039 @echo "sphinx - Builds html documentation in _build directory"
40 @echo "clean - Cleans intermediate files"
41 @echo "clean-sphinx - Removes sphinx output files"
42 @echo "distclean - Removes PDF files as well"
Martin Roth34e43f62023-05-29 23:05:09 -060043 @echo "test - Runs documentation tests"
Martin Rothe441b312023-05-29 23:02:10 -060044 @echo
45 @echo " Makefile.sphinx builds - run with $(MAKE) -f Makefile-sphinx [target]"
46 @echo
47 @$(MAKE) -s -f Makefile.sphinx help 2>/dev/null
48
49.phony: help livesphinx sphinx test
50.phony: distclean clean clean-sphinx