blob: 96b66a998b6b097a0defcb2cdf3cf309ca1ef600 [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
Zheng Bao7afd2bb2013-12-09 10:27:56 +080010all: 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
Vladimir Bereznikerbda9a822014-07-01 20:40:18 -040034CorebootPortingGuide.toc: $(FIGS) CorebootBuildingGuide.tex
Stefan Reinauer37414ca2003-11-22 15:15:47 +000035 # 2 times to make sure we have a current toc.
Vladimir Bereznikerbda9a822014-07-01 20:40:18 -040036 $(PDFLATEX) CorebootBuildingGuide.tex
37 $(PDFLATEX) CorebootBuildingGuide.tex
Stefan Reinauer37414ca2003-11-22 15:15:47 +000038
Vladimir Bereznikerbda9a822014-07-01 20:40:18 -040039CorebootPortingGuide.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
Stefan Reinauer37414ca2003-11-22 15:15:47 +000066clean:
Uwe Hermann8008f882009-09-04 19:34:43 +000067 rm -f *.aux *.idx *.log *.toc *.out $(FIGS) mainboardkconfig.tex skconfig.tex cpukconfig.tex socketfkconfig.tex
Stefan Reinauer37414ca2003-11-22 15:15:47 +000068
69distclean: clean
Zheng Bao7afd2bb2013-12-09 10:27:56 +080070 rm -f CorebootPortingGuide.pdf Kconfig.pdf