]> rtime.felk.cvut.cz Git - can-eth-gw.git/blob - doc/Makefile
switch to rtmsg, cegw --flush implemented
[can-eth-gw.git] / doc / Makefile
1 DOCS=can-eth-gw
2 #DOCS=socketcan-qdisc socketcan-qdisc-review1 socketcan-qdisc-final
3
4 all: $(DOCS:%=%.pdf) #$(DOCS:%=%.txt)
5
6 clean:
7         rm -f $(wildcard $(DOCS:%=%.aux) $(DOCS:%=%.bbl) $(DOCS:%=%.log) $(DOCS:%=%.fls))
8
9 version_tag_prefix = $(subst socketcan-qdisc-v,v,$(*:%=%-v))
10 VERSION = $(shell (git describe --always --dirty --match $(version_tag_prefix)\* || echo "unknown")|sed -e 's/$(version_tag_prefix)\(.*\)/\1/')
11
12 LATEX = pdflatex $(LATEX_FLAGS) -synctex=1 -recorder                    \
13         $(OUTDIR:%=-output-directory %) -file-line-error                \
14         -interaction=nonstopmode '\def\version{$(VERSION)}\input{$<}'
15
16 SVGS = $(wildcard *.svg)
17 GPS = $(wildcard *.gp)
18
19 .SECONDARY: $(SVGS:%.svg=%.pdf) $(GPS:%.gp=%.pdf)
20
21 %.pdf: %.tex $(SVGS:%.svg=%.pdf) $(GPS:%.gp=%.pdf)
22         $(LATEX)
23 #       bibtex $*
24         $(LATEX)
25         $(LATEX)
26
27 HEVEA = hevea article.hva -text -exec xxdate.exe $<
28 %.txt: %.tex %.pdf
29         $(HEVEA)
30         bibhva $*
31         $(HEVEA)
32
33 %.png: %.txt
34         java -jar ~/opt/ditaa/ditaa0_9.jar -r $< $@
35
36 %.png: %.svg
37         inkscape --export-area-drawing --export-png=$@ --export-background-opacity=1.0 $<
38
39 %.ps: %.svg
40         inkscape --export-ps=$@ $<
41
42 %-page.pdf: %.svg
43         inkscape --export-pdf=$@ $<
44
45 %-page.pdf: %.ps
46         ps2pdf $< $@
47
48 %.pdf: %-page.pdf
49         pdfcrop $< $@
50
51
52 define GNUPLOT
53 gnuplot -e 'PWD="$(PWD)"; set output PWD."/$*.pdf"; set terminal pdfcairo dashed enhanced size $(shell s=`sed -ne '/^# termsize / s///p' $<`; test "$$s" && echo $$s || echo 20cm,7cm) lw 1 font "Times New Roman,8pt";' $<
54 endef
55
56 %.pdf: %.gp
57         $(GNUPLOT)