| 1 |
abate |
368 |
DEBUG = -g
|
| 2 |
|
|
OCAMLCP = ocamlc
|
| 3 |
|
|
OCAMLC = ocamlfind $(OCAMLCP) -package $(PACKAGES)
|
| 4 |
abate |
380 |
OCAMLOPT = ocamlfind ocamlopt -package $(PACKAGES)
|
| 5 |
abate |
368 |
# extra options:
|
| 6 |
|
|
# -p (profiling)
|
| 7 |
abate |
380 |
# -inline 25
|
| 8 |
abate |
22 |
|
| 9 |
abate |
399 |
PACKAGES = "pxp-engine pxp-lex-utf8 wlexing camlp4 num,cgi"
|
| 10 |
abate |
61 |
|
| 11 |
abate |
370 |
DISTRIB = $(DIRS) tools web depend INSTALL LICENSE README Makefile
|
| 12 |
abate |
61 |
|
| 13 |
abate |
370 |
all: cduce.opt dtd2cduce local_website
|
| 14 |
abate |
78 |
|
| 15 |
abate |
368 |
# Source directories
|
| 16 |
abate |
1 |
|
| 17 |
abate |
368 |
DIRS = misc parser typing types runtime driver
|
| 18 |
|
|
CLEAN_DIRS = $(DIRS) tools tests
|
| 19 |
abate |
4 |
|
| 20 |
abate |
368 |
# Objects to build
|
| 21 |
abate |
3 |
|
| 22 |
abate |
368 |
OBJECTS = \
|
| 23 |
|
|
misc/state.cmo misc/pool.cmo misc/encodings.cmo misc/bool.cmo \
|
| 24 |
|
|
misc/pretty.cmo \
|
| 25 |
|
|
\
|
| 26 |
|
|
types/sortedList.cmo types/boolean.cmo types/ident.cmo \
|
| 27 |
|
|
types/intervals.cmo types/chars.cmo types/atoms.cmo types/normal.cmo \
|
| 28 |
|
|
types/types.cmo types/patterns.cmo types/sequence.cmo types/builtin.cmo \
|
| 29 |
|
|
\
|
| 30 |
|
|
parser/location.cmo parser/wlexer.cmo parser/ast.cmo parser/parser.cmo \
|
| 31 |
|
|
\
|
| 32 |
|
|
typing/typed.cmo typing/typer.cmo \
|
| 33 |
|
|
\
|
| 34 |
|
|
runtime/value.cmo runtime/load_xml.cmo runtime/run_dispatch.cmo \
|
| 35 |
|
|
runtime/print_xml.cmo runtime/eval.cmo \
|
| 36 |
|
|
\
|
| 37 |
|
|
driver/cduce.cmo
|
| 38 |
abate |
45 |
|
| 39 |
abate |
368 |
CDUCE = $(OBJECTS) driver/run.cmo
|
| 40 |
|
|
WEBIFACE = $(OBJECTS) driver/examples.cmo driver/webiface.cmo
|
| 41 |
abate |
3 |
|
| 42 |
abate |
90 |
XCDUCE = $(CDUCE:.cmo=.cmx)
|
| 43 |
abate |
273 |
XWEBIFACE = $(WEBIFACE:.cmo=.cmx)
|
| 44 |
abate |
20 |
|
| 45 |
abate |
61 |
DEPEND = $(DIRS:=/*.ml) $(DIRS:=/*.mli)
|
| 46 |
|
|
INCLUDES = $(DIRS:%=-I %)
|
| 47 |
|
|
|
| 48 |
|
|
SYNTAX = camlp4o pa_extend.cmo
|
| 49 |
|
|
SYNTAX_PARSER = -pp '$(SYNTAX)'
|
| 50 |
|
|
PREPRO = $(SYNTAX) pr_o.cmo
|
| 51 |
|
|
|
| 52 |
abate |
90 |
cduce: $(CDUCE)
|
| 53 |
abate |
368 |
$(OCAMLC) $(DEBUG) -linkpkg -o $@ gramlib.cma $^
|
| 54 |
abate |
10 |
|
| 55 |
abate |
90 |
webiface: $(WEBIFACE)
|
| 56 |
abate |
368 |
$(OCAMLC) $(DEBUG) -linkpkg -o $@ gramlib.cma $^
|
| 57 |
abate |
63 |
|
| 58 |
abate |
71 |
dtd2cduce: tools/dtd2cduce.cmo
|
| 59 |
abate |
368 |
$(OCAMLC) $(DEBUG) -linkpkg -o $@ $^
|
| 60 |
abate |
71 |
|
| 61 |
abate |
124 |
cduce.opt: $(XCDUCE)
|
| 62 |
abate |
368 |
$(OCAMLOPT) -linkpkg -o $@ gramlib.cmxa $^
|
| 63 |
abate |
20 |
|
| 64 |
abate |
273 |
webiface.opt: $(XWEBIFACE)
|
| 65 |
abate |
368 |
$(OCAMLOPT) -linkpkg -o $@ gramlib.cmxa $^
|
| 66 |
abate |
273 |
|
| 67 |
abate |
3 |
compute_depend:
|
| 68 |
|
|
@echo "Computing dependencies ..."
|
| 69 |
abate |
4 |
ocamldep $(INCLUDES) $(SYNTAX_PARSER) $(DEPEND) > depend
|
| 70 |
abate |
1 |
|
| 71 |
abate |
81 |
parser/wlexer.ml: parser/wlexer.mll
|
| 72 |
|
|
wlex parser/wlexer.mll
|
| 73 |
|
|
|
| 74 |
abate |
1 |
clean:
|
| 75 |
abate |
72 |
for i in $(CLEAN_DIRS); do \
|
| 76 |
abate |
58 |
(cd $$i; rm -f *.cmi *.cmo *.cma *.cmx *.o *~); \
|
| 77 |
|
|
done
|
| 78 |
|
|
rm -f *.cmi *.cmo *.cma *.cmx *.a *.cmxa *.o *~
|
| 79 |
abate |
273 |
rm -f cduce cduce.opt webiface.opt ocamlprof.dump
|
| 80 |
abate |
90 |
rm -f dtd2cduce pool webiface
|
| 81 |
abate |
368 |
rm -Rf prepro package
|
| 82 |
abate |
381 |
rm -f web/www/*.php web/www/*.html web/*~
|
| 83 |
abate |
1 |
|
| 84 |
abate |
61 |
|
| 85 |
abate |
1 |
.SUFFIXES: .ml .mli .cmo .cmi .cmx
|
| 86 |
|
|
|
| 87 |
|
|
.ml.cmo:
|
| 88 |
abate |
61 |
$(OCAMLC) $(DEBUG) -c $(SYNTAX_PARSER) $(INCLUDES) $<
|
| 89 |
|
|
|
| 90 |
abate |
1 |
.ml.cmx:
|
| 91 |
abate |
58 |
$(OCAMLOPT) -c $(SYNTAX_PARSER) $(INCLUDES) $<
|
| 92 |
abate |
1 |
|
| 93 |
|
|
.mli.cmi:
|
| 94 |
abate |
61 |
$(OCAMLC) $(DEBUG) -c $(SYNTAX_PARSER) $(INCLUDES) $<
|
| 95 |
abate |
1 |
|
| 96 |
abate |
3 |
include depend
|
| 97 |
abate |
105 |
|
| 98 |
abate |
368 |
# CDuce-generated files
|
| 99 |
abate |
105 |
|
| 100 |
abate |
288 |
driver/examples.ml: cduce.opt web/examples/build.cd web/examples/examples.xml
|
| 101 |
|
|
(cd web/examples; ../../cduce.opt -quiet build.cd)
|
| 102 |
abate |
126 |
|
| 103 |
abate |
260 |
web/files: cduce.opt web/site.cd
|
| 104 |
abate |
369 |
(cd web; ../cduce.opt -quiet site.cd -- -php site.xml)
|
| 105 |
abate |
255 |
|
| 106 |
abate |
368 |
# Packaging
|
| 107 |
abate |
286 |
|
| 108 |
|
|
write_header:
|
| 109 |
|
|
headache -h header $(DEPEND)
|
| 110 |
|
|
|
| 111 |
|
|
remove_header:
|
| 112 |
|
|
headache -r $(DEPEND)
|
| 113 |
|
|
|
| 114 |
abate |
368 |
# For development
|
| 115 |
|
|
|
| 116 |
|
|
pull: tools/pull.cmo
|
| 117 |
|
|
$(OCAMLC) $(DEBUG) -linkpkg -o $@ $^
|
| 118 |
|
|
|
| 119 |
|
|
all.cma: $(OBJECTS)
|
| 120 |
|
|
$(OCAMLC) $(DEBUG) -o $@ -linkpkg gramlib.cma -a $(OBJECTS)
|
| 121 |
|
|
|
| 122 |
|
|
test: all.cma
|
| 123 |
|
|
fort all.cma -I +fort $(INCLUDES) tests/test_fort.ml
|
| 124 |
|
|
|
| 125 |
|
|
run_top: all.cma
|
| 126 |
|
|
ledit ocaml $(INCLUDES) `ocamlfind use pxp` all.cma
|
| 127 |
|
|
|
| 128 |
|
|
profile:
|
| 129 |
|
|
rm -Rf prepro
|
| 130 |
|
|
mkdir prepro
|
| 131 |
|
|
for i in $(DIRS); do \
|
| 132 |
|
|
mkdir prepro/$$i; \
|
| 133 |
|
|
for j in $$i/*.ml $$i/*.mli; do \
|
| 134 |
|
|
if [ -f "$$j" ]; then \
|
| 135 |
|
|
echo $$j; \
|
| 136 |
|
|
$(PREPRO) $$j -o prepro/$$j; \
|
| 137 |
|
|
fi; \
|
| 138 |
|
|
done; \
|
| 139 |
|
|
done
|
| 140 |
|
|
cp parser/wlexer.mll prepro/parser/
|
| 141 |
|
|
cp Makefile depend prepro/
|
| 142 |
|
|
(cd prepro; make cduce OCAMLCP="ocamlcp -p a" SYNTAX_PARSER=)
|
| 143 |
|
|
|
| 144 |
abate |
105 |
# Site-specific installation
|
| 145 |
abate |
369 |
|
| 146 |
|
|
cedre_build:
|
| 147 |
|
|
rsh cedre ". .env; cd IMPLEM/CDUCE; make webiface.opt; make web/files"
|
| 148 |
abate |
105 |
install_web:
|
| 149 |
abate |
381 |
scp web/www/*.php web/cduce.css cduce@iris:public_html/
|
| 150 |
abate |
369 |
scp webiface.opt cduce@iris:cgi-bin/cduce
|
| 151 |
|
|
ssh cduce@iris "chmod +s cgi-bin/cduce"
|
| 152 |
|
|
|
| 153 |
abate |
155 |
install_web_local:
|
| 154 |
abate |
381 |
ssh root@localhost "cp -f ~beppe/IMPLEM/CDUCE/webiface.opt /var/www/cgi-bin/cduce; cp -f ~beppe/IMPLEM/CDUCE/web/www/*.php /var/www/html/; chmod +s /var/www/cgi-bin/cduce;"
|
| 155 |
abate |
172 |
|
| 156 |
abate |
369 |
website: web/files
|
| 157 |
abate |
381 |
scp web/www/*.php web/cduce.css cduce@iris:public_html/
|
| 158 |
abate |
286 |
|
| 159 |
abate |
370 |
local_website: cduce.opt webiface.opt
|
| 160 |
|
|
(cd web; ../cduce.opt -quiet site.cd -- site.xml)
|
| 161 |
|
|
|
| 162 |
abate |
368 |
# Distribution
|
| 163 |
|
|
|
| 164 |
|
|
.PHONY: package
|
| 165 |
|
|
package:
|
| 166 |
|
|
rm -Rf package
|
| 167 |
|
|
mkdir package
|
| 168 |
|
|
cp -R $(DISTRIB) package/
|
| 169 |
abate |
370 |
(cd package; headache -h ../header $(DEPEND))
|
| 170 |
|
|
|