minor changes
[clqr.git] / Makefile
blob3121a69f4a9fa5e9ec1ccdb83d5cf380ca975a9f
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
28 BZR_EXPORT = bzr export
29 DATE = date -I
30 RSYNC = rsync -va
32 all: letter a4
34 letter: $(CLQR)-letter-booklet-all.pdf $(CLQR)-letter-booklet-four.pdf $(CLQR)-letter-consec.pdf
36 a4: $(CLQR)-a4-booklet-all.pdf $(CLQR)-a4-booklet-four.pdf $(CLQR)-a4-consec.pdf
38 $(CLQR)-%-consec.pdf: $(CLQR)-%-consec.ps
39 $(PS2PDF) $< $@ $(SEND-TO-LOG)
41 $(CLQR)-letter-booklet-%.pdf: $(CLQR)-letter-booklet-%.ps
42 $(PS2PDF) -sPAPERSIZE=letter $< $@ $(SEND-TO-LOG)
44 $(CLQR)-a4-booklet-%.pdf: $(CLQR)-a4-booklet-%.ps
45 $(PS2PDF) -sPAPERSIZE=a4 $< $@ $(SEND-TO-LOG)
47 $(CLQR)-letter-booklet-%.ps: $(CLQR)-letter-signature-%.ps
48 $(PSNUP-LETTER) $< > $@ $(SEND-TO-LOG)
50 $(CLQR)-a4-booklet-%.ps: $(CLQR)-a4-signature-%.ps
51 $(PSNUP-A4) $< > $@ $(SEND-TO-LOG)
53 $(CLQR)-%-signature-all.ps: $(CLQR)-%-consec.ps
54 $(PSBOOK-ALL) $< $@ $(SEND-TO-LOG)
56 $(CLQR)-%-signature-four.ps: $(CLQR)-%-consec.ps
57 $(PSBOOK-FOUR) $< $@ $(SEND-TO-LOG)
59 $(CLQR)-%-consec.ps: $(CLQR)-%.dvi
60 $(DVIPS) -o $@ $< $(SEND-TO-LOG)
62 $(CLQR)-%.dvi: $(CLQR).tex $(CLQR)-*.tex paper-%.flag REVISION.tex
63 $(TOUCH) $(CLQR).ind $(SEND-TO-LOG)
64 $(LATEX) $(CLQR).tex $(SEND-TO-LOG)
65 $(LATEX) $(CLQR).tex $(SEND-TO-LOG)
66 $(MAKEINDEX) $(CLQR).idx $(SEND-TO-LOG)
67 $(LATEX) $(CLQR).tex $(SEND-TO-LOG)
68 $(MV) $(CLQR).dvi $@ $(SEND-TO-LOG)
70 paper-a4.flag:
71 $(CP) paper-a4.tex paper-current.tex $(SEND-TO-LOG)
72 $(RM) paper-letter.flag $(SEND-TO-LOG)
73 $(TOUCH) $@
75 paper-letter.flag:
76 $(CP) paper-letter.tex paper-current.tex $(SEND-TO-LOG)
77 $(RM) paper-a4.flag $(SEND-TO-LOG)
78 $(TOUCH) $@
80 REVISION.tex: $(CLQR).tex $(CLQR)-*.tex
81 if $(BZR_REVISION); then $(BZR_REVISION) > $@; else $(TOUCH) $@; fi $(SEND-TO-LOG)
83 clean:
84 $(RM) *.dvi *.toc *.aux *.log *.idx *.ilg *.ind *.ps *.pdf *~ html/*~ *.flag *.jpg html/*.jpg *.tar.gz
86 publishclean:
87 $(RM) *~ html/*~
90 # Project hosting
92 maintainance: letter a4 release publish
94 publish: html/sample-frontcover.jpg html/sample-doublepage.jpg \
95 html/sample-firstpage-all.jpg html/sample-firstpage-four.jpg \
96 html/sample-firstpage-consec.jpg $(CLQR)-a4-consec.pdf REVISION.tex
97 $(MAKE) publishclean
98 $(RSYNC) --delete ./ trebb@shell.berlios.de:/home/groups/ftp/pub/clqr/clqr/ $(SEND-TO-LOG)
99 $(RSYNC) ./html/ trebb@shell.berlios.de:/home/groups/clqr/htdocs/ $(SEND-TO-LOG)
101 release: letter a4 $(CLQR).tar.gz html/release-revision.txt html/release-date.txt
102 ./upload.sh
104 html/release-date.txt:
105 $(DATE) >> $@
107 html/release-revision.txt:
108 $(BZR_REVISION) > $@
110 html/sample-frontcover.jpg: $(CLQR)-a4-consec.pdf
111 $(CONVERT) $<'[0]' -verbose -resize 30% temp.jpg $(SEND-TO-LOG)
112 $(MONTAGE) temp.jpg -tile 1x1 -geometry +1+1 -background gray $@ $(SEND-TO-LOG)
113 $(RM) temp.jpg
115 html/sample-doublepage.jpg: $(CLQR)-a4-consec.pdf
116 $(CONVERT) $<'[19-20]' -verbose -resize 30% temp.jpg $(SEND-TO-LOG)
117 $(MONTAGE) temp-0.jpg temp-1.jpg -tile 2x1 -geometry +1+1 -background gray $@ $(SEND-TO-LOG)
118 $(RM) temp-0.jpg temp-1.jpg
120 html/sample-firstpage-%.jpg: $(CLQR)-a4-booklet-%.pdf
121 $(CONVERT) $<'[0]' -verbose -resize 15% temp.jpg $(SEND-TO-LOG)
122 $(MONTAGE) temp.jpg -tile 1x1 -geometry +1+1 -background gray $@ $(SEND-TO-LOG)
123 $(RM) temp.jpg
125 html/sample-firstpage-consec.jpg: $(CLQR)-a4-consec.pdf
126 $(CONVERT) $<'[0]' -verbose -resize 15% temp.jpg $(SEND-TO-LOG)
127 $(MONTAGE) temp.jpg -tile 1x1 -geometry +1+1 -background gray $@ $(SEND-TO-LOG)
128 $(RM) temp.jpg
130 $(CLQR).tar.gz:
131 $(BZR_EXPORT) $@ $(SEND-TO-LOG)