File: Makefile

package info (click to toggle)
haskell98-report 20080907-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,144 kB
  • sloc: haskell: 4,075; makefile: 322
file content (270 lines) | stat: -rw-r--r-- 8,514 bytes parent folder | download | duplicates (4)
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# Makefile for the Haskell Report
# read the README file before you start!
#
#	Target 'jfp' copies stuff into $(JFP_DIR) for the JFP book
#	you need to do the same in the libraries directory

##########################################
# What to make if you type 'make'

default: haskell.ps html

# Begin by saying
#	touch haskell.idx


#########################################
#	Tools you need
#########################################

# Stuf from the tools/directory
RUN_TEX   = ../tools/run_tex
RUN_INDEX = ../tools/run_index
VERBATIM  = ../tools/verbatim

# splitAndIndexPgm won't work unless you have "perl"
SPLITPGM = perl ../tools/splitAndIndexPgm

RM    = rm -f
LATEX = latex
MAKEINDEX = makeindex

# 'expand' expands tabs to spaces
# On my machine the windows program (which does something
# quite different) shadows it.  Sigh.
EXPAND = expand
# EXPAND = c:/cygwin/bin/expand


#########################################
#	Files 
#########################################

PREFIX = ../haskell98-revised
RELEASE_DIR = $(PREFIX)
PS_DIR = $(RELEASE_DIR)
PDF_DIR = $(RELEASE_DIR)
HTML_DIR = $(RELEASE_DIR)/html
JFP_DIR = ../jfp-release

PARTS =		preface-jfp.tex $(PARTS_NO_PREFACE)
PARTS_NO_PREFACE = iso-chars.tex \
		intro.tex lexemes.tex  exps.tex \
		decls.tex  modules.tex  basic.tex  io-13.tex \
		derived.tex \
		index-extra.tex index-intro.tex layout.tex \
		literate.tex pragmas.tex standard-prelude.tex \
		ratio.tex complex.tex ix.tex \
                numeric.tex \
                array.tex io.tex char.tex monad.tex list.tex \
                system.tex directory.tex \
                maybe.tex time.tex cputime.tex random.tex \
		locale.tex 

SYNTAX =	syntax-lexical.tex syntax-iso.tex

CODE =		lib-code/Ratio.tex lib-code/Complex.tex lib-code/Ix.tex \
                lib-code/Numeric.tex \
                lib-code/Array.tex lib-code/Char.tex lib-code/List.tex \
                lib-code/Monad.tex lib-code/Maybe.tex lib-code/IO.tex \
		lib-code/Time.tex lib-code/Locale.tex

HEADERS =	lib-hdrs/Ratio.tex lib-hdrs/Complex.tex lib-hdrs/Ix.tex \
                lib-hdrs/Numeric.tex \
                lib-hdrs/Array.tex lib-hdrs/IO.tex lib-hdrs/Char.tex \
		lib-hdrs/List.tex lib-hdrs/List1.tex \
                lib-hdrs/Monad.tex lib-hdrs/System.tex lib-hdrs/Directory.tex \
                lib-hdrs/Maybe.tex lib-hdrs/IO1.tex lib-hdrs/Random.tex \
		lib-hdrs/Time.tex lib-hdrs/Time1.tex lib-hdrs/CPUTime.tex \
		lib-hdrs/Locale.tex 

PRELUDE =	Prelude.tex PreludeList.tex PreludeText.tex PreludeIO.tex

LIBPARTS =	lib-array.tex lib-intro.tex lib-io.tex lib-num.tex lib-os.tex lib-text.tex \
		lib-index-intro.tex lib-posix.tex

LIBS =		LibMonadicIO.tex LibStdIO.tex LibIOError.tex LibReadTextIO.tex LibWriteTextIO.tex \
		LibSystem.tex LibDirectory.tex LibCPUTime.tex LibTime.tex LibUserInterrupt.tex \
		LibRatio.tex LibArray.tex LibComplex.tex LibText.tex \
		LibIO.tex LibIx.tex LibPosix.tex


