Unfinished work on figure Data Types.
[clqr.git] / Makefile
blob1baf67eafa25d7754995fe8503adc9f05496ff55
1 # Copyright (C) 2008, 2009 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 -dPDFSETTINGS=/prepress
20 Convert = convert
21 MONTAGE = montage
22 HEAD = head
23 TAIL = tail
24 TOUCH = touch
25 CP = cp --verbose
26 RM = rm --force --verbose
27 MV = mv --force --verbose
28 MAKE = make
29 GZIP = gzip
30 GIT_REVISION = git-describe | sed 's/\(.*-.*\)-.*/\1/'
31 GIT_ARCHIVE = git-archive --format=tar --prefix=$(CLQR)/ HEAD | $(GZIP)
32 GIT_LOG = git-log
33 DATE = git-log HEAD^..HEAD --date=short | awk '/Date:/{print $$2}' | tr -d '\n\\'
34 RSYNC = rsync -va
35 SSH = ssh
37 all: letter a4
39 letter:
40 $(MAKE) letter-booklets
41 $(MAKE) $(CLQR)-letter-consec.pdf
43 a4:
44 $(MAKE) a4-booklets
45 $(MAKE) $(CLQR)-a4-consec.pdf
47 letter-booklets: $(CLQR)-letter-booklet-all.pdf $(CLQR)-letter-booklet-four.pdf
49 a4-booklets: $(CLQR)-a4-booklet-all.pdf $(CLQR)-a4-booklet-four.pdf
51 $(CLQR)-%-consec.pdf: $(CLQR)-%-consec.ps
52 $(PS2PDF) $< $@ $(SEND-TO-LOG)
54 $(CLQR)-letter-booklet-%.pdf: $(CLQR)-letter-booklet-%.ps
55 $(PS2PDF) -sPAPERSIZE=letter $< $@ $(SEND-TO-LOG)
57 $(CLQR)-a4-booklet-%.pdf: $(CLQR)-a4-booklet-%.ps
58 $(PS2PDF) -sPAPERSIZE=a4 $< $@ $(SEND-TO-LOG)
60 $(CLQR)-letter-booklet-%.ps: $(CLQR)-letter-signature-%.ps color-black.flag
61 $(PSNUP-LETTER) $< > $@ $(SEND-TO-LOG)
63 $(CLQR)-a4-booklet-%.ps: $(CLQR)-a4-signature-%.ps color-black.flag
64 $(PSNUP-A4) $< > $@ $(SEND-TO-LOG)
66 $(CLQR)-%-signature-all.ps: $(CLQR)-%-consec.ps
67 $(PSBOOK-ALL) $< $@ $(SEND-TO-LOG)
69 $(CLQR)-%-signature-four.ps: $(CLQR)-%-consec.ps
70 $(PSBOOK-FOUR) $< $@ $(SEND-TO-LOG)
72 $(CLQR)-%-consec.ps: $(CLQR)-%.dvi color-colorful.flag
73 $(DVIPS) -o $@ $< $(SEND-TO-LOG)
75 $(CLQR)-%.dvi: $(CLQR).tex $(CLQR)-*.tex paper-%.flag revision-number
76 $(TOUCH) $(CLQR).ind $(SEND-TO-LOG)
77 $(LATEX) $(CLQR).tex $(SEND-TO-LOG)
78 $(LATEX) $(CLQR).tex $(SEND-TO-LOG)
79 $(MAKEINDEX) -s $(CLQR).ist $(CLQR).idx $(SEND-TO-LOG)
80 $(LATEX) $(CLQR).tex $(SEND-TO-LOG)
81 $(MV) $(CLQR).dvi $@ $(SEND-TO-LOG)
83 paper-a4.flag:
84 $(CP) paper-a4.tex paper-current.tex $(SEND-TO-LOG)
85 $(RM) paper-letter.flag $(SEND-TO-LOG)
86 $(TOUCH) $@
88 paper-letter.flag:
89 $(CP) paper-letter.tex paper-current.tex $(SEND-TO-LOG)
90 $(RM) paper-a4.flag $(SEND-TO-LOG)
91 $(TOUCH) $@
93 color-colorful.flag:
94 $(CP) color-colorful.tex color-current.tex $(SEND-TO-LOG)
95 $(RM) color-black.flag $(SEND-TO-LOG)
96 $(TOUCH) $@
98 color-black.flag:
99 $(CP) color-black.tex color-current.tex $(SEND-TO-LOG)
100 $(RM) color-colorful.flag $(SEND-TO-LOG)
101 $(TOUCH) $@
103 revision-number:
104 $(GIT_REVISION) | tee REVISION.tex > html/release-revision.txt
105 $(DATE) | tee DATE.tex > html/release-date.txt
107 #DATE.tex: $(CLQR).tex $(CLQR)-*.tex
108 # $(DATE) | tee $@ > html/release-date.txt
110 clean:
111 $(RM) *.dvi *.toc *.aux *.log *.idx *.ilg *.ind *.out *.ps *.pdf *~ html/*~ \
112 *.flag *.jpg html/*.jpg *.tar.gz REVISION.tex DATE.tex \
113 html/latest-changes.html html/release-revision.txt html/release-date.txt \
114 paper-current.tex color-current.tex
117 # Project hosting
119 publish: letter a4 \
120 html/sample-frontcover.jpg \
121 html/sample-firstpage-all.jpg html/sample-firstpage-four.jpg \
122 html/sample-firstpage-consec.jpg html/sample-source.jpg \
123 html/latest-changes.html \
124 $(CLQR).tar.gz
125 $(MAKE) publishclean
126 $(RSYNC) --delete ./ trebb@shell.berlios.de:/home/groups/ftp/pub/clqr/clqr/ $(SEND-TO-LOG)
127 $(RSYNC) ./html/ trebb@shell.berlios.de:/home/groups/clqr/htdocs/ $(SEND-TO-LOG)
129 html/sample-frontcover.jpg: $(CLQR)-a4-consec.pdf
130 $(CONVERT) $<'[0]' -verbose -resize 40% temp.jpg $(SEND-TO-LOG)
131 $(MONTAGE) temp.jpg -tile 1x1 -geometry +1+1 -background gray $@ $(SEND-TO-LOG)
132 $(RM) temp.jpg
134 html/sample-firstpage-%.jpg: $(CLQR)-a4-booklet-%.pdf
135 $(CONVERT) $<'[0]' -verbose -resize 15% temp.jpg $(SEND-TO-LOG)
136 $(MONTAGE) temp.jpg -tile 1x1 -geometry +1+1 -background gray $@ $(SEND-TO-LOG)
137 $(RM) temp.jpg
139 html/sample-firstpage-consec.jpg: $(CLQR)-a4-consec.pdf
140 $(CONVERT) $<'[0]' -verbose -resize 15% temp.jpg $(SEND-TO-LOG)
141 $(MONTAGE) temp.jpg -tile 1x1 -geometry +1+1 -background gray $@ $(SEND-TO-LOG)
142 $(RM) temp.jpg
144 html/sample-source.jpg: $(CLQR)-numbers.tex
145 $(HEAD) -n 57 $< | $(TAIL) -n 40 | $(CONVERT) -font Courier -crop 120x80+30+2 +repage label:@- temp.jpg $(SEND-TO-LOG)
146 $(MONTAGE) temp.jpg -tile 1x1 -geometry +1+1 -background gray $@ $(SEND-TO-LOG)
147 $(RM) temp.jpg
149 html/latest-changes.html: $(CLQR).tex $(CLQR)-*.tex
150 if $(GIT_LOG) -5 --pretty=format:"<p><i>%ci</i>%n<br />%s%n<br />%b</p>" > $@; then true; else true; fi $(SEND-TO-LOG)
152 $(CLQR).tar.gz: $(CLQR).tex $(CLQR)-*.tex
153 if $(GIT_ARCHIVE) > $(CLQR).tar.gz; then true; else true; fi $(SEND-TO-LOG)
155 publishclean:
156 $(RM) *.ps *~ html/*~