2022-10-29 06:25:02 +02:00
|
|
|
## SPDX-License-Identifier: GPL-2.0-only
|
2003-11-22 16:15:47 +01:00
|
|
|
#
|
2009-04-18 16:18:20 +02:00
|
|
|
# Makefile for coreboot paper.
|
2003-11-22 16:15:47 +01:00
|
|
|
# hacked together by Stefan Reinauer <stepan@openbios.org>
|
|
|
|
#
|
|
|
|
|
2023-05-30 07:09:54 +02:00
|
|
|
PDFLATEX = pdflatex -t a4
|
2023-06-16 06:26:05 +02:00
|
|
|
BUILDDIR ?= _build
|
2023-08-21 21:08:00 +02:00
|
|
|
SPHINXOPTS ?= -j auto
|
|
|
|
|
|
|
|
export SPHINXOPTS
|
2003-11-22 16:15:47 +01:00
|
|
|
|
|
|
|
FIGS=codeflow.pdf hypertransport.pdf
|
|
|
|
|
2023-05-30 07:06:52 +02:00
|
|
|
all: sphinx corebootPortingGuide.pdf
|
2003-11-22 16:15:47 +01:00
|
|
|
|
2023-02-10 17:56:40 +01:00
|
|
|
SVG2PDF=$(shell command -v svg2pdf)
|
|
|
|
INKSCAPE=$(shell command -v inkscape)
|
|
|
|
CONVERT=$(shell command -v convert)
|
2003-11-22 16:15:47 +01:00
|
|
|
|
2009-04-21 23:45:11 +02:00
|
|
|
codeflow.pdf: codeflow.svg
|
2009-05-12 16:24:25 +02:00
|
|
|
ifneq ($(strip $(SVG2PDF)),)
|
2009-04-21 23:45:11 +02:00
|
|
|
svg2pdf $< $@
|
2009-05-12 16:24:25 +02:00
|
|
|
else ifneq ($(strip $(INKSCAPE)),)
|
|
|
|
inkscape $< --export-pdf=$@
|
|
|
|
else ifneq ($(strip $(CONVERT)),)
|
|
|
|
convert $< $@
|
|
|
|
endif
|
2003-11-22 16:15:47 +01:00
|
|
|
|
2009-04-21 23:45:11 +02:00
|
|
|
hypertransport.pdf: hypertransport.svg
|
2009-05-12 16:24:25 +02:00
|
|
|
ifneq ($(strip $(SVG2PDF)),)
|
2009-04-21 23:45:11 +02:00
|
|
|
svg2pdf $< $@
|
2009-05-12 16:24:25 +02:00
|
|
|
else ifneq ($(strip $(INKSCAPE)),)
|
|
|
|
inkscape $< --export-pdf=$@
|
|
|
|
else ifneq ($(strip $(CONVERT)),)
|
|
|
|
convert $< $@
|
|
|
|
endif
|
2003-11-22 16:15:47 +01:00
|
|
|
|
2023-06-16 06:26:05 +02:00
|
|
|
$(BUILDDIR):
|
|
|
|
mkdir -p $(BUILDDIR)
|
2023-05-30 07:09:54 +02:00
|
|
|
|
2017-06-04 04:16:01 +02:00
|
|
|
corebootPortingGuide.toc: $(FIGS) corebootBuildingGuide.tex
|
2003-11-22 16:15:47 +01:00
|
|
|
# 2 times to make sure we have a current toc.
|
2017-06-04 04:16:01 +02:00
|
|
|
$(PDFLATEX) corebootBuildingGuide.tex
|
|
|
|
$(PDFLATEX) corebootBuildingGuide.tex
|
2003-11-22 16:15:47 +01:00
|
|
|
|
2017-06-04 04:16:01 +02:00
|
|
|
corebootPortingGuide.pdf: $(FIGS) corebootBuildingGuide.tex corebootPortingGuide.toc
|
|
|
|
$(PDFLATEX) corebootBuildingGuide.tex
|
2003-11-22 16:15:47 +01:00
|
|
|
|
2023-06-16 06:26:05 +02:00
|
|
|
sphinx: $(BUILDDIR)
|
|
|
|
$(MAKE) -f Makefile.sphinx html BUILDDIR="$(BUILDDIR)"
|
2018-04-19 16:23:56 +02:00
|
|
|
|
|
|
|
clean-sphinx:
|
2023-06-16 06:26:05 +02:00
|
|
|
$(MAKE) -f Makefile.sphinx clean BUILDDIR="$(BUILDDIR)"
|
2018-04-19 16:23:56 +02:00
|
|
|
|
|
|
|
clean: clean-sphinx
|
2018-09-25 23:15:16 +02:00
|
|
|
rm -f *.aux *.idx *.log *.toc *.out $(FIGS)
|
2003-11-22 16:15:47 +01:00
|
|
|
|
|
|
|
distclean: clean
|
2018-09-25 23:15:16 +02:00
|
|
|
rm -f corebootPortingGuide.pdf
|
2018-08-19 01:20:16 +02:00
|
|
|
|
2023-06-16 06:26:05 +02:00
|
|
|
livesphinx: $(BUILDDIR)
|
2023-08-21 21:08:00 +02:00
|
|
|
$(MAKE) -f Makefile.sphinx livehtml BUILDDIR="$(BUILDDIR)"
|
2023-05-30 07:02:10 +02:00
|
|
|
|
2023-05-30 07:05:09 +02:00
|
|
|
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
|
|
|
|
|
2023-05-30 07:02:10 +02:00
|
|
|
help:
|
|
|
|
@echo "all - Builds coreboot porting guide PDF (outdated)"
|
|
|
|
@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"
|
2023-05-30 07:05:09 +02:00
|
|
|
@echo "test - Runs documentation tests"
|
2023-05-30 07:02:10 +02:00
|
|
|
@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
|