/[svn]/Makefile.distrib
ViewVC logotype

Contents of /Makefile.distrib

Parent Directory Parent Directory | Revision Log Revision Log


Revision 450 - (show annotations)
Tue Jul 10 17:35:49 2007 UTC (5 years, 10 months ago) by abate
File size: 3885 byte(s)
[r2003-05-26 22:11:24 by cvscast] get rid of Cduce_config

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

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