blob: b5f97d19756443910b6e8b9a8b63418c0d667266 [file] [log] [blame]
Stefan Reinauer37414ca2003-11-22 15:15:47 +00001#
Uwe Hermannd2a5a5a2009-04-18 14:18:20 +00002# Makefile for coreboot paper.
Stefan Reinauer37414ca2003-11-22 15:15:47 +00003# hacked together by Stefan Reinauer <stepan@openbios.org>
4#
5
6PDFLATEX=pdflatex -t a4
7
8FIGS=codeflow.pdf hypertransport.pdf
9
Martin Roth4b18a922017-06-03 20:16:01 -060010all: corebootPortingGuide.pdf Kconfig.pdf
Stefan Reinauer37414ca2003-11-22 15:15:47 +000011
Uwe Hermann67ee8f82009-05-12 14:24:25 +000012SVG2PDF=$(shell which svg2pdf)
13INKSCAPE=$(shell which inkscape)
14CONVERT=$(shell which convert)
Stefan Reinauer37414ca2003-11-22 15:15:47 +000015
Stefan Reinauerebf25892009-04-21 21:45:11 +000016codeflow.pdf: codeflow.svg
Uwe Hermann67ee8f82009-05-12 14:24:25 +000017ifneq ($(strip $(SVG2PDF)),)
Stefan Reinauerebf25892009-04-21 21:45:11 +000018 svg2pdf $< $@
Uwe Hermann67ee8f82009-05-12 14:24:25 +000019else ifneq ($(strip $(INKSCAPE)),)
20 inkscape $< --export-pdf=$@
21else ifneq ($(strip $(CONVERT)),)
22 convert $< $@
23endif
Stefan Reinauer37414ca2003-11-22 15:15:47 +000024
Stefan Reinauerebf25892009-04-21 21:45:11 +000025hypertransport.pdf: hypertransport.svg
Uwe Hermann67ee8f82009-05-12 14:24:25 +000026ifneq ($(strip $(SVG2PDF)),)
Stefan Reinauerebf25892009-04-21 21:45:11 +000027 svg2pdf $< $@
Uwe Hermann67ee8f82009-05-12 14:24:25 +000028else ifneq ($(strip $(INKSCAPE)),)
29 inkscape $< --export-pdf=$@
30else ifneq ($(strip $(CONVERT)),)
31 convert $< $@
32endif
Stefan Reinauer37414ca2003-11-22 15:15:47 +000033
Martin Roth4b18a922017-06-03 20:16:01 -060034corebootPortingGuide.toc: $(FIGS) corebootBuildingGuide.tex
Stefan Reinauer37414ca2003-11-22 15:15:47 +000035 # 2 times to make sure we have a current toc.
Martin Roth4b18a922017-06-03 20:16:01 -060036 $(PDFLATEX) corebootBuildingGuide.tex
37 $(PDFLATEX) corebootBuildingGuide.tex
Stefan Reinauer37414ca2003-11-22 15:15:47 +000038
Martin Roth4b18a922017-06-03 20:16:01 -060039corebootPortingGuide.pdf: $(FIGS) corebootBuildingGuide.tex corebootPortingGuide.toc
40 $(PDFLATEX) corebootBuildingGuide.tex
Stefan Reinauer37414ca2003-11-22 15:15:47 +000041
Patrick Georgi0588d192009-08-12 15:00:51 +000042Kconfig.pdf: Kconfig.tex mainboardkconfig.tex cpukconfig.tex socketfkconfig.tex
43 $(PDFLATEX) $<
44
45# quick, somebody! make me a macro!
46mainboardkconfig.tex: ../src/mainboard/Kconfig
Ronald G. Minnichb6e03202009-08-12 20:25:24 +000047 cat beginverbatim.tex > $@
Patrick Georgi0588d192009-08-12 15:00:51 +000048 grep '^config' $< | awk '{print $2}' >>$@
Ronald G. Minnichb6e03202009-08-12 20:25:24 +000049 cat endverbatim.tex >> $@
Patrick Georgi0588d192009-08-12 15:00:51 +000050
51skconfig.tex: ../src/mainboard/amd/serengeti_cheetah/Kconfig
Ronald G. Minnichb6e03202009-08-12 20:25:24 +000052 cat beginverbatim.tex > $@
Patrick Georgi0588d192009-08-12 15:00:51 +000053 grep '^config' $< | awk '{print $2}' >>$@
Ronald G. Minnichb6e03202009-08-12 20:25:24 +000054 cat endverbatim.tex >> $@
Patrick Georgi0588d192009-08-12 15:00:51 +000055
56cpukconfig.tex: ../src/cpu/Kconfig
Ronald G. Minnichb6e03202009-08-12 20:25:24 +000057 cat beginverbatim.tex > $@
Patrick Georgi0588d192009-08-12 15:00:51 +000058 grep '^config' $< | awk '{print $2}' >>$@
Ronald G. Minnichb6e03202009-08-12 20:25:24 +000059 cat endverbatim.tex >> $@
Patrick Georgi0588d192009-08-12 15:00:51 +000060
61socketfkconfig.tex: ../src/cpu/amd/socket_F/Kconfig
Ronald G. Minnichb6e03202009-08-12 20:25:24 +000062 cat beginverbatim.tex > $@
Patrick Georgi0588d192009-08-12 15:00:51 +000063 grep '^config' $< | awk '{print $2}' >>$@
Ronald G. Minnichb6e03202009-08-12 20:25:24 +000064 cat endverbatim.tex >> $@
Patrick Georgi0588d192009-08-12 15:00:51 +000065
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +020066sphinx:
67 $(MAKE) -f Makefile.sphinx html
68
69clean-sphinx:
70 $(MAKE) -f Makefile.sphinx clean
71
72clean: clean-sphinx
Uwe Hermann8008f882009-09-04 19:34:43 +000073 rm -f *.aux *.idx *.log *.toc *.out $(FIGS) mainboardkconfig.tex skconfig.tex cpukconfig.tex socketfkconfig.tex
Stefan Reinauer37414ca2003-11-22 15:15:47 +000074
75distclean: clean
Martin Roth4b18a922017-06-03 20:16:01 -060076 rm -f corebootPortingGuide.pdf Kconfig.pdf