This repository has been archived by the owner on Aug 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile.old
197 lines (151 loc) · 4.8 KB
/
Makefile.old
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
#!gmake
#
# Makefile for man pages - this is now deprecated. CMake is now in
# charge of building the manual, and it should require much less
# interaction.
#
RM = /bin/rm -f
RMDIR = /bin/rm -rf
TOUCH = touch
# Do NOT set the make shell to csh ;-)
CHMOD = chmod 664
TEX = latex
PDFTEX = pdflatex
BIB = bibtex
IDX = makeindex -s hfill.ist
DVIPS = dvips
# Binaries from the gromacs/src/contrib directory
PRFN = prfn
COPYRGT = copyrgt
# Normal installed GROMACS binaries
OPTIONS = g_options
TEXFS = algorithms analyse averages \
defunits files forcefield \
implement install intro \
macros mdp_opt \
proglist progman programs \
special topology
AUXFS = algorithms analyse averages \
defunits forcefield implement \
install intro \
progman programs special \
topology
AUXFILES = $(foreach FILE,$(AUXFS), $(FILE).aux)
TEXFILES = $(foreach FILE,$(TEXFS), $(FILE).tex)
#
# ps is made as a dependency to booklet.ps,
# pdf as a dependency to booklet.pdf,
# and letter.ps as a dependency to letterbooklet.ps
all: plots pdf
#booklet.ps letterbooklet.ps
ps: gromacs.ps
pdf: gromacs.pdf
full: man all
dvi: gromacs.dvi
#
# make a booklet, i.e. 4 pages onto one double-sided page.
# To get the booklet, rearrange the pages according to page numbering
# and fold in the middle.
#
booklet.ps: gromacs.ps
psbook $^ | psnup -pa4 -2 | pstops -pa4 "2:0,1U(1w,1h)" > $@
letterbooklet.ps: letter.ps
psbook $^ | psnup -pletter -2 | pstops -pletter "2:0,1U(1w,1h)" > $@
plots:
(cd plots; make pdf; cd ..)
# Texexec 2.1 (comes with debian) works to create pdf booklets,
# but not the 1.2 version that comes with redhat. In the latter
# case you get 250 copies of the front page and a 300 Mb file...
booklet.pdf: gromacs.pdf
texexec --pdf --pdfarrange --paper=a5a4 --print=up --result=booklet.pdf gromacs.pdf
gromacs.tex: $(TEXFILES)
gromacs.aux: gromacs.tex $(TEXFILES)
$(TEX) gromacs
dvi_bib+idx: gromacs.tex
$(TEX) gromacs
$(BIB) gromacs
$(IDX) gromacs
./subindex gromacs.ind > gromacs.sind
mv gromacs.sind gromacs.ind
pdf_bib+idx: gromacs.tex
$(PDFTEX) gromacs
$(BIB) gromacs
$(IDX) gromacs
./subindex gromacs.ind > gromacs.sind
mv gromacs.sind gromacs.ind
gromacs.dvi: dvi_bib+idx gromacs.aux
gromacs.ps: gromacs.dvi
dvips -M -o $@ $^
# Need to run pdflatex an extra time to get hyperlinks right
gromacs.pdf: pdf_bib+idx gromacs.aux
$(PDFTEX) gromacs
$(PDFTEX) gromacs
letter.ps: gromacs.dvi
dvips -M -t Letter -O 0.3cm,-0.9cm -o $@ $^
%.aux: %.tex
prog: mdp_opt.tex proglist.tex
man:
ifeq ($(GMXBIN),)
@echo "Error: To create LaTeX manual pages, the GMXBIN"
@echo "variable must point to your binary directory."
@echo "(Source the GMXRC script in your installation)"
@exit 1;
endif
./mkman $(GMXBIN)
files.tex:
@if ./$(PRFN) >/dev/null 2>&1; then :; \
else \
if $(PRFN) >/dev/null 2>&1; then :; \
else \
echo "Error: Can't find the executable '$(PRFN)' in the current"; \
echo "directory or in your path (I need it to create latex files)."; \
echo "(Compile and copy it from the GROMACS contrib directory)"; \
exit 1 ; \
fi; \
fi
# we will only get here if PRFN could be executed
$(RM) files.html; ./mkfiles ;
g_options.tex:
@if ./$(OPTIONS) -hidden -man tex >/dev/null 2>&1; then :; \
else \
if $(OPTIONS) -hidden -man tex >/dev/null 2>&1; then :; \
else \
echo "Error: Can't find the executable '$(OPTIONS)' in the current"; \
echo "directory or in your path (I need it to create latex files)."; \
exit 1 ; \
fi; \
fi;
# don't want the section header to actually be g_options
sed -i -e 's/g_options/options/g' g_options.tex
progman.tex: g_options.tex
$(TOUCH) progman.tex
mdp_opt.tex: mkmdp
ifeq ($(GMXDATA),)
@echo "Error: To create the LaTeX mdp options file, the"
@echo "GMXDATA variable must point to your GROMACS data directory"
@echo "in which we can find the GROMACS html directory."
@echo "(Source the GMXRC script in your installation)"
@exit 1;
endif
./mkmdp $(GMXDATA)/html
programs.txt:
cp $(GMXSOURCE)/admin/programs.txt .
proglist.tex: ./mk_proglist programs.txt
# If you dont have admin/programs.txt from the gromacs source, just touch it
# and create the manual without the program descriptions.
./mk_proglist
copyrgt:
@if ./$(COPYRGT) *.tex >/dev/null 2>&1; then :; \
else \
if $(COPYRGT) *.tex >/dev/null 2>&1; then :; \
else \
echo "Error: Can't find the executable '$(COPYRGT)' in the current"; \
echo "directory or in your path (I need it to create LaTeX files)."; \
echo "(Compile and copy it from the GROMACS contrib directory)"; \
exit 1 ; \
fi; \
fi;
clean:
$(RM) *.log *.lof *.lot *.bbl *.blg *.toc *.dvi *.aux *.ps *~ \#*\# *.idx *.ilg *.ind *.out
$(RM) progman.tex
$(RMDIR) progman