summaryrefslogtreecommitdiff
path: root/documentation/Makefile
blob: 264bc922a26c680f665774d225fedd5a401338b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#
# Makefile for coreboot paper.
# hacked together by Stefan Reinauer <stepan@openbios.org>
#

PDFLATEX=pdflatex -t a4

FIGS=codeflow.pdf hypertransport.pdf

all: LinuxBIOS-AMD64.pdf Kconfig.pdf

SVG2PDF=$(shell which svg2pdf)
INKSCAPE=$(shell which inkscape)
CONVERT=$(shell which convert)

codeflow.pdf: codeflow.svg
ifneq ($(strip $(SVG2PDF)),)
	svg2pdf $< $@
else ifneq ($(strip $(INKSCAPE)),)
	inkscape $< --export-pdf=$@
else ifneq ($(strip $(CONVERT)),)
	convert $< $@
endif

hypertransport.pdf: hypertransport.svg
ifneq ($(strip $(SVG2PDF)),)
	svg2pdf $< $@
else ifneq ($(strip $(INKSCAPE)),)
	inkscape $< --export-pdf=$@
else ifneq ($(strip $(CONVERT)),)
	convert $< $@
endif

LinuxBIOS-AMD64.toc: $(FIGS) LinuxBIOS-AMD64.tex 
	# 2 times to make sure we have a current toc.
	$(PDFLATEX) LinuxBIOS-AMD64.tex
	$(PDFLATEX) LinuxBIOS-AMD64.tex

LinuxBIOS-AMD64.pdf: $(FIGS) LinuxBIOS-AMD64.tex LinuxBIOS-AMD64.toc
	$(PDFLATEX) LinuxBIOS-AMD64.tex

Kconfig.pdf: Kconfig.tex mainboardkconfig.tex cpukconfig.tex socketfkconfig.tex
	$(PDFLATEX) $<

# quick, somebody! make me a macro!
mainboardkconfig.tex: ../src/mainboard/Kconfig
	echo '\begin{verbatim}' > $@
	grep '^config' $< | awk '{print $2}'  >>$@
	echo '\end{verbatim}' >> $@

skconfig.tex: ../src/mainboard/amd/serengeti_cheetah/Kconfig
	echo '\begin{verbatim}' > $@
	grep '^config' $< | awk '{print $2}'  >>$@
	echo '\end{verbatim}' >> $@

cpukconfig.tex: ../src/cpu/Kconfig
	echo '\begin{verbatim}' > $@
	grep '^config' $< | awk '{print $2}'  >>$@
	echo '\end{verbatim}' >> $@

socketfkconfig.tex: ../src/cpu/amd/socket_F/Kconfig
	echo '\begin{verbatim}' > $@
	grep '^config' $< | awk '{print $2}'  >>$@
	echo '\end{verbatim}' >> $@


clean:
	rm -f *.aux *.idx *.log *.toc *.out $(FIGS) mainboardkconfig.tex

distclean: clean
	rm -f LinuxBIOS-AMD64.pdf mainboardkconfig.tex