/[svn]/Makefile.distrib.in
ViewVC logotype

Contents of /Makefile.distrib.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 445 - (show annotations)
Tue Jul 10 17:35:20 2007 UTC (5 years, 10 months ago) by abate
File size: 5956 byte(s)
[r2003-05-26 18:58:16 by cvscast] Beppe: changed for windows installation

Original author: cvscast
Date: 2003-05-26 18:58:16+00:00
1 #
2 # sample Makefile for Objective Caml
3 # Copyright (C) 2001 Jean-Christophe FILLIATRE
4 #
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Library General Public
7 # License version 2, as published by the Free Software Foundation.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 #
13 # See the GNU Library General Public License version 2 for more details
14 # (enclosed in the file LGPL).
15
16 # where to install the binaries
17 prefix=@prefix@
18 exec_prefix=@exec_prefix@
19 BINDIR=@bindir@
20
21 # where to install the man page
22 MANDIR=@mandir@
23
24 # other variables set by ./configure
25 OCAMLC = @OCAMLC@
26 OCAMLOPT = @OCAMLOPT@
27 OCAMLDEP = @OCAMLDEP@
28 OCAMLLEX = @OCAMLLEX@
29 OCAMLYACC= @OCAMLYACC@
30 OCAMLLIB = @OCAMLLIB@
31 OCAMLBEST= @OCAMLBEST@
32 OCAMLVERSION = @OCAMLVERSION@
33 OCAMLWEB = @OCAMLWEB@
34 OCAMLWIN32 = @OCAMLWIN32@
35 EXE = @EXE@
36
37 INCLUDES =
38 BFLAGS = -g $(INCLUDES)
39 OFLAGS = $(INCLUDES)
40
41 # main target
42 #############
43
44 NAME = cduce
45 NATIVE = true
46 PROFILE = false
47 PXP_WLEX = false
48
49 PACKAGES = -package "pxp-engine pxp-lex-iso88591 wlexing camlp4 num cgi"
50 ifeq ($(PXP_WLEX), true)
51 PACKAGES += -package pxp-wlex-utf8
52 else
53 PACKAGES += -package pxp-lex-utf8
54 endif
55
56 SYNTAX = camlp4o pa_extend.cmo
57
58 VERSION = 0.0.91
59
60 ifeq ($(PROFILE), true)
61 CAMLC_P = ocamlcp -p a
62 CAMLOPT_P = ocamlopt -p
63 SYNTAX_PARSER =
64 else
65 CAMLC_P = ocamlc
66 CAMLOPT_P = ocamlopt
67 SYNTAX_PARSER = -pp '$(SYNTAX)'
68 endif
69
70 OPT = -warn-error A
71 CAMLC = ocamlfind $(CAMLC_P) $(OPT) $(PACKAGES)
72 CAMLOPT = ocamlfind $(CAMLOPT_P) $(OPT) $(PACKAGES)
73
74 ifeq ($(NATIVE), true)
75 EXTENSION = cmx
76 LINK = $(CAMLOPT) -linkpkg gramlib.cmxa
77 else
78 EXTENSION = cmo
79 LINK = $(CAMLC) -custom -linkpkg gramlib.cma
80 endif
81
82 all: cduce dtd2cduce local_website
83
84
85 # Source directories
86
87 DIRS = misc parser typing types runtime driver
88 CLEAN_DIRS = $(DIRS) tools tests
89
90 # Objects to build
91
92 OBJECTS = \
93 misc/cduce_config.cmo \
94 misc/state.cmo misc/pool.cmo misc/encodings.cmo misc/bool.cmo \
95 misc/pretty.cmo \
96 \
97 types/sortedList.cmo types/boolean.cmo types/ident.cmo \
98 types/intervals.cmo types/chars.cmo types/atoms.cmo types/normal.cmo \
99 types/types.cmo types/patterns.cmo types/sequence.cmo \
100 types/sample.cmo \
101 \
102 parser/location.cmo parser/wlexer.cmo parser/ast.cmo parser/parser.cmo \
103 \
104 typing/typed.cmo typing/typer.cmo \
105 \
106 runtime/value.cmo runtime/load_xml.cmo runtime/run_dispatch.cmo \
107 runtime/print_xml.cmo runtime/eval.cmo \
108 \
109 types/builtin.cmo driver/cduce.cmo
110
111 CDUCE = $(OBJECTS) driver/run.cmo
112 WEBIFACE = $(OBJECTS) driver/examples.cmo driver/webiface.cmo
113 DTD2CDUCE = tools/dtd2cduce.cmo
114
115 DEPEND = $(DIRS:=/*.ml) $(DIRS:=/*.mli)
116 INCLUDES = $(DIRS:%=-I %)
117
118 PREPRO = $(SYNTAX) pr_o.cmo
119
120 misc/cduce_config.cmo: misc/cduce_config.ml
121 $(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
122 rm -f misc/cduce_config.ml
123
124 misc/cduce_config.cmx: misc/cduce_config.ml
125 $(CAMLOPT) -c $(SYNTAX_PARSER) $(INCLUDES) $<
126 rm -f misc/cduce_config.ml
127
128 misc/cduce_config.ml:
129 sed -e 's|%%VERSION%%|$(VERSION)|' \
130 -e 's|%%BUILD_DATE%%|$(shell date +%Y-%m-%d)|' \
131 -e 's|%%NATIVE%%|$(NATIVE)|' \
132 misc/cduce_config.mlp > misc/cduce_config.ml
133
134
135 cduce: $(CDUCE:.cmo=.$(EXTENSION))
136 $(LINK) $(INCLUDES) -o $@ $^
137
138 webiface: $(WEBIFACE:.cmo=.$(EXTENSION))
139 $(LINK) -o $@ $^
140
141 dtd2cduce: $(DTD2CDUCE:.cmo=.$(EXTENSION))
142 $(LINK) -o $@ $^
143
144 .PHONY: compute_depend
145 compute_depend:
146 @echo "Computing dependencies ..."
147 ocamldep $(INCLUDES) $(SYNTAX_PARSER) $(DEPEND) > depend
148
149 parser/wlexer.ml: parser/wlexer.mll
150 wlex parser/wlexer.mll
151
152
153
154
155
156
157
158
159
160 # bytecode and native-code compilation
161 ######################################
162
163 CMO =
164 CMX = $(CMO:.cmo=.cmx)
165
166 GENERATED = version.ml
167
168 byte: $(NAME).byte
169 opt: $(NAME).opt
170
171 $(NAME).byte: $(CMO)
172 $(OCAMLC) $(BFLAGS) -o $@ $^
173
174 $(NAME).opt: $(CMX)
175 $(OCAMLOPT) $(OFLAGS) -o $@ $^
176
177
178
179 version.ml: Makefile
180 echo "let version = \""$(VERSION)"\"" > version.ml
181 echo "let date = \""`date`"\"" >> version.ml
182
183 # installation
184 ##############
185
186 install-indep:
187 mkdir -p $(BINDIR)
188 mkdir -p $(MANDIR)/man1
189 cp -f doc/$(NAME).1 $(MANDIR)/man1
190
191 install: install-indep
192 cp -f $(NAME)$(EXE) $(BINDIR)/
193 cp -f dtd2cduce$(EXE) $(BINDIR)/
194
195 # generic rules
196 ###############
197
198 .SUFFIXES: .mli .ml .cmi .cmo .cmx
199
200 .ml.cmo:
201 $(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
202
203 .ml.cmx:
204 $(CAMLOPT) -c $(SYNTAX_PARSER) $(INCLUDES) $<
205
206 .mli.cmi:
207 $(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
208
209 include depend
210
211 # CDuce-generated files
212
213 driver/examples.ml: cduce web/examples/build.cd web/examples/examples.xml
214 (cd web/examples; ../../cduce --quiet build.cd)
215
216 web/files: cduce web/site.cd
217 (cd web; ../cduce --quiet site.cd --arg -php site.xml)
218
219 #
220 # Customize the following variables to match the settings
221 # of your local web server
222 #
223 WEB_PREFIX = /var/www
224 CGI_DIR = $(WEB_PREFIX)/cgi-bin
225 CDUCE_HTML_DIR = $(WEB_PREFIX)/html
226
227 install_web_local:web/files webiface
228 cp web/www/*.php web/cduce.css $(CDUCE_HTML_DIR)/
229 cp webiface $(CGI_DIR)/
230 if test ! -d "$(CDUCE_HTML_DIR)/img" ; then \
231 mkdir $(CDUCE_HTML_DIR)/img; \
232 fi;
233 cp web/img/*.* $(CDUCE_HTML_DIR)/img
234
235
236 local_website: cduce
237 (cd web; ../cduce --quiet site.cd --arg site.xml)
238
239 # Makefile is rebuilt whenever Makefile.in or configure.in is modified
240 ######################################################################
241
242 Makefile: Makefile.in config.status
243 ./config.status
244
245 config.status: configure
246 ./config.status --recheck
247
248 configure: configure.in
249 autoconf
250
251 # clean
252 #######
253
254 clean::
255 for i in $(CLEAN_DIRS); do \
256 (cd $$i; rm -f *.cmi *.cmo *.cma *.cmx *.o *~); \
257 done
258 rm -f `find -name "*~"`
259 rm -f *.cmi *.cmo *.cma *.cmx *.a *.cmxa *.o *~
260 rm -f cduce ocamlprof.dump
261 rm -f dtd2cduce pool webiface
262 rm -Rf prepro package
263 rm -f web/www/*.php web/www/*.html web/*~
264
265 dist-clean distclean:: clean
266 rm -f Makefile config.cache config.log config.status
267

CVS Admin">CVS Admin
ViewVC Help
Powered by ViewVC 1.1.5