/[svn]/Makefile
ViewVC logotype

Contents of /Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 419 - (show annotations)
Tue Jul 10 17:33:06 2007 UTC (5 years, 11 months ago) by abate
File size: 4307 byte(s)
[r2003-05-25 10:04:38 by cvscast] Beppe : more about local install

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

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