1 .OPTIONS = variable-propagation
2 OCAMLFINDPACKAGES = "ulex,unix,expat,camlp4.macro,bigarray"
3 OCAMLFINDSYNTAX = camlp4o
4 OCAMLFINDPPOPTS = $(addprefix "-ppopt ", @CAMLP4FLAGS@ -I include)
5 OCAMLFINDINCLUDES = $(addprefix "-I ", src)
6 OCAMLFINDFLAGS = -syntax $(OCAMLFINDSYNTAX) -package $(OCAMLFINDPACKAGES) \
7 $(OCAMLFINDPPOPTS) $(OCAMLFINDINCLUDES)
8 OCAMLFINDLINKFLAGS = -linkpkg
9 PACKAGE = @PACKAGE_TARNAME@
11 BIN = src/@PACKAGE_TARNAME@.native@EXE@
12 BYTE = src/@PACKAGE_TARNAME@.byte@EXE@
17 ODEPS = tools/odeps.sh $(OCAMLDEP)
20 OCAMLFLAGS = @OCAMLFLAGS@
21 OCAMLOPTFLAGS = @OCAMLOPTFLAGS@
22 OCAMLCFLAGS = @OCAMLCFLAGS@
23 OCAMLYACC = @OCAMLYACC@
27 tools: tools/xml_diff.native$(EXE) tools/XPathEval.class tools/split_path.native$(EXE)
29 Remakefile: Remakefile.in config.status
30 ./config.status Remakefile
32 configure config.status: configure.in
34 ./config.status --recheck
37 for dir in src tools; do
38 find $dir -name '*.cm*' -o -name '*.o' -o -name '*.byte' -o \
39 -name '*.native' -o -name '*.mll' -o -name '*.mly' -o \
40 -name '*.class' -o -name '*.depo' -o -name '*.depx' | while read file; do
43 rm -f "${file%.mll}.ml"
46 rm -f "${file%.mly}.ml" "${file%.mly}.mli"
55 distclean: clean test_clean
56 rm -rf config.status configure config.log autom4te.cache .remake Remakefile remake Makefile
61 %.native$(EXE): %.cmx %.depx
62 if test -f $@".flags"; then
63 FLAGS=`cat $@".flags"`
65 objects=`cat $*.depx | xargs | sed 's/[.]depx/.cmx/g'`
66 $(REMAKE) OCAMLNATIVE="-native" $objects #ensure all objects have been built
67 $(OCAMLOPT) -o $@ $(OCAMLFLAGS) $(OCAMLOPTFLAGS) $(OCAMLFINDLINKFLAGS) $(OCAMLFINDFLAGS) $FLAGS $objects $<
69 %.byte$(EXE): %.cmo %.depo
70 objects=`cat $*.depo | xargs | sed 's/[.]depo/.cmo/g'`
71 $(REMAKE) OCAMLNATIVE="" $objects #ensure all objects have been built
72 $(OCAMLC) -o $@ $(OCAMLFLAGS) $(OCAMLCFLAGS) $(OCAMLFINDLINKFLAGS) $(OCAMLFINDFLAGS) $objects $<
75 if test -f $*.mly; then
78 elif test -f $*.mll; then
88 REMAKE="$(REMAKE) OCAMLNATIVE=$NATIVE"
89 OCAMLDEP="$(OCAMLDEP) $(OCAMLFINDFLAGS)"
91 if test -f "$base".flags; then
92 FLAGS=`cat "$base".flags`
94 COMPILE="$(OCAMLOPT) $(OCAMLFLAGS) $(OCAMLOPTFLAGS) $(OCAMLFINDFLAGS) $FLAGS"
95 . tools/ocamldriver.sh
102 REMAKE="$(REMAKE) OCAMLNATIVE=$NATIVE"
103 OCAMLDEP="$(OCAMLDEP) $(OCAMLFINDFLAGS)"
105 COMPILE="$(OCAMLC) $(OCAMLFLAGS) $(OCAMLCFLAGS) $(OCAMLFINDFLAGS)"
106 . tools/ocamldriver.sh
111 NATIVE=$(OCAMLNATIVE)
112 REMAKE="$(REMAKE) OCAMLNATIVE=$NATIVE"
113 OCAMLDEP="$(OCAMLDEP) $(OCAMLFINDFLAGS)"
115 if test -z "$NATIVE"; then
117 COMPILE="$(OCAMLC) $(OCAMLFLAGS) $(OCAMLCFLAGS) $(OCAMLFINDFLAGS)"
119 COMPILE="$(OCAMLOPT) $(OCAMLFLAGS) $(OCAMLOPTFLAGS) $(OCAMLFINDFLAGS)"
122 . tools/ocamldriver.sh
126 test_byte: tools $(BYTE)
127 $(REMAKE) TEST=$(BYTE) real_test
129 test_native: tools $(BIN)
130 $(REMAKE) TEST=$(BIN) real_test
139 $(REMAKE) TEST=$(TEST) "$i".test"$j".summary
144 rm -rf tests/*.summary tests/*.results/*_"$(PACKAGE)"_*.*
153 SPLIT=tools/split_path.native$(EXE)
154 XMLDIFF=tools/xml_diff.native$(EXE)
156 $REMAKE $xml ${xml}.queries tests/${test}.sh