summaryrefslogtreecommitdiffstats
path: root/Documentation/Makefile
blob: ec1e1a4d35d86f04f0e5c816ef012d9ae254ca0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
## SPDX-License-Identifier: GPL-2.0-only
#
# Makefile for coreboot paper.
# hacked together by Stefan Reinauer <stepan@openbios.org>
#

BUILDDIR ?= _build
SPHINXOPTS ?= -j auto

export SPHINXOPTS

all: sphinx

$(BUILDDIR):
	mkdir -p $(BUILDDIR)

sphinx: $(BUILDDIR)
	$(MAKE) -f Makefile.sphinx html BUILDDIR="$(BUILDDIR)"

clean-sphinx:
	$(MAKE) -f Makefile.sphinx clean BUILDDIR="$(BUILDDIR)"

clean: clean-sphinx
	rm -f *.aux *.idx *.log *.toc *.out $(FIGS)

distclean: clean
	rm -f corebootPortingGuide.pdf

livesphinx: $(BUILDDIR)
	$(MAKE) -f Makefile.sphinx livehtml BUILDDIR="$(BUILDDIR)"

test:
	@echo "Test for logging purposes - Failing tests will not fail the build"
	-$(MAKE) -f Makefile.sphinx clean && $(MAKE) -K -f Makefile.sphinx html
	-$(MAKE) -f Makefile.sphinx clean && $(MAKE) -K -f Makefile.sphinx doctest

help:
	@echo "all            - Builds all documentation targets"
	@echo "sphinx         - Builds html documentation in _build directory"
	@echo "clean          - Cleans intermediate files"
	@echo "clean-sphinx   - Removes sphinx output files"
	@echo "distclean      - Removes PDF files as well"
	@echo "test           - Runs documentation tests"
	@echo
	@echo "  Makefile.sphinx builds - run with $(MAKE) -f Makefile-sphinx [target]"
	@echo
	@$(MAKE) -s -f Makefile.sphinx help 2>/dev/null

.phony: help livesphinx sphinx test
.phony: distclean clean clean-sphinx