xref: /aosp_15_r20/external/coreboot/Documentation/Makefile (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1## SPDX-License-Identifier: GPL-2.0-only
2#
3# Makefile for coreboot paper.
4# hacked together by Stefan Reinauer <[email protected]>
5#
6
7BUILDDIR ?= _build
8SPHINXOPTS ?= -j auto
9
10export SPHINXOPTS
11
12all: sphinx
13
14$(BUILDDIR):
15	mkdir -p $(BUILDDIR)
16
17sphinx: $(BUILDDIR)
18	$(MAKE) -f Makefile.sphinx html BUILDDIR="$(BUILDDIR)"
19
20clean-sphinx:
21	$(MAKE) -f Makefile.sphinx clean BUILDDIR="$(BUILDDIR)"
22
23clean: clean-sphinx
24	rm -f *.aux *.idx *.log *.toc *.out $(FIGS)
25
26distclean: clean
27	rm -f corebootPortingGuide.pdf
28
29livesphinx: $(BUILDDIR)
30	$(MAKE) -f Makefile.sphinx livehtml BUILDDIR="$(BUILDDIR)"
31
32test:
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
36help:
37	@echo "all            - Builds all documentation targets"
38	@echo "sphinx         - Builds html documentation in _build directory"
39	@echo "clean          - Cleans intermediate files"
40	@echo "clean-sphinx   - Removes sphinx output files"
41	@echo "distclean      - Removes PDF files as well"
42	@echo "test           - Runs documentation tests"
43	@echo
44	@echo "  Makefile.sphinx builds - run with $(MAKE) -f Makefile-sphinx [target]"
45	@echo
46	@$(MAKE) -s -f Makefile.sphinx help 2>/dev/null
47
48.phony: help livesphinx sphinx test
49.phony: distclean clean clean-sphinx
50