1 | # ================================================================ |
---|
2 | # $Id: makefile,v 1.8 2004/05/07 00:55:51 bittner Exp $ |
---|
3 | # ================================================================ |
---|
4 | #/** @author Jiri Bittner */ |
---|
5 | |
---|
6 | ### For Tex Files ##### |
---|
7 | #################### |
---|
8 | PROJECT = report |
---|
9 | ##################### |
---|
10 | |
---|
11 | BACKUPPATH = ./backup |
---|
12 | SHELL=/bin/sh |
---|
13 | |
---|
14 | ########################################## |
---|
15 | |
---|
16 | |
---|
17 | |
---|
18 | ######################################### |
---|
19 | PRINT = lpr -Pduplex |
---|
20 | |
---|
21 | MAKE = make |
---|
22 | TAR = tar |
---|
23 | |
---|
24 | DVI =$(PROJECT).dvi |
---|
25 | PS =$(PROJECT).ps |
---|
26 | PDF =$(PROJECT).pdf |
---|
27 | HP =$(PROJECT).hp |
---|
28 | BIB =$(PROJECT).bbl |
---|
29 | DEPEND = *.tex |
---|
30 | DEPALL = $(DEPEND) *.ps |
---|
31 | ZIP = zip |
---|
32 | MAKE_GLOSSARY=./makeglossary |
---|
33 | |
---|
34 | |
---|
35 | $(DVI): $(DEPEND) |
---|
36 | @make code |
---|
37 | @make epsimages |
---|
38 | -latex $(PROJECT) |
---|
39 | |
---|
40 | noimages: |
---|
41 | -latex $(PROJECT) |
---|
42 | |
---|
43 | $(PS): $(DVI) |
---|
44 | @dvips -t a4 -o$(PS) $(DVI) |
---|
45 | |
---|
46 | $(MAKE_GLOSSARY): |
---|
47 | gcc -o $(MAKE_GLOSSARY) $(MAKE_GLOSSARY).c |
---|
48 | |
---|
49 | |
---|
50 | gloss: $(MAKE_GLOSSARY) |
---|
51 | $(MAKE_GLOSSARY) $(PROJECT) |
---|
52 | |
---|
53 | $(PROJECT).gls: $(PROJECT).tex |
---|
54 | make gloss |
---|
55 | |
---|
56 | $(BIB): $(DVI) |
---|
57 | bibtex $(PROJECT) |
---|
58 | |
---|
59 | bibl: |
---|
60 | make $(BIB) |
---|
61 | |
---|
62 | reb: $(DEPEND) # $(PROJECT).gls |
---|
63 | -latex $(PROJECT) |
---|
64 | make bibl |
---|
65 | -latex $(PROJECT) |
---|
66 | |
---|
67 | |
---|
68 | f: $(DEPEND) |
---|
69 | @rm $(DVI) |
---|
70 | make $(DVI) |
---|
71 | |
---|
72 | show: |
---|
73 | $(MAKE) $(DVI) |
---|
74 | @xdvi -shrinkbutton3 6 -shrinkbutton4 9 -s 9 $(DVI) & |
---|
75 | |
---|
76 | sshow: |
---|
77 | $(MAKE) $(DVI) |
---|
78 | @xdvi -s 7 $(DVI) & |
---|
79 | |
---|
80 | #-mgs3 1100x600 |
---|
81 | |
---|
82 | pshow: |
---|
83 | $(MAKE) $(PDF) |
---|
84 | @acroread $(PDF) & |
---|
85 | |
---|
86 | kshow: |
---|
87 | $(MAKE) $(DVI) |
---|
88 | @kdvi $(DVI) & |
---|
89 | |
---|
90 | tar: |
---|
91 | @if(test -e core) then rm core; fi |
---|
92 | @$(TAR) Zcvf "$(BACKUPPATH)/$(PROJECT)`date +%d.%b-%H.%M`.tar.Z" * |
---|
93 | |
---|
94 | zip: |
---|
95 | @if(test -e core) then rm core; fi |
---|
96 | @$(ZIP) -r "$(BACKUPPATH)/$(PROJECT)`date +%d.%b-%H.%M`.zip" * -x backup/* |
---|
97 | |
---|
98 | ziptex: |
---|
99 | @if(test -e core) then rm core; fi |
---|
100 | @$(ZIP) "$(BACKUPPATH)/$(PROJECT)-tex`date +%d.%b-%H.%M`.zip" makefile *.tex *.bib *.mac *.sty *.cls *.bst Bib/*.bib code/* figs/* images/* plots/* -x backup/* |
---|
101 | |
---|
102 | |
---|
103 | clean: |
---|
104 | -@rm -f *~ *.log *.dvi *.aux *.toc \ |
---|
105 | $(PROJECT).blg $(PROJECT).bbl $(PROJECT).out $(PROJECT).tpt \ |
---|
106 | $(PROJECT).brf |
---|
107 | @if(test -e core) then rm core; fi |
---|
108 | @if(test -e $(MAKE_GLOSSARY)) then rm $(MAKE_GLOSSARY); fi |
---|
109 | @make -C images clean |
---|
110 | @make -C figs clean |
---|
111 | @make -C plots clean |
---|
112 | |
---|
113 | cleanall: |
---|
114 | @make clean |
---|
115 | @if(test -e $(PS)) then rm $(PS); fi |
---|
116 | @if(test -e $(PDF)) then rm $(PDF); fi |
---|
117 | |
---|
118 | ps: |
---|
119 | make $(PS) |
---|
120 | |
---|
121 | pspdf: $(DVI) |
---|
122 | dvips -Ppdf -G0 -t A4 -o$(PS) $(DVI) |
---|
123 | ps2pdf -dMaxSubsetPct=100 -dCompatibilityLevel=1.3 \ |
---|
124 | -dSubsetFonts=true -dEmbedAllFonts=true \ |
---|
125 | -dAutoFilterColorImages=false \ |
---|
126 | -dAutoFilterGrayImages=false \ |
---|
127 | -dColorImageFilter=/FlateEncode \ |
---|
128 | -dGrayImageFilter=/FlateEncode \ |
---|
129 | -dMonoImageFilter=/FlateEncode $(PS) $(PDF) |
---|
130 | |
---|
131 | pdf: |
---|
132 | make $(PDF) |
---|
133 | |
---|
134 | fpdf: |
---|
135 | @rm -f $(PDF) |
---|
136 | @make $(PDF) |
---|
137 | |
---|
138 | .PHONY: pdfimages |
---|
139 | pdfimages: |
---|
140 | @make -C figs pdf |
---|
141 | @make -C plots pdf |
---|
142 | @make -C images pdf |
---|
143 | |
---|
144 | .PHONY: epsimages |
---|
145 | epsimages: |
---|
146 | @make -C figs eps |
---|
147 | @make -C plots eps |
---|
148 | @make -C images eps |
---|
149 | |
---|
150 | |
---|
151 | .PHONY: images |
---|
152 | images: |
---|
153 | @make pdfimages |
---|
154 | @make epsimages |
---|
155 | |
---|
156 | .PHONY: code |
---|
157 | code: |
---|
158 | @make -C code |
---|
159 | |
---|
160 | |
---|
161 | $(PDF): $(DEPEND) |
---|
162 | @make code |
---|
163 | @make pdfimages |
---|
164 | @pdflatex $(PROJECT) |
---|
165 | |
---|
166 | pdfthumb: |
---|
167 | @make pdf |
---|
168 | @thumbpdf $(PROJECT) |
---|
169 | @make fpdf |
---|
170 | |
---|
171 | |
---|
172 | |
---|
173 | |
---|
174 | #dvipdf $(DVI) |
---|
175 | |
---|
176 | lps: |
---|
177 | @make $(DVI) |
---|
178 | @dvips -o$(PS) $(DVI) |
---|
179 | |
---|
180 | 4ps: $(DEPALL) ps |
---|
181 | rm -f 4$(PS) |
---|
182 | pstops '4:0@.5(0,0.45h)+1@.5(0,0)+2@0.5(0.5w,0.45h)+3@0.5(0.5w,0)' \ |
---|
183 | < $(PS) > 4$(PS) |
---|
184 | |
---|
185 | hp: $(PS) |
---|
186 | gs -q -dNOPAUSE -sPAPERSIZE=a4 -sOutputFile=$(HP) -sDEVICE=ljet4 -r600 $(PS) |
---|
187 | |
---|
188 | rotate: $(PS) |
---|
189 | @pstops -w1h -h1w '0L(1h,0)' $(PS) rotated-$(PS) |
---|
190 | |
---|
191 | print: |
---|
192 | $(MAKE) $(DVI) |
---|
193 | @dvips -o$(PS) $(DVI) |
---|
194 | $(PRINT) $(PS) |
---|
195 | |
---|
196 | help: |
---|
197 | @echo "------------------------------------------------------" |
---|
198 | @echo "implicit - rebuids the dvi" |
---|
199 | @echo "reb - rebuilds it twice" |
---|
200 | @echo "show - rebulds and runs xdvi" |
---|
201 | @echo "tar - makes a backup" |
---|
202 | @echo "clean - delets *~ *.log *.dvi *.aux *.toc" |
---|
203 | @echo "ps - generates ps from dvi" |
---|
204 | @echo "print - generates ps and sends it to the printer" |
---|
205 | @echo "------------------------------------------------------" |
---|
206 | |
---|
207 | |
---|
208 | login: |
---|
209 | cvs -d :pserver:$(CVSNAME)@sgi.felk.cvut.cz:/usr.sgi/CVS_archive login |
---|
210 | |
---|
211 | update: |
---|
212 | @echo "Updating in . ..." |
---|
213 | @export CVS_RSH=ssh ; cvs -z 8 update |
---|
214 | @echo "done." |
---|
215 | @echo |
---|
216 | |
---|
217 | commit: |
---|
218 | # @echo "Type in the comment terminated by ENTER, Ctrl-Z, ENTER." |
---|
219 | @echo "Commiting ...." |
---|
220 | @export CVS_RSH=ssh ; cvs -z 8 commit -m "" |
---|
221 | @echo "done." |
---|
222 | @echo |
---|