File: Makefile.in

package info (click to toggle)
ocamlweb 1.39-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 800 kB
  • ctags: 837
  • sloc: ml: 5,780; sh: 1,756; makefile: 214
file content (291 lines) | stat: -rw-r--r-- 7,844 bytes parent folder | download
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291

# where to install the binaries
prefix=@prefix@
exec_prefix=@exec_prefix@
BINDIR=@bindir@

# where to install the man page
MANDIR=@mandir@

# where to install the style file
BASETEXDIR = $(prefix)/share/texmf
TEXDIR = $(BASETEXDIR)/tex/latex/misc

# command to update TeX' kpathsea database
MKTEXLSR = @MKTEXLSR@
UPDATETEX = $(MKTEXLSR) /usr/share/texmf /var/spool/texmf $(BASETEXDIR) > /dev/null

# Version
# ATTENTION A BIEN UTILISER UN NUMERO DE VERSION DE LA FORME X.YY
# (requete de Ralf pour la Debian)
MAJORVN=1
MINORVN=39
VERSION=$(MAJORVN).$(MINORVN)
BUILD_DATE="$(shell date)"

OCAMLBEST=@OCAMLBEST@

CAMLC    = @OCAMLC@
CAMLCOPT = @OCAMLOPT@
CAMLDEP  = @OCAMLDEP@

ZLIBS    = -I ocaml-parser -I ocamllex-parser
DEBUG    =
PROFILE  =
BYTEFLAGS= $(ZLIBS) $(DEBUG)
OPTFLAGS = $(ZLIBS) $(PROFILE)

CAML_CMO = ocaml-parser/misc.cmo ocaml-parser/clflags.cmo	\
	   ocaml-parser/terminfo.cmo ocaml-parser/warnings.cmo	\
           ocaml-parser/linenum.cmo ocaml-parser/location.cmo	\
	   ocaml-parser/longident.cmo \
           ocaml-parser/syntaxerr.cmo ocaml-parser/parser.cmo	\
           ocaml-parser/lexer.cmo ocaml-parser/parse.cmo

CAML_CMX = $(CAML_CMO:.cmo=.cmx)

CAMLLEX_CMO = ocamllex-parser/lex_parser.cmo ocamllex-parser/lex_lexer.cmo

CAMLLEX_CMX = $(CAMLLEX_CMO:.cmo=.cmx)

CMO = output.cmo yacc_syntax.cmo yacc_parser.cmo yacc_lexer.cmo cross.cmo pretty.cmo \
      web.cmo doclexer.cmo \
      version.cmo main.cmo

CMX = $(CMO:.cmo=.cmx)

all: @OCAMLBEST@

opt: ocamlweb

byte: ocamlweb.byte

ocamlweb: $(CAML_CMX) $(CAMLLEX_CMX) $(CMX)
	$(CAMLCOPT) $(OPTFLAGS) -o $@ $(CAML_CMX) $(CAMLLEX_CMX) $(CMX)
	strip ocamlweb

ocamlweb.byte: $(CAML_CMO) $(CAMLLEX_CMO) $(CMO)
	$(CAMLC) $(BYTEFLAGS) -o $@ $(CAML_CMO) $(CAMLLEX_CMO) $(CMO)

ocamlweb.static: $(CAML_CMX) $(CAMLLEX_CMX) $(CMX)
	$(CAMLCOPT) $(OPTFLAGS) -cclib -static -o $@ $(CAML_CMX) $(CAMLLEX_CMX) $(CMX)
	strip $@

debug: $(CAML_CMO) $(CAMLLEX_CMO) $(CMO)
	$(CAMLC) $(BYTEFLAGS) -o ocamlweb-debug $(CAML_CMO) $(CAMLLEX_CMO) $(CMO)

version.ml: Makefile
	echo "let version = \""$(VERSION)"\"" > version.ml
	echo "let date = \""$(BUILD_DATE)"\"" >> version.ml

install-indep:
	mkdir -p $(BINDIR)
	mkdir -p $(MANDIR)/man1
	cp doc/ocamlweb.1 $(MANDIR)/man1
	mkdir -p $(TEXDIR)
	cp ocamlweb.sty $(TEXDIR)
	$(UPDATETEX)

