Martin Roth | bfdb489 | 2022-10-28 22:25:02 -0600 | [diff] [blame] | 1 | ## SPDX-License-Identifier: GPL-2.0-only |
Stefan Reinauer | 37414ca | 2003-11-22 15:15:47 +0000 | [diff] [blame] | 2 | # |
Uwe Hermann | d2a5a5a | 2009-04-18 14:18:20 +0000 | [diff] [blame] | 3 | # Makefile for coreboot paper. |
Stefan Reinauer | 37414ca | 2003-11-22 15:15:47 +0000 | [diff] [blame] | 4 | # hacked together by Stefan Reinauer <stepan@openbios.org> |
| 5 | # |
| 6 | |
Felix Singer | f036b1d | 2023-06-16 06:26:05 +0200 | [diff] [blame] | 7 | BUILDDIR ?= _build |
Simon Glass | 7de2fa3 | 2023-08-21 13:08:00 -0600 | [diff] [blame] | 8 | SPHINXOPTS ?= -j auto |
| 9 | |
| 10 | export SPHINXOPTS |
Stefan Reinauer | 37414ca | 2003-11-22 15:15:47 +0000 | [diff] [blame] | 11 | |
Felix Singer | 60be9fe | 2023-08-25 15:40:25 +0000 | [diff] [blame^] | 12 | all: sphinx |
Stefan Reinauer | 37414ca | 2003-11-22 15:15:47 +0000 | [diff] [blame] | 13 | |
Felix Singer | f036b1d | 2023-06-16 06:26:05 +0200 | [diff] [blame] | 14 | $(BUILDDIR): |
| 15 | mkdir -p $(BUILDDIR) |
Martin Roth | 4d8da8e | 2023-05-29 23:09:54 -0600 | [diff] [blame] | 16 | |
Felix Singer | f036b1d | 2023-06-16 06:26:05 +0200 | [diff] [blame] | 17 | sphinx: $(BUILDDIR) |
| 18 | $(MAKE) -f Makefile.sphinx html BUILDDIR="$(BUILDDIR)" |
Jonathan Neuschäfer | 5e48c75 | 2018-04-19 16:23:56 +0200 | [diff] [blame] | 19 | |
| 20 | clean-sphinx: |
Felix Singer | f036b1d | 2023-06-16 06:26:05 +0200 | [diff] [blame] | 21 | $(MAKE) -f Makefile.sphinx clean BUILDDIR="$(BUILDDIR)" |
Jonathan Neuschäfer | 5e48c75 | 2018-04-19 16:23:56 +0200 | [diff] [blame] | 22 | |
| 23 | clean: clean-sphinx |
Jonathan Neuschäfer | bdebc89 | 2018-09-25 23:15:16 +0200 | [diff] [blame] | 24 | rm -f *.aux *.idx *.log *.toc *.out $(FIGS) |
Stefan Reinauer | 37414ca | 2003-11-22 15:15:47 +0000 | [diff] [blame] | 25 | |
| 26 | distclean: clean |
Jonathan Neuschäfer | bdebc89 | 2018-09-25 23:15:16 +0200 | [diff] [blame] | 27 | rm -f corebootPortingGuide.pdf |
Tom Hiller | 651b11b | 2018-08-18 19:20:16 -0400 | [diff] [blame] | 28 | |
Felix Singer | f036b1d | 2023-06-16 06:26:05 +0200 | [diff] [blame] | 29 | livesphinx: $(BUILDDIR) |
Simon Glass | 7de2fa3 | 2023-08-21 13:08:00 -0600 | [diff] [blame] | 30 | $(MAKE) -f Makefile.sphinx livehtml BUILDDIR="$(BUILDDIR)" |
Martin Roth | e441b31 | 2023-05-29 23:02:10 -0600 | [diff] [blame] | 31 | |
Martin Roth | 34e43f6 | 2023-05-29 23:05:09 -0600 | [diff] [blame] | 32 | test: |
| 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 Roth | e441b31 | 2023-05-29 23:02:10 -0600 | [diff] [blame] | 37 | help: |
Felix Singer | 60be9fe | 2023-08-25 15:40:25 +0000 | [diff] [blame^] | 38 | @echo "all - Builds all documentation targets" |
Martin Roth | e441b31 | 2023-05-29 23:02:10 -0600 | [diff] [blame] | 39 | @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 Roth | 34e43f6 | 2023-05-29 23:05:09 -0600 | [diff] [blame] | 43 | @echo "test - Runs documentation tests" |
Martin Roth | e441b31 | 2023-05-29 23:02:10 -0600 | [diff] [blame] | 44 | @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 |