/[svn]/Makefile.distrib
ViewVC logotype

Contents of /Makefile.distrib

Parent Directory Parent Directory | Revision Log Revision Log


Revision 466 - (show annotations)
Tue Jul 10 17:36:47 2007 UTC (5 years, 10 months ago) by abate
File size: 3825 byte(s)
[r2003-05-31 10:32:42 by cvscast] support for expat

Original author: cvscast
Date: 2003-05-31 10:32:43+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 -I misc/ pa_extend.cmo \
13 q_symbol.cmo \
14 -symbol cduce_version=\"$(VERSION)\" \
15 -symbol build_date=\"$(shell date +%Y-%m-%d)\"
16
17 ifeq ($(NATIVE), true)
18 SYNTAX += -symbol ocaml_compiler=\"native\"
19 else
20 SYNTAX += -symbol ocaml_compiler=\"bytecode\"
21 endif
22
23 VERSION = 0.0.9
24
25 SYNTAX_PARSER = -pp '$(SYNTAX)'
26
27 CAMLC_P = ocamlc
28 ifeq ($(PROFILE), true)
29 CAMLOPT_P = ocamlopt -p
30 ifeq ($(NATIVE), false)
31 CAMLC_P = ocamlcp -p a
32 SYNTAX_PARSER =
33 endif
34 else
35 CAMLOPT_P = ocamlopt -inline 25
36 endif
37
38 OPT = -warn-error A
39 CAMLC = ocamlfind $(CAMLC_P) $(OPT) $(PACKAGES)
40 CAMLOPT = ocamlfind $(CAMLOPT_P) $(OPT) $(PACKAGES)
41
42 ifeq ($(NATIVE), true)
43 EXTENSION = cmx
44 LINK = $(CAMLOPT) -linkpkg gramlib.cmxa mlexpat.cmxa
45 else
46 EXTENSION = cmo
47 LINK = $(CAMLC) -custom -linkpkg gramlib.cma mlexpat.cma
48 endif
49
50 all: cduce dtd2cduce local_website
51
52 # Source directories
53
54 DIRS = misc parser typing types runtime driver
55 CLEAN_DIRS = $(DIRS) tools tests
56
57 # Objects to build
58
59 OBJECTS = \
60 misc/state.cmo misc/pool.cmo misc/encodings.cmo misc/bool.cmo \
61 misc/pretty.cmo \
62 \
63 types/sortedList.cmo types/boolean.cmo types/ident.cmo \
64 types/intervals.cmo types/chars.cmo types/atoms.cmo types/normal.cmo \
65 types/types.cmo types/patterns.cmo types/sequence.cmo \
66 types/sample.cmo \
67 \
68 parser/location.cmo parser/wlexer.cmo parser/ast.cmo parser/parser.cmo \
69 \
70 typing/typed.cmo typing/typer.cmo \
71 \
72 runtime/value.cmo runtime/load_xml.cmo runtime/run_dispatch.cmo \
73 runtime/print_xml.cmo runtime/eval.cmo \
74 \
75 types/builtin.cmo driver/cduce.cmo
76
77 CDUCE = $(OBJECTS) driver/run.cmo
78 WEBIFACE = $(OBJECTS) driver/examples.cmo driver/webiface.cmo
79 DTD2CDUCE = tools/dtd2cduce.cmo
80
81 DEPEND = $(DIRS:=/*.ml) $(DIRS:=/*.mli)
82 INCLUDES = $(DIRS:%=-I %) -I expat
83
84 cduce: $(CDUCE:.cmo=.$(EXTENSION))
85 $(LINK) $(INCLUDES) -o $@ $^
86
87 webiface: $(WEBIFACE:.cmo=.$(EXTENSION))
88 $(LINK) -o $@ $^
89
90 dtd2cduce: $(DTD2CDUCE:.cmo=.$(EXTENSION))
91 $(LINK) -o $@ $^
92
93 .PHONY: compute_depend
94 compute_depend: misc/q_symbol.cmo
95 @echo "Computing dependencies ..."
96 ocamldep $(INCLUDES) $(SYNTAX_PARSER) $(DEPEND) | \
97 sed -e "s|: |: misc/q_symbol.cmo |" > depend
98
99 parser/wlexer.ml: parser/wlexer.mll
100 wlex parser/wlexer.mll
101
102 clean:
103 for i in $(CLEAN_DIRS); do \
104 (cd $$i; rm -f *.cmi *.cmo *.cma *.cmx *.o *~); \
105 done
106 (cd expat; make clean)
107 rm -f `find . -name "*~"`
108 rm -f *.cmi *.cmo *.cma *.cmx *.a *.cmxa *.o *~
109 rm -f cduce ocamlprof.dump
110 rm -f dtd2cduce pool webiface
111 rm -Rf prepro package
112 rm -f web/www/*.php web/www/*.html web/*~
113
114
115 .SUFFIXES: .ml .mli .cmo .cmi .cmx
116
117 misc/q_symbol.cmo: misc/q_symbol.ml
118 $(CAMLC) -c $<
119
120 .PHONY: expat
121 expat:
122 (cd expat; make)
123
124 .ml.cmo:
125 $(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
126
127 .ml.cmx:
128 $(CAMLOPT) -c $(SYNTAX_PARSER) $(INCLUDES) $<
129
130 .mli.cmi:
131 $(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
132
133 include depend
134
135 # CDuce-generated files
136
137 driver/examples.ml: cduce web/examples/build.cd web/examples/examples.xml
138 (cd web/examples; ../../cduce --quiet build.cd)
139
140 web/files: cduce web/site.cd
141 (cd web; ../cduce --quiet site.cd --arg -php site.xml)
142
143 #
144 # Customize the following variables to match the settings
145 # of your local web server
146 #
147 WEB_PREFIX = /var/www
148 CGI_DIR = $(WEB_PREFIX)/cgi-bin
149 CDUCE_HTML_DIR = $(WEB_PREFIX)/html
150
151 install_web_local:web/files webiface
152 cp web/www/*.php web/cduce.css $(CDUCE_HTML_DIR)/
153 cp webiface $(CGI_DIR)/
154 if test ! -d "$(CDUCE_HTML_DIR)/img" ; then \
155 mkdir $(CDUCE_HTML_DIR)/img; \
156 fi;
157 cp web/img/*.* $(CDUCE_HTML_DIR)/img
158
159
160 local_website: cduce
161 (cd web; ../cduce --quiet site.cd --arg site.xml)

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