committed automatically by Makefile
[clqr.git] / Makefile
blob1c6cea76daaac2d0e601eabd114cc4604c2cc448
1 # Copyright (C) 2008 Bert Burgemeister
3 # Permission is granted to copy, distribute and/or modify this
4 # document under the terms of the GNU Free Documentation License,
5 # Version 1.2 or any later version published by the Free Software
6 # Foundation; with no Invariant Sections, no Front-Cover Texts and
7 # no Back-Cover Texts. For details see file COPYING.
9 CLQR = clqr
10 SEND-TO-LOG = | tee -a lastbuild.log
12 LATEX = latex
13 MAKEINDEX = makeindex -c
14 DVIPS = dvips
15 PSNUP-A4 = psnup -W10.5cm -H29.7cm -pa4 -2
16 PSNUP-LETTER = psnup -W4.25in -H11in -pletter -2
17 PSBOOK-ALL = psbook
18 PSBOOK-FOUR = psbook -s4
19 PS2PDF = ps2pdf
20 CONVERT = convert
21 MONTAGE = montage
22 TOUCH = touch
23 CP = cp --verbose
24 RM = rm --force --verbose
25 MV = mv --force --verbose
26 MAKE = make
27 BZR_REVISION = bzr revno | tr -d '\n\\'
28 BZR_EXPORT = bzr export
29 BZR_COMMIT = bzr commit
30 DATE = date -I | tr -d '\n\\'
31 RSYNC = rsync -va
33 all: letter a4
35 letter: $(CLQR)-letter-booklet-all.pdf $(CLQR)-letter-booklet-four.pdf $(CLQR)-letter-consec.pdf
37 a4: $(CLQR)-a4-booklet-all.pdf $(CLQR)-a4-booklet-four.pdf $(CLQR)-a4-consec.pdf
39 $(CLQR)-%-consec.pdf: $(CLQR)-%-consec.ps
40 $(PS2PDF) $< $@ $(SEND-TO-LOG)
42 $(CLQR)-letter-booklet-%.pdf: $(CLQR)-letter-booklet-%.ps
43 $(PS2PDF) -sPAPERSIZE=letter $< $@ $(SEND-TO-LOG)
45 $(CLQR)-a4-booklet-%.pdf: $(CLQR)-a4-booklet-%.ps
46 $(PS2PDF) -sPAPERSIZE=a4 $< $@ $(SEND-TO-LOG)
48 $(CLQR)-letter-booklet-%.ps: $(CLQR)-letter-signature-%.ps
49 $(PSNUP-LETTER) $< > $@ $(SEND-TO-LOG)
51 $(CLQR)-a4-booklet-%.ps: $(CLQR)-a4-signature-%.ps
52 $(PSNUP-A4) $< > $@ $(SEND-TO-LOG)
54 $(CLQR)-%-signature-all.ps: $(CLQR)-%-consec.ps
55 $(PSBOOK-ALL) $< $@ $(SEND-TO-LOG)
57 $(CLQR)-%-signature-four.ps: $(CLQR)-%-consec.ps
58 $(PSBOOK-FOUR) $< $@ $(SEND-TO-LOG)
60 $(CLQR)-%-consec.ps: $(CLQR)-%.dvi
61 $(DVIPS) -o $@ $< $(SEND-TO-LOG)
63 $(CLQR)-%.dvi: $(CLQR).tex $(CLQR)-*.tex paper-%.flag REVISION.tex
64 $(TOUCH) $(CLQR).ind $(SEND-TO-LOG)
65 $(LATEX) $(CLQR).tex $(SEND-TO-LOG)
66 $(LATEX) $(CLQR).tex $(SEND-TO-LOG)
67 $(MAKEINDEX) $(CLQR).idx $(SEND-TO-LOG)
68 $(LATEX) $(CLQR).tex $(SEND-TO-LOG)
69 $(MV) $(CLQR).dvi $@ $(SEND-TO-LOG)
71 paper-a4.flag:
72 $(CP) paper-a4.tex paper-current.tex $(SEND-TO-LOG)
73 $(RM) paper-letter.flag $(SEND-TO-LOG)
74 $(TOUCH) $@
76 paper-letter.flag:
77 $(CP) paper-letter.tex paper-current.tex $(SEND-TO-LOG)
78 $(RM) paper-a4.flag $(SEND-TO-LOG)
79 $(TOUCH) $@
81 REVISION.tex: DATE.tex
82 if $(BZR_REVISION); then $(BZR_REVISION) > $@; else $(TOUCH) $@; fi $(SEND-TO-LOG)
84 DATE.tex: $(CLQR).tex $(CLQR)-*.tex
85 $(DATE) > $@
87 clean:
88 $(RM) *.dvi *.toc *.aux *.log *.idx *.ilg *.ind *.ps *.pdf *~ html/*~ *.flag *.jpg html/*.jpg *.tar.gz
91 # Project hosting
93 maintainance: release publish
95 publish: html/sample-frontcover.jpg html/sample-doublepage.jpg \
96 html/sample-firstpage-all.jpg html/sample-firstpage-four.jpg \
97 html/sample-firstpage-consec.jpg $(CLQR)-a4-consec.pdf
98 $(MAKE) publishclean
99 $(RSYNC) --delete ./ trebb@shell.berlios.de:/home/groups/ftp/pub/clqr/clqr/ $(SEND-TO-LOG)
100 $(RSYNC) ./html/ trebb@shell.berlios.de:/home/groups/clqr/htdocs/ $(SEND-TO-LOG)
102 release: emergency-commit letter a4 $(CLQR).tar.gz html/release-revision.txt
103 ./upload.sh
105 html/release-revision.txt: html/release-date.txt
106 $(BZR_REVISION) > $@
108 html/release-date.txt: $(CLQR).tex $(CLQR)-*.tex
109 $(DATE) > $@
111 html/sample-frontcover.jpg: $(CLQR)-a4-consec.pdf
112 $(CONVERT) $<'[0]' -verbose -resize 30% temp.jpg $(SEND-TO-LOG)
113 $(MONTAGE) temp.jpg -tile 1x1 -geometry +1+1 -background gray $@ $(SEND-TO-LOG)
114 $(RM) temp.jpg
116 html/sample-doublepage.jpg: $(CLQR)-a4-consec.pdf
117 $(CONVERT) $<'[19-20]' -verbose -resize 30% temp.jpg $(SEND-TO-LOG)
118 $(MONTAGE) temp-0.jpg temp-1.jpg -tile 2x1 -geometry +1+1 -background gray $@ $(SEND-TO-LOG)
119 $(RM) temp-0.jpg temp-1.jpg
121 html/sample-firstpage-%.jpg: $(CLQR)-a4-booklet-%.pdf
122 $(CONVERT) $<'[0]' -verbose -resize 15% temp.jpg $(SEND-TO-LOG)
123 $(MONTAGE) temp.jpg -tile 1x1 -geometry +1+1 -background gray $@ $(SEND-TO-LOG)
124 $(RM) temp.jpg
126 html/sample-firstpage-consec.jpg: $(CLQR)-a4-consec.pdf
127 $(CONVERT) $<'[0]' -verbose -resize 15% temp.jpg $(SEND-TO-LOG)
128 $(MONTAGE) temp.jpg -tile 1x1 -geometry +1+1 -background gray $@ $(SEND-TO-LOG)
129 $(RM) temp.jpg
131 emergency-commit:
132 $(BZR_COMMIT) -m "committed automatically by Makefile"
134 $(CLQR).tar.gz:
135 $(BZR_EXPORT) $@ $(SEND-TO-LOG)
137 publishclean:
138 $(RM) *.ps *~ html/*~