install: install-indep
	if test @OCAMLBEST@ = opt ; then \
		cp ocamlweb $(BINDIR) ; \
	else \
		cp ocamlweb.byte $(BINDIR)/ocamlweb ; \
	fi

install-byte: install-indep
	cp ocamlweb.byte $(BINDIR)/ocamlweb

local: ocamlweb
	cp ocamlweb $$HOME/bin/$$OSTYPE
	cp doc/ocamlweb.1 $$HOME/man/man1
	cp ocamlweb.sty $$HOME/tex/inputs

install-demons: ocamlweb.static
	cp ocamlweb.static /users/demons/demons/bin/$$OSTYPE/ocamlweb
	cp doc/ocamlweb.1 /users/demons/demons/man/man1
	cp ocamlweb.sty /users/demons/demons/tex/inputs

manual:
	make -C doc VERSION=$(VERSION) all

LATEX=TEXINPUTS=..: ; export TEXINPUTS ; latex

TESTFILES=test/test.mli test/test.ml test/test_lex.mll test/test_yacc.mly

test/test.tex: ocamlweb $(TESTFILES)
	./ocamlweb $(TESTFILES) -o test/test.tex

.PHONY: test

test: ocamlweb.sty test/test.tex
	cd test; $(LATEX) test
	cd test ; grep -q "Rerun" test.log && ($(LATEX) test) || true
	- cd test ; hevea -o test.html ../ocamlweb.sty test.tex
	xdvi test/test.dvi

BOOTSTRAP= bootstrap.tex output.mli output.ml \
	   yacc_parser.mly yacc_lexer.mll cross.mli cross.ml \
           pretty.mli pretty.mll \
	   web.mli web.ml doclexer.mli doclexer.mll main.ml

bootstrap: ocamlweb
	./ocamlweb -o test/ocamlweb.tex $(BOOTSTRAP)
	cd test; $(LATEX) ./ocamlweb
	cd test; grep -q "Rerun" ocamlweb.log && ($(LATEX) ./ocamlweb) || true
	- cd test; hevea -o ocamlweb.html ../ocamlweb.sty ocamlweb.tex
	cd test; dvips ocamlweb.dvi -o ocamlweb.ps

check: bootstrap

# export
########

NAME=ocamlweb-$(VERSION)

FTP = $(HOME)/ftp/ocamlweb
WWW = $(HOME)/WWW/ocamlweb

FILES = *.ml* ocamlweb.sty bootstrap.tex				\
	Makefile.in configure.in configure .depend \
	README INSTALL COPYING LGPL CHANGES

OCAMLFILES = misc.mli misc.ml clflags.ml	\
        terminfo.mli terminfo.ml		\
	warnings.mli warnings.ml		\
	linenum.mli linenum.mll			\
	location.mli location.ml		\
	longident.mli longident.ml		\
	syntaxerr.mli syntaxerr.ml		\
	asttypes.mli parsetree.mli		\
	parser.mly				\
	lexer.mli lexer.mll			\
	parse.mli parse.ml			\
	README LICENSE

OCAMLLEXFILES = lex_syntax.mli lex_parser.mly lex_lexer.mll

DOCFILES = doc/$(NAME)-man.tex doc/$(NAME)-man.html doc/ocamlweb.1

export: source linux
	cp README COPYING LGPL CHANGES $(FTP)
	make -C doc VERSION=$(VERSION) all export
	make export-bootstrap
	mail -s "nouvelle release d'ocamlweb" treinen@debian.org < /dev/null

export-bootstrap: bootstrap
	gzip -c test/ocamlweb.ps > $(FTP)/ocamlweb.ps.gz
	cp test/ocamlweb.html $(FTP)

source: clean manual
	mkdir -p export/$(NAME)/test
	cd export/$(NAME); mkdir -p ocaml-parser; mkdir -p ocamllex-parser; mkdir -p test; \
	  mkdir -p doc; mkdir -p support
	cp $(FILES) export/$(NAME)
	cp $(DOCFILES) export/$(NAME)/doc
	cd ocaml-parser; cp $(OCAMLFILES) ../export/$(NAME)/ocaml-parser
	cd ocamllex-parser; cp $(OCAMLLEXFILES) ../export/$(NAME)/ocamllex-parser
	cd support; cp config.guess config.sub install-sh \
	  ../export/$(NAME)/support
	cd export ; tar cf $(NAME).tar $(NAME) ; \
	  gzip -f --best $(NAME).tar
	cp export/$(NAME).tar.gz $(FTP)

