blob: 264bc922a26c680f665774d225fedd5a401338b5 [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
Patrick Georgi0588d192009-08-12 15:00:51 +000010all: LinuxBIOS-AMD64.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
34LinuxBIOS-AMD64.toc: $(FIGS) LinuxBIOS-AMD64.tex
35 # 2 times to make sure we have a current toc.
36 $(PDFLATEX) LinuxBIOS-AMD64.tex
37 $(PDFLATEX) LinuxBIOS-AMD64.tex
38
39LinuxBIOS-AMD64.pdf: $(FIGS) LinuxBIOS-AMD64.tex LinuxBIOS-AMD64.toc
40 $(PDFLATEX) LinuxBIOS-AMD64.tex
41
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
47 echo '\begin{verbatim}' > $@
48 grep '^config' $< | awk '{print $2}' >>$@
49 echo '\end{verbatim}' >> $@
50
51skconfig.tex: ../src/mainboard/amd/serengeti_cheetah/Kconfig
52 echo '\begin{verbatim}' > $@
53 grep '^config' $< | awk '{print $2}' >>$@
54 echo '\end{verbatim}' >> $@
55
56cpukconfig.tex: ../src/cpu/Kconfig
57 echo '\begin{verbatim}' > $@
58 grep '^config' $< | awk '{print $2}' >>$@
59 echo '\end{verbatim}' >> $@
60
61socketfkconfig.tex: ../src/cpu/amd/socket_F/Kconfig
62 echo '\begin{verbatim}' > $@
63 grep '^config' $< | awk '{print $2}' >>$@
64 echo '\end{verbatim}' >> $@
65
66
Stefan Reinauer37414ca2003-11-22 15:15:47 +000067clean:
Patrick Georgi0588d192009-08-12 15:00:51 +000068 rm -f *.aux *.idx *.log *.toc *.out $(FIGS) mainboardkconfig.tex
Stefan Reinauer37414ca2003-11-22 15:15:47 +000069
70distclean: clean
Patrick Georgi0588d192009-08-12 15:00:51 +000071 rm -f LinuxBIOS-AMD64.pdf mainboardkconfig.tex
Stefan Reinauer37414ca2003-11-22 15:15:47 +000072