#########################################
#	Main targets
#########################################

# The normally formatted report -- 2 sided, one-up
haskell.verb: plain_haskell.verb
	-cp plain_haskell.verb haskell.verb

haskell.tex: haskell.verb
	$(EXPAND) < $< | $(VERBATIM) >$@

haskell.dvi:  haskell.tex ${PARTS} $(SYNTAX) ${PRELUDE}

# I have no idea why run_tex is run twice.  SLPJ
html: index.html haskell.dvi ${PARTS} ${SYNTAX} ${PRELUDE}
	-mkdir haskell98-report-html
	$(RUN_TEX)
	$(RUN_TEX)
	$(RUN_INDEX)
	cp index.html *.gif haskell98-report-html

haskell.dvi: haskell.tex haskell.ind ${PARTS} $(SYNTAX) ${PRELUDE}  ${CODE} ${HEADERS}

haskell.idx: haskell.tex ${PARTS} $(SYNTAX) ${PRELUDE}  ${CODE} ${HEADERS}

haskell.ind: haskell.idx
	$(MAKEINDEX) -i -t haskell.ilg < haskell.idx > haskell.ind

haskell.ps : haskell.dvi
	dvips haskell.dvi -o haskell.ps

# Can't use pdflatex because of eps inclusion
haskell.pdf : haskell.ps
	ps2pdf haskell.ps haskell.pdf

install: haskell.ps haskell.pdf html
	mkdir -p $(PS_DIR) $(PDF_DIR) $(HTML_DIR)
	cp haskell.ps $(PS_DIR)/haskell98-report.ps
	cp haskell.pdf $(PDF_DIR)/haskell98-report.pdf
	cp -r haskell98-report-html $(HTML_DIR)
	cp h98-revised.html $(HTML_DIR)/index.html
	cp haskell98-bugs.html h98.gif $(HTML_DIR)
	cp haskell98-revised-bugs.html $(HTML_DIR)


release: haskell.ps html $(RELEASE_DIR)
	ps2pdf haskell.ps
	gzip < haskell.ps > $(RELEASE_DIR)/haskell.ps.gz
	cp haskell.pdf $(RELEASE_DIR)/haskell.pdf
	cp -r haskell98-report-html $(RELEASE_DIR)
	tar cvf - haskell98-report-html | gzip > $(RELEASE_DIR)/haskell98-report-html.tar.gz
	cp h98-revised.html $(RELEASE_DIR)/index.html
	cp haskell98-bugs.html h98.gif $(RELEASE_DIR)
	cp haskell98-revised-bugs.html h98.gif $(RELEASE_DIR)

$(RELEASE_DIR):
	mkdir $@

publish-pdf: report.pdf
	gzip < report.pdf > y:Haskell/haskell98-report/report.pdf.gz


#########################################
#	Generic stuff
#########################################

veryclean: clean
	$(RM) *~ 

clean:
	$(RM) $(PRELUDE) reportrefs
	$(RM) *.dvi *.log *.aux *.ilg *.blg *.toc ${PARTS} $(SYNTAX) \
		haskell.tex haskell.ps haskell.pdf *.o lex.yy.c haskell.ind
	$(RM) -r haskell98-report-html/
	$(RM) lib-code/*.tex lib-hdrs/*.tex
	$(RM) haskell.idx


#########################################
#	Suffix rules
#########################################

.SUFFIXES:	.hi .hs .verb .tex .dvi .idx

.verb.tex:
	$(EXPAND) < $< | $(VERBATIM) | ../tools/subsection >$@
# The 'subsection' part changes section -> chapter for the book style

.hs.verb:
	$(EXPAND) < $< | $(SPLITPGM) >$@

%.tex: %.hs
	$(EXPAND) < $< | $(SPLITPGM) | $(VERBATIM) >$@

.hi.tex:
	$(EXPAND) < $< | $(SPLITPGM) | $(VERBATIM) >$@

.tex.dvi:
	$(LATEX) $<
	$(LATEX) $<
	$(LATEX) $<

.tex.idx:
	$(LATEX) $<

# -----------------------------------------------------------
#			Out of date stuff
# -----------------------------------------------------------

# Report as formatted for SIGPLAN -- 2 sided, 2-up, odd pages on left.
# This is a bit horrible.  But almost nobody should need to do this. KH
sigplan_haskell.dvi: sigplan_haskell.verb sigplan_article.sty \
	             haskell.tex haskell.ind \
		     ${PARTS} $(SYNTAX) ${PRELUDE}
	cp sigplan_article.sty article.sty
	cp sigplan_haskell.verb haskell.verb
	-make haskell.dvi
	cp plain_haskell.verb haskell.verb


sigplan_haskell-libraries.dvi:  sigplan_haskell-libraries.tex haskell-libraries.ind ${LIBPARTS} ${LIBS}

haskell-libraries.dvi:  haskell-libraries.tex haskell-libraries.ind ${LIBPARTS} ${LIBS}

# ----------------------- END OF OLD SIGPLAN STUFF -----------------------------------

jfp: h98-book.tex preface-jfp.tex ${PARTS_NO_PREFACE} $(SYNTAX) ${PRELUDE}
	-mkdir $(JFP_DIR)
	for n in h98-book.tex preface-jfp.tex \
		${PARTS_NO_PREFACE} $(SYNTAX) ${PRELUDE} ; do  \
		../tools/subsection < $$n >  $(JFP_DIR)/$$n ; done 
	cp classes.eps $(JFP_DIR)
	cp  haskell.bbl $(JFP_DIR)/h98-book.bbl
	cp Makefile-jfp-book $(JFP_DIR)/Makefile




# Stuff to make the "two-up" version for SIGPLAN Notices:
# We take the A4 pages and double them up onto (virtual) A3 pages:
# (two A5 pages make one A4 page; two A4 pages make one A3 page; ...)
#
#	% dvidvi '2:0,1(210mm,0)' haskell.dvi > haskell-2up.dvi
#
# We now print the "A3" pages in landscape, but "magnify" them by
# 1 / sqrt(2) ~ 0.7071; this should make our "A4" pages print in an
# A4 space: presto! 2up printing!
# (except that I've tried to make it give us 1" margins all round
#  when we print on US 8.5"x11" paper)
#
#	% dvips -t landscape -x 707 haskell-2up.dvi > haskell-2up.ps
#
# if your "dvips" is set up properly, it will run Metafont for you,
# creating just-right magnifications for all the fonts.
#
# print with: lpr -Pmy-laserwriter haskell-2up.ps

# These rules keep failing for me (segmentation fault on haskell-2up.dvi)
# The output seems fine, though, and the individual commands work
# perfectly(!).  More network wierdness?  KH

haskell-2up.ps : haskell-2up.dvi
	dvips -t landscape -x 707 haskell-2up.dvi > haskell-2up.ps

haskell-2up.dvi : haskellx.dvi
	-dvidvi '2:0(0in,0in),1(160mm,0in)' haskellx.dvi > haskell-2up.dvi

haskellx.dvi : sigplan_haskell.dvi
	dviselect =4: haskell.dvi haskellx.dvi

haskell-libraries-2up.ps : haskell-libraries-2up.dvi
	dvips -t landscape -x 707 haskell-libraries-2up.dvi > haskell-libraries-2up.ps

haskell-libraries-2up.dvi : haskell-librariesx.dvi
	-dvidvi '2:0(0in,0in),1(160mm,0in)' haskell-librariesx.dvi > haskell-libraries-2up.dvi

haskell-librariesx.dvi : sigplan_haskell-libraries.dvi
	dviselect =4: sigplan_haskell-libraries.dvi haskell-librariesx.dvi