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