1 | # Makefile - Delphes
|
---|
2 | # X. Rouby 25.12.2008
|
---|
3 | #
|
---|
4 | # ----- Usage -----
|
---|
5 | # "make" or "make all" or "make pdf" : creates the dvi/ps/pdf file
|
---|
6 | # "make figure" : creates a tar ball with the list of figures.
|
---|
7 | # try "make what" for more info
|
---|
8 |
|
---|
9 | # ----- Files & Directories -----
|
---|
10 | # figure concerns
|
---|
11 | EPSDIR=all_eps/
|
---|
12 | EPSFILES=$(wildcard $(EPSDIR))
|
---|
13 | EPSTARBZ=list_of_figures.tar.bz
|
---|
14 | # article concerns
|
---|
15 | SOURCEFILE=notes
|
---|
16 | TEXFILES=$(SOURCEFILE).tex
|
---|
17 | # all concerns
|
---|
18 | VPATH=.:$(EPSDIR)
|
---|
19 | LATEXOPT = --interaction batchmode
|
---|
20 | # batchmode remove the screen output from 'latex' and 'pdflatex'; This output is recovered with 'make debug' or 'make pdfdebug'
|
---|
21 |
|
---|
22 | # ----- make all -----
|
---|
23 | all: pdf
|
---|
24 | dvi: $(SOURCEFILE).dvi
|
---|
25 | ps: $(SOURCEFILE).ps
|
---|
26 | #pdf: lowres
|
---|
27 | pdf: highres
|
---|
28 | #'make highres' uses ps2pdf -> heavy file but high resolution figures
|
---|
29 | #'make lowres' uses pdflatex -> light file but low resolution figures
|
---|
30 | figure: epstarbz
|
---|
31 | manual: $(MANUAL).pdf
|
---|
32 |
|
---|
33 | # ----- Suffix rules -----
|
---|
34 | $(SOURCEFILE).aux: $(TEXFILES) $(EPSFILES)
|
---|
35 | @echo
|
---|
36 | @echo Build $(SOURCEFILE).aux for proper references
|
---|
37 | @latex $(LATEXOPT) $(SOURCEFILE).tex
|
---|
38 | @echo `ls $@` : done.
|
---|
39 |
|
---|
40 | $(SOURCEFILE).dvi: $(SOURCEFILE).aux $(EPSFILES)
|
---|
41 | @echo
|
---|
42 | @echo Build $(SOURCEFILE).dvi from the .tex file
|
---|
43 | @latex $(LATEXOPT) $(SOURCEFILE).tex
|
---|
44 | @echo `ls $@` : done.
|
---|
45 |
|
---|
46 | $(SOURCEFILE).ps: $(SOURCEFILE).dvi $(EPSFILES)
|
---|
47 | @echo
|
---|
48 | @echo Build $(SOURCEFILE).ps from the .dvi file
|
---|
49 | @dvips -q $(SOURCEFILE).dvi -o $(SOURCEFILE).ps
|
---|
50 | @echo `ls $@` : done.
|
---|
51 |
|
---|
52 | $(SOURCEFILE).pdf: pdf
|
---|
53 |
|
---|
54 | #'make lowres' uses pdflatex -> light file but low resolution figures
|
---|
55 | lowres: $(TEXFILES) $(PNGFILES)
|
---|
56 | @echo
|
---|
57 | @echo "Build $(SOURCEFILE).pdf from the .tex file, with pdflatex"
|
---|
58 | @pdflatex $(LATEXOPT) $(SOURCEFILE).tex
|
---|
59 | @pdflatex $(LATEXOPT) $(SOURCEFILE).tex
|
---|
60 | @echo "`ls $(SOURCEFILE).pdf` (low resolution) : done."
|
---|
61 |
|
---|
62 | #'make highres' uses ps2pdf -> heavy file but high resolution figures
|
---|
63 | highres: $(SOURCEFILE).ps $(EPSFILES)
|
---|
64 | @echo
|
---|
65 | @echo "Build $(SOURCEFILE).pdf from the .ps file, with ps2pdf"
|
---|
66 | @ps2pdf $< $(SOURCEFILE).pdf
|
---|
67 | @echo "`ls $(SOURCEFILE).pdf` (high resolution) : done."
|
---|
68 |
|
---|
69 | debug: $(TEXFILES) $(EPSFILES)
|
---|
70 | @echo
|
---|
71 | @echo Build $(SOURCEFILE).dvi with debug info
|
---|
72 | @-rm -f $(SOURCEFILE).dvi
|
---|
73 | @latex $(SOURCEFILE).tex
|
---|
74 | @mv $(SOURCEFILE).dvi debug_$(SOURCEFILE).dvi
|
---|
75 | @echo 'debug_$(SOURCEFILE).dvi' done, '$(SOURCEFILE).dvi' removed.
|
---|
76 |
|
---|
77 | pdfdebug: $(TEXFILES) $(EPSFILES)
|
---|
78 | @echo
|
---|
79 | @echo Build $(SOURCEFILE).pdf with debug info
|
---|
80 | @-rm -f $(SOURCEFILE).pdf
|
---|
81 | @pdflatex $(SOURCEFILE).tex
|
---|
82 | @mv $(SOURCEFILE).pdf debug_$(SOURCEFILE).pdf
|
---|
83 | @echo 'debug_$(SOURCEFILE).pdf' done, '$(SOURCEFILE).pdf' removed.
|
---|
84 |
|
---|
85 | clean:
|
---|
86 | @echo
|
---|
87 | @echo "Removes the useless files (*.aux *.log *.out *.toc *.lof *.out)"
|
---|
88 | @-rm *.aux *.log *.out *.toc *.lof *.out -f
|
---|
89 | @echo done.
|
---|
90 |
|
---|
91 | cleanall:
|
---|
92 | @echo
|
---|
93 | @echo Removes all output files and the useless files
|
---|
94 | @-rm $(SOURCEFILE).pdf $(SOURCEFILE).ps *$(SOURCEFILE).dvi $(MANUAL).pdf *.aux *.log *.toc *.lof *.out *.backup *~ -f
|
---|
95 | @echo done.
|
---|
96 |
|
---|
97 | $(EPSTARBZ): $(EPSFILES)
|
---|
98 | @echo
|
---|
99 | @echo Creating $(EPSTARBZ)
|
---|
100 | @tar cjf $(EPSTARBZ) $(EPSDIR)
|
---|
101 | @echo `ls $(EPSTARBZ)` : done.
|
---|
102 |
|
---|
103 | epstarbz: $(EPSTARBZ)
|
---|
104 |
|
---|
105 |
|
---|
106 |
|
---|
107 | what:
|
---|
108 | @echo
|
---|
109 | @echo Try one of these :
|
---|
110 | @echo " 'make' or 'make all' or 'make pdf': creates the pdf files from $(SOURCEFILE).tex"
|
---|
111 | @echo " choose between 'make highres' (ps2pdf) and 'make lowres' (pdflatex) for the $(SOURCEFILE).pdf quality. Default is lowres (faster)."
|
---|
112 | @echo " 'make aux', 'make dvi', 'make ps', 'make pdf' also work"
|
---|
113 | @echo " 'make debug' and 'make pdfdebug' are the same as 'make dvi' and 'make pdf' with more output info"
|
---|
114 | @echo " 'make figure' : creates a tarball ($(EPSTARBZ)) with all the figures in eps"
|
---|
115 | @echo " 'make epstarbz' also work"
|
---|
116 | @echo " 'make clean' : removes the useless files (.aux .log)"
|
---|
117 | @echo " 'make cleanall' : removes all the outfiles ($(SOURCEFILE).pdf $(SOURCEFILE).ps $(SOURCEFILE).dvi)"
|
---|
118 | @echo " 'make what' : this help"
|
---|
119 |
|
---|