/[svn]/cduce/trunk/Makefile
ViewVC logotype

Contents of /cduce/trunk/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 434 - (show annotations)
Tue Jul 10 17:34:46 2007 UTC (5 years, 11 months ago) by abate
Original Path: Makefile
File size: 4924 byte(s)
[r2003-05-25 18:16:08 by cvscast] cduce_config

Original author: cvscast
Date: 2003-05-25 18:16:09+00:00
1 NATIVE = true
2 PROFILE = false
3 PXP_WLEX = false
4
5 PACKAGES = -package "pxp-engine pxp-lex-iso88591 wlexing camlp4 num cgi"
6 ifeq ($(PXP_WLEX), true)
7 PACKAGES += -package pxp-wlex-utf8
8 else
9 PACKAGES += -package pxp-lex-utf8
10 endif
11
12 SYNTAX = camlp4o pa_extend.cmo
13
14 VERSION = 0.0.9 (alpha)
15
16 ifeq ($(PROFILE), true)
17 CAMLC_P = ocamlcp -p a
18 CAMLOPT_P = ocamlopt -p
19 SYNTAX_PARSER =
20 else
21 CAMLC_P = ocamlc
22 CAMLOPT_P = ocamlopt
23 SYNTAX_PARSER = -pp '$(SYNTAX)'
24 endif
25
26 OPT = -warn-error A
27 CAMLC = ocamlfind $(CAMLC_P) $(OPT) $(PACKAGES)
28 CAMLOPT = ocamlfind $(CAMLOPT_P) $(OPT) $(PACKAGES)
29
30 ifeq ($(NATIVE), true)
31 EXTENSION = cmx
32 LINK = $(CAMLOPT) -linkpkg gramlib.cmxa
33 else
34 EXTENSION = cmo
35 LINK = $(CAMLC) -custom -linkpkg gramlib.cma
36 endif
37
38 all: cduce dtd2cduce local_website
39
40 # Source directories
41
42 DIRS = misc parser typing types runtime driver
43 CLEAN_DIRS = $(DIRS) tools tests
44
45 # Objects to build
46
47 OBJECTS = \
48 misc/cduce_config.cmo \
49 misc/state.cmo misc/pool.cmo misc/encodings.cmo misc/bool.cmo \
50 misc/pretty.cmo \
51 \
52 types/sortedList.cmo types/boolean.cmo types/ident.cmo \
53 types/intervals.cmo types/chars.cmo types/atoms.cmo types/normal.cmo \
54 types/types.cmo types/patterns.cmo types/sequence.cmo \
55 types/sample.cmo \
56 \
57 parser/location.cmo parser/wlexer.cmo parser/ast.cmo parser/parser.cmo \
58 \
59 typing/typed.cmo typing/typer.cmo \
60 \
61 runtime/value.cmo runtime/load_xml.cmo runtime/run_dispatch.cmo \
62 runtime/print_xml.cmo runtime/eval.cmo \
63 \
64 types/builtin.cmo driver/cduce.cmo
65
66 CDUCE = $(OBJECTS) driver/run.cmo
67 WEBIFACE = $(OBJECTS) driver/examples.cmo driver/webiface.cmo
68 DTD2CDUCE = tools/dtd2cduce.cmo
69
70 DEPEND = $(DIRS:=/*.ml) $(DIRS:=/*.mli)
71 INCLUDES = $(DIRS:%=-I %)
72
73 PREPRO = $(SYNTAX) pr_o.cmo
74
75 misc/cduce_config.cmo: misc/cduce_config.ml
76 $(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
77 rm -f misc/cduce_config.ml
78
79 misc/cduce_config.cmx: misc/cduce_config.ml
80 $(CAMLOPT) -c $(SYNTAX_PARSER) $(INCLUDES) $<
81 rm -f misc/cduce_config.ml
82
83 misc/cduce_config.ml:
84 sed -e 's|%%VERSION%%|$(VERSION)|' \
85 -e 's|%%BUILD_DATE%%|$(shell date +%Y-%m-%d)|' \
86 -e 's|%%NATIVE%%|$(NATIVE)|' \
87 misc/cduce_config.mlp > misc/cduce_config.ml
88
89
90 cduce: $(CDUCE:.cmo=.$(EXTENSION))
91 $(LINK) $(INCLUDES) -o $@ $^
92
93 webiface: $(WEBIFACE:.cmo=.$(EXTENSION))
94 $(LINK) -o $@ $^
95
96 dtd2cduce: $(DTD2CDUCE:.cmo=.$(EXTENSION))
97 $(LINK) -o $@ $^
98
99 .PHONY: compute_depend
100 compute_depend:
101 @echo "Computing dependencies ..."
102 ocamldep $(INCLUDES) $(SYNTAX_PARSER) $(DEPEND) > depend
103
104 parser/wlexer.ml: parser/wlexer.mll
105 wlex parser/wlexer.mll
106
107 clean:
108 for i in $(CLEAN_DIRS); do \
109 (cd $$i; rm -f *.cmi *.cmo *.cma *.cmx *.o *~); \
110 done
111 rm -f `find -name "*~"`
112 rm -f *.cmi *.cmo *.cma *.cmx *.a *.cmxa *.o *~
113 rm -f cduce ocamlprof.dump
114 rm -f dtd2cduce pool webiface
115 rm -Rf prepro package
116 rm -f web/www/*.php web/www/*.html web/*~
117
118
119 .SUFFIXES: .ml .mli .cmo .cmi .cmx
120
121 .ml.cmo:
122 $(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
123
124 .ml.cmx:
125 $(CAMLOPT) -c $(SYNTAX_PARSER) $(INCLUDES) $<
126
127 .mli.cmi:
128 $(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
129
130 include depend
131
132 # CDuce-generated files
133
134 driver/examples.ml: cduce web/examples/build.cd web/examples/examples.xml
135 (cd web/examples; ../../cduce --quiet build.cd)
136
137 web/files: cduce web/site.cd
138 (cd web; ../cduce --quiet site.cd --arg -php site.xml)
139
140 # Packaging
141
142 write_header:
143 headache -h header $(DEPEND)
144
145 remove_header:
146 headache -r $(DEPEND)
147
148 # For development
149
150 pull: tools/pull.$(EXTENSION)
151 $(LINK) -o $@ $^
152
153 profile:
154 rm -Rf prepro
155 mkdir prepro
156 for i in $(DIRS); do \
157 mkdir prepro/$$i; \
158 for j in $$i/*.ml $$i/*.mli; do \
159 if [ -f "$$j" ]; then \
160 echo $$j; \
161 $(PREPRO) $$j -o prepro/$$j; \
162 fi; \
163 done; \
164 done
165 cp parser/wlexer.mll prepro/parser/
166 cp Makefile depend prepro/
167 (cd prepro; make cduce PROFILE=true SYNTAX_PARSER= NATIVE=false)
168
169 # Site-specific installation
170
171 cedre_build:
172 rsh cedre ". .env; cd IMPLEM/CDUCE; make webiface; make web/files"
173 install_web:
174 scp web/www/*.php web/cduce.css cduce@iris:public_html/
175 scp webiface cduce@iris:cgi-bin/cduce
176 ssh cduce@iris "chmod +s cgi-bin/cduce"
177
178
179 #
180 # Customize the following variables to match the settings
181 # of your local web server
182 #
183 WEB_PREFIX = /var/www
184 CGI_DIR = $(WEB_PREFIX)/cgi-bin
185 CDUCE_HTML_DIR = $(WEB_PREFIX)/html
186
187 install_web_local:web/files webiface
188 cp web/www/*.php web/cduce.css $(CDUCE_HTML_DIR)/
189 cp webiface $(CGI_DIR)/
190 if test ! -d "$(CDUCE_HTML_DIR)/img" ; then \
191 mkdir $(CDUCE_HTML_DIR)/img; \
192 fi;
193 cp web/img/*.* $(CDUCE_HTML_DIR)/img
194
195 website: web/files
196 scp web/www/*.php web/cduce.css cduce@iris.ens.fr:public_html/
197
198 local_website: cduce
199 (cd web; ../cduce --quiet site.cd --arg site.xml)
200
201 # Distribution
202
203 DISTRIB = $(DIRS) tools web depend INSTALL CHANGES LICENSE README Makefile
204
205 .PHONY: package
206 package:
207 rm -Rf package
208 mkdir package
209 cp -R $(DISTRIB) package/
210 (cd package; headache -h ../header $(DEPEND); rm -Rf `find -name "CVS"`)
211

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