/[pdpsoft]/trunk/grid-mw-security/ees/thesis/Makefile
ViewVC logotype

Annotation of /trunk/grid-mw-security/ees/thesis/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 650 - (hide annotations) (download)
Thu Aug 20 09:08:07 2009 UTC (12 years, 9 months ago) by aramv
File size: 5552 byte(s)
Added thesis directory
1 aramv 650 # Makefile for LaTeX files
2    
3     # Original Makefile from http://www.math.psu.edu/elkin/math/497a/Makefile
4    
5     # Please check http://www.acoustics.hut.fi/u/mairas/UltimateLatexMakefile
6     # for new versions.
7    
8     # Copyright (c) 2005,2006 (in order of appearance):
9     # Matti Airas <Matti.Airas@hut.fi>
10     # Rainer Jung
11     # Antoine Chambert-Loir
12     # Timo Kiravuo
13    
14     # Permission is hereby granted, free of charge, to any person obtaining
15     # a copy of this software and associated documentation files (the
16     # "Software"), to deal in the Software without restriction, including
17     # without limitation the rights to use, copy, modify, merge, publish,
18     # distribute, sublicense, and/or sell copies of the Software, and to
19     # permit persons to whom the Software is furnished to do so, subject to
20     # the following conditions:
21    
22     # The above copyright notice and this permission notice shall be
23     # included in all copies or substantial portions of the Software.
24    
25     # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26     # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27     # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
28     # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
29     # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
30     # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
31     # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32    
33     # $Id: Makefile,v 1.18 2006-06-19 10:58:11 mairas Exp $
34    
35     LATEX = latex
36     BIBTEX = bibtex
37     MAKEINDEX = makeindex
38     XDVI = xdvi -gamma 4
39     DVIPS = dvips
40     DVIPDF = dvipdft
41     L2H = latex2html
42     GH = gv
43    
44     RERUN = "(There were undefined references|Rerun to get (cross-references|the bars) right)"
45     RERUNBIB = "No file.*\.bbl|Citation.*undefined"
46     MAKEIDX = "^[^%]*\\makeindex"
47     MPRINT = "^[^%]*print"
48     USETHUMBS = "^[^%]*thumbpdf"
49    
50     DATE=$(shell date +%Y-%m-%d)
51    
52     COPY = if test -r $(<:%.tex=%.toc); then cp $(<:%.tex=%.toc) $(<:%.tex=%.toc.bak); fi
53     RM = rm -f
54     OUTDATED = echo "EPS-file is out-of-date!" && false
55    
56     # These are OK
57    
58     SRC := $(shell egrep -l '^[^%]*\\begin\{document\}' *.tex)
59     TRG = $(SRC:%.tex=%.dvi)
60     PSF = $(SRC:%.tex=%.ps)
61     PDF = $(SRC:%.tex=%.pdf)
62    
63     # These are not
64    
65     #BIBFILE := $(shell perl -ne '($$_)=/^[^%]*\\bibliography\{(.*?)\}/;@_=split /,/;foreach $$b (@_) {print "$$b.bib "}' $(SRC))
66     #DEP := $(shell perl -ne '($$_)=/^[^%]*\\include\{(.*?)\}/;@_=split /,/;foreach $$t (@_) {print "$$t.tex "}' $(SRC))
67     #EPSPICS := $(shell perl -ne '@foo=/^[^%]*\\(includegraphics|psfig)(\[.*?\])?\{(.*?)\}/g;if (defined($$foo[2])) { if ($$foo[2] =~ /.eps$$/) { print "$$foo[2] "; } else { print "$$foo[2].eps "; }}' $(SRC) $(DEP))
68    
69    
70     define run-latex
71     $(COPY);$(LATEX) $<
72     egrep $(MAKEIDX) $< && ($(MAKEINDEX) $(<:%.tex=%);$(COPY);$(LATEX) $<) >/dev/null; true
73     egrep -c $(RERUNBIB) $(<:%.tex=%.log) && ($(BIBTEX) $(<:%.tex=%);$(COPY);$(LATEX) $<) ; true
74     egrep $(RERUN) $(<:%.tex=%.log) && ($(COPY);$(LATEX) $<) >/dev/null; true
75     egrep $(RERUN) $(<:%.tex=%.log) && ($(COPY);$(LATEX) $<) >/dev/null; true
76     if cmp -s $(<:%.tex=%.toc) $(<:%.tex=%.toc.bak); then true ;else $(LATEX) $< ; fi
77     $(RM) $(<:%.tex=%.toc.bak)
78     # Display relevant warnings
79     egrep -i "(Reference|Citation).*undefined" $(<:%.tex=%.log) ; true
80     endef
81    
82     define run-pdflatex
83     LATEX=pdflatex
84     @$(run-latex)
85     endef
86    
87     define get_dependencies
88     deps=`perl -ne '($$_)=/^[^%]*\\\(?:include|input)\{(.*?)\}/;@_=split /,/;foreach $$t (@_) {print "$$t.tex "}' $<`
89     endef
90    
91     define getbibs
92     bibs=`perl -ne '($$_)=/^[^%]*\\\bibliography\{(.*?)\}/;@_=split /,/;foreach $$b (@_) {print "$$b.bib "}' $< $$deps`
93     endef
94    
95     define geteps
96     epses=`perl -ne '@foo=/^[^%]*\\\(includegraphics|psfig)(\[.*?\])?\{(.*?)\}/g;if (defined($$foo[2])) { if ($$foo[2] =~ /.eps$$/) { print "$$foo[2] "; } else { print "$$foo[2].eps "; }}' $< $$deps`
97     endef
98    
99     define manconf
100     mandeps=`if test -r $(basename $@).cnf ; then cat $(basename $@).cnf |tr -d '\n\r' ; fi`
101     endef
102    
103     all : $(TRG)
104    
105     .PHONY : all show clean ps pdf showps veryclean
106    
107     clean :
108     -rm -f $(TRG) $(PSF) $(PDF) $(TRG:%.dvi=%.aux) $(TRG:%.dvi=%.bbl) $(TRG:%.dvi=%.blg) $(TRG:%.dvi=%.log) $(TRG:%.dvi=%.out) $(TRG:%.dvi=%.idx) $(TRG:%.dvi=%.ilg) $(TRG:%.dvi=%.ind) $(TRG:%.dvi=%.toc) $(TRG:%.dvi=%.d)
109    
110     veryclean : clean
111     -rm -f *.log *.aux *.dvi *.bbl *.blg *.ilg *.toc *.lof *.lot *.idx *.ind *.ps *~
112    
113     # This is a rule to generate a file of prerequisites for a given .tex file
114     %.d : %.tex
115     $(get_dependencies) ; echo $$deps ; \
116     $(getbibs) ; echo $$bibs ; \
117     $(geteps) ; echo $$epses ; \
118     $(manconf) ; echo $$mandeps ;\
119     echo "$*.dvi $@ : $< $$deps $$bibs $$epses $$mandeps" > $@
120    
121     include $(SRC:.tex=.d)
122    
123     # $(DEP) $(EPSPICS) $(BIBFILE)
124     $(TRG) : %.dvi : %.tex
125     @$(run-latex)
126    
127     $(PSF) : %.ps : %.dvi
128     @$(DVIPS) $< -o $@
129    
130     $(PDF) : %.pdf : %.dvi
131     @$(DVIPDF) -o $@ $<
132     # To use pdflatex, comment the two lines above and uncomment the lines below
133     #$(PDF) : %.pdf : %.tex
134     # @$(run-pdflatex)
135    
136    
137     show : $(TRG)
138     @for i in $(TRG) ; do $(XDVI) $$i & done
139    
140     showps : $(PSF)
141     @for i in $(PSF) ; do $(GH) $$i & done
142    
143     ps : $(PSF)
144    
145     pdf : $(PDF)
146    
147     # TODO: This probably needs fixing
148     html : @$(DEP) $(EPSPICS)
149     @$(L2H) $(SRC)
150    
151    
152    
153     ######################################################################
154     # Define rules for EPS source files.
155    
156     # These rules probably just cause unnecessary confusion, so commenting
157     # them away for the time being. -- mairas 2005-01-12
158    
159     #%.eps: %.sxd
160     # $(OUTDATED)
161     #%.eps: %.sda
162     # $(OUTDATED)
163     #%.eps: %.png
164     # $(OUTDATED)
165     #%.eps: %.sxc
166     # $(OUTDATED)
167     #%.eps: %.xcf
168     # $(OUTDATED)
169     #%.eps: %.zargo
170     # $(OUTDATED)
171     #%.eps: %.m
172     # @egrep -q $(MPRINT) $< && ($(OUTDATED))

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28