BINARY = $(NAME)-$(OSTYPE)

linux: clean binary

solaris:
	rmake sun-demons $(HOME)/soft/ocaml/ocamlweb clean binary

BINARYFILES = README INSTALL COPYING LGPL ocamlweb ocamlweb.sty

binary: ocamlweb manual
	mkdir -p export/$(BINARY)/doc
	cp $(BINARYFILES) export/$(BINARY)
	cp $(DOCFILES) export/$(BINARY)/doc
	(cd export; tar czf $(BINARY).tar.gz $(BINARY))
	cp export/$(BINARY).tar.gz $(FTP)

# generic rules :
#################

.SUFFIXES: .mli .ml .cmi .cmo .cmx .mll

.mll.ml:
	ocamllex $<

.mli.cmi:
	$(CAMLC) -c $(BYTEFLAGS) $<

.ml.cmo:
	$(CAMLC) -c $(BYTEFLAGS) $<

.ml.o:
	$(CAMLCOPT) -c $(OPTFLAGS) $<

.ml.cmx:
	$(CAMLCOPT) -c $(OPTFLAGS) $<

ocaml-parser/parser.mli ocaml-parser/parser.ml: ocaml-parser/parser.mly
	ocamlyacc -v ocaml-parser/parser.mly

yacc_parser.mli yacc_parser.ml: yacc_parser.mly
	ocamlyacc -v yacc_parser.mly

ocamllex-parser/lex_parser.mli ocamllex-parser/lex_parser.ml: ocamllex-parser/lex_parser.mly
	ocamlyacc -v ocamllex-parser/lex_parser.mly

# Emacs tags
############

tags:
	etags "--regex=/let[ \t]+\([^ \t]+\)/\1/" \
	      "--regex=/let[ \t]+rec[ \t]+\([^ \t]+\)/\1/" \
	      "--regex=/and[ \t]+\([^ \t]+\)/\1/" \
	      "--regex=/type[ \t]+\([^ \t]+\)/\1/" \
              "--regex=/exception[ \t]+\([^ \t]+\)/\1/" \
	      "--regex=/val[ \t]+\([^ \t]+\)/\1/" \
	      "--regex=/module[ \t]+\([^ \t]+\)/\1/" *.mli *.ml

# myself

Makefile: Makefile.in config.status
	./config.status

config.status: configure
	./config.status --recheck

configure: configure.in
	autoconf

# clean and depend
##################

GENERATED = doclexer.ml pretty.ml version.ml yacc_lexer.ml \
	    yacc_parser.ml yacc_parser.mli yacc_parser.output \
            ocaml-parser/lexer.ml ocaml-parser/linenum.ml \
	    ocaml-parser/parser.mli ocaml-parser/parser.ml \
	    ocamllex-parser/lex_lexer.ml ocamllex-parser/lex_parser.ml \
	    ocamllex-parser/lex_parser.mli

clean:
	rm -f *~ *.cm[iox] *.o
	rm -f ocaml-parser/*~ ocaml-parser/*.cm[iox] ocaml-parser/*.o
	rm -f ocamllex-parser/*~ ocamllex-parser/*.cm[iox] ocamllex-parser/*.o
	rm -f ocamlweb ocamlweb.byte
	rm -f $(GENERATED)
	rm -f yacc-parser.output ocaml-parser/parser.output
	rm -f ocamllex-parser/lex_parser.output
	cd test; rm -f *.aux *.log *.dvi *.ps *.tex

dist-clean:: clean
	rm -f Makefile
	rm -f config.status config.cache config.log

depend: $(GENERATED)
	rm -f .depend
	ocamldep $(ZLIBS) *.mli *.ml ocaml-parser/*.ml ocaml-parser/*.mli ocamllex-parser/*.ml ocamllex-parser/*.mli > .depend

include .depend