/[svn]/Makefile.distrib
ViewVC logotype

Contents of /Makefile.distrib

Parent Directory Parent Directory | Revision Log Revision Log


Revision 731 - (show annotations)
Tue Jul 10 17:59:21 2007 UTC (5 years, 10 months ago) by abate
File size: 4947 byte(s)
[r2003-10-15 09:18:00 by szach] removed trailing whitespace from VERSION variable which caused an
erroneous camlp4 invocation

Original author: szach
Date: 2003-10-15 09:18:00+00:00
1 include Makefile.conf
2 VERSION = 0.2.0-1
3
4 PACKAGES = pxp-engine pxp-lex-iso88591 ulex camlp4 num cgi pcre netstring
5 ifeq ($(PXP_WLEX), true)
6 PACKAGES += pxp-wlex-utf8
7 else
8 PACKAGES += pxp-lex-utf8
9 endif
10
11 SYNTAX = -I misc/ q_symbol.cmo \
12 -symbol cduce_version=\"$(VERSION)\" \
13 -symbol build_date=\"$(shell date +%Y-%m-%d)\" \
14 -symbol session_dir=\"$(SESSION_DIR)\"
15
16 ifeq ($(NATIVE), true)
17 SYNTAX += -symbol ocaml_compiler=\"native\"
18 else
19 SYNTAX += -symbol ocaml_compiler=\"bytecode\"
20 endif
21
22 ifeq ($(EXPAT), true)
23 PACKAGES += expat
24 SYNTAX += -symbol EXPAT=
25 endif
26
27 SYNTAX_PARSER = -syntax camlp4o $(SYNTAX:%=-ppopt %)
28
29 CAMLC_P = ocamlc -g
30 DEPEND_OCAMLDEP = misc/q_symbol.cmo
31 ifeq ($(PROFILE), true)
32 CAMLOPT_P = ocamlopt -p
33 ifeq ($(NATIVE), false)
34 CAMLC_P = ocamlcp -p a
35 SYNTAX_PARSER =
36 DEPEND_OCAMLDEP =
37 endif
38 else
39 CAMLOPT_P = ocamlopt -inline 25
40 endif
41
42 OPT = -warn-error FPS
43 OCAMLFIND = ocamlfind
44 CAMLC = $(OCAMLFIND) $(CAMLC_P) $(OPT) -package "$(PACKAGES)"
45 CAMLOPT = $(OCAMLFIND) $(CAMLOPT_P) $(OPT) -package "$(PACKAGES)"
46
47 ifeq ($(NATIVE), true)
48 EXTENSION = cmx
49 LINK = $(CAMLOPT) -linkpkg gramlib.cmxa
50 else
51 EXTENSION = cmo
52 LINK = $(CAMLC) -custom -linkpkg gramlib.cma
53 endif
54
55 all: cduce dtd2cduce
56
57
58 install: all
59 mkdir -p $(PREFIX)/bin/
60 mkdir -p $(PREFIX)/man/man1/
61 install -m755 cduce dtd2cduce $(PREFIX)/bin/
62 install -m644 doc/cduce.1 $(PREFIX)/man/man1/
63
64 uninstall:
65 rm $(PREFIX)/bin/cduce $(PREFIX)/bin/dtd2cduce $(PREFIX)/man/man1/cduce.1
66
67 # Source directories
68
69 DIRS = misc parser schema typing types compile runtime driver
70 CLEAN_DIRS = $(DIRS) tools tests
71
72 # Objects to build
73
74 OBJECTS = \
75 misc/stats.cmo \
76 misc/serialize.cmo misc/custom.cmo \
77 misc/state.cmo misc/pool.cmo misc/encodings.cmo misc/bool.cmo \
78 misc/pretty.cmo misc/ns.cmo misc/inttbl.cmo \
79 \
80 types/sortedList.cmo types/boolean.cmo types/ident.cmo \
81 types/intervals.cmo types/chars.cmo types/atoms.cmo \
82 types/normal.cmo \
83 types/types.cmo types/patterns.cmo types/sequence.cmo \
84 types/sample.cmo types/builtin_defs.cmo \
85 \
86 runtime/value.cmo \
87 \
88 schema/schema_types.cmo schema/schema_xml.cmo schema/schema_builtin.cmo \
89 schema/schema_validator.cmo schema/schema_parser.cmo \
90 \
91 parser/location.cmo parser/ulexer.cmo parser/ast.cmo parser/parser.cmo \
92 \
93 typing/typed.cmo typing/typer.cmo \
94 \
95 compile/lambda.cmo \
96 \
97 runtime/load_xml.cmo runtime/run_dispatch.cmo \
98 runtime/explain.cmo \
99 runtime/print_xml.cmo runtime/eval.cmo \
100 compile/compile.cmo \
101 compile/operators.cmo \
102 \
103 types/builtin.cmo driver/librarian.cmo driver/cduce.cmo
104
105 CDUCE = $(OBJECTS) driver/run.cmo
106 WEBIFACE = $(OBJECTS) driver/examples.cmo driver/webiface.cmo
107 DTD2CDUCE = tools/dtd2cduce.cmo
108
109 ALL_OBJECTS = $(OBJECTS) \
110 driver/run.cmo driver/examples.cmo driver/webiface.cmo \
111 tools/dtd2cduce.cmo
112
113 DEPEND = $(ALL_OBJECTS:.cmo=.ml) $(ALL_OBJECTS:.cmo=.mli)
114
115 INCLUDES = $(DIRS:%=-I %)
116
117 cduce: $(CDUCE:.cmo=.$(EXTENSION))
118 $(LINK) $(INCLUDES) -o $@ $^
119
120 bug: $(OBJECTS) bug.cmo
121 $(LINK) $(INCLUDES) -o $@ $^
122
123 webiface: $(WEBIFACE:.cmo=.$(EXTENSION))
124 $(LINK) $(INCLUDES) -o $@ $^ -ccopt -static
125 # webiface is made static to be able to move it more easily
126 # (to compile it on a machine which is not the web server)
127
128 dtd2cduce: $(DTD2CDUCE:.cmo=.$(EXTENSION))
129 $(LINK) $(INCLUDES) -o $@ $^
130
131 validate: $(OBJECTS:.cmo=.$(EXTENSION)) tools/validate.ml
132 $(LINK) $(INCLUDES) -o $@ $^
133
134 .PHONY: compute_depend
135 compute_depend: $(DEPEND_OCAMLDEP)
136 @echo "Computing dependencies ..."
137 ocamlfind ocamldep -package "$(PACKAGES)" $(INCLUDES) $(SYNTAX_PARSER) $(DEPEND) | \
138 sed -e "s|: |: misc/q_symbol.cmo |" > depend
139
140 clean:
141 for i in $(CLEAN_DIRS); do \
142 (cd $$i; rm -f *.cmi *.cmo *.cma *.cmx *.o *~); \
143 done
144 (cd expat; $(MAKE) clean)
145 rm -f `find . -name "*~"`
146 rm -f *.cmi *.cmo *.cma *.cmx *.a *.cmxa *.o *~
147 rm -f cduce ocamlprof.dump
148 rm -f dtd2cduce pool webiface validate
149 rm -Rf prepro package
150 rm -f web/www/*.html web/*~
151 rm -f web/*.cdo
152
153
154 .SUFFIXES: .ml .mli .cmo .cmi .cmx
155
156 misc/q_symbol.cmo: misc/q_symbol.ml
157 $(CAMLC) -c -pp 'camlp4o pa_extend.cmo q_MLast.cmo' $<
158
159 .ml.cmo:
160 $(CAMLC) -c $(INCLUDES) $(SYNTAX_PARSER) $<
161
162 .ml.cmx:
163 $(CAMLOPT) -c $(SYNTAX_PARSER) $(INCLUDES) $<
164
165 .mli.cmi:
166 $(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
167
168 include depend
169
170 # CDuce-generated files
171
172 driver/examples.ml: cduce web/examples/build.cd web/examples/examples.xml
173 (cd web/examples; ../../cduce --quiet build.cd --arg examples.xml)
174
175 webpages: cduce web/site.cdo
176 (cd web; ../cduce --run site.cdo --arg site.xml)
177
178 web/site.cdo: cduce web/xhtml.cdo web/site.cd
179 ./cduce -I web/ --compile web/site.cd
180
181 web/xhtml.cdo: cduce web/xhtml.cd
182 ./cduce -I web/ --compile web/xhtml.cd
183
184 website: webpages webiface
185
186 install_web: website
187 cp web/www/*.html web/cduce.css $(HTML_DIR)/
188 cp CHANGES $(HTML_DIR)/
189 cp webiface $(CGI_DIR)/cduce
190 if test ! -d "$(HTML_DIR)/img" ; then \
191 mkdir $(HTML_DIR)/img; \
192 fi;
193 cp web/img/*.* $(HTML_DIR)/img

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