4 MLSRCS = memory.ml tag.ml tagSet.ml tree.ml automaton.ml ulexer.ml xPath.ml main.ml
5 MLISRCS = memory.mli automaton.mli tag.mli tagSet.mli tree.mli ulexer.mli xPath.mli
6 MLOBJS = $(MLSRCS:.ml=.cmx)
7 MLCINT = $(MLISRCS:.mli=.cmi)
10 OCAMLPACKAGES = unix,ulex,camlp4
12 PPINCLUDES=$(OCAMLINCLUDES:%=-ppopt %)
14 CXXSOURCES = XMLDocShredder.cpp OCamlStorageInterface.cpp StorageInterface.cpp OCamlDriver.cpp
15 CXXOBJECTS = $(CXXSOURCES:.cpp=.o)
18 -I/usr/include/libxml++-2.6 \
19 -I/usr/include/libxml2 \
20 -I/usr/include/glibmm-2.4 \
21 -I/usr/include/glib-2.0 \
22 -I/usr/include/sigc++-2.0 \
23 -I/usr/lib/libxml++-2.6/include \
24 -I/usr/lib/glibmm-2.4/include \
25 -I/usr/lib/sigc++-2.0/include \
26 -I/usr/lib/glib-2.0/include\
29 CXXFLAGS = -O3 -Wall $(INCLUDEDIRS) -fPIC -std=c++0x
33 OCAMLOPT = ocamlopt -g -cc "$(CXX)"
34 SYNT_DEBUG = -ppopt -DDEBUG
36 OCAMLOPT = ocamlopt -cc "$(CXX)" -noassert -inline 10000
38 ifeq ($(PROFILE), true)
39 SYNT_PROF = $(SYNT_DEBUG) -ppopt -DPROFILE
44 OCAMLMKLIB = ocamlmklib
46 LINK=$(OCAMLOPT) -linkpkg camlp4lib.cmxa
47 SYNTAX= -syntax camlp4o $(PPINCLUDES) -ppopt pa_macro.cmo $(SYNT_PROF)
51 LIBS= -lxml2 -lxml++-2.6 -lglibmm-2.4 -lgobject-2.0 -lglib-2.0 -lsigc-2.0
53 all: libcamlshredder.a $(MLOBJS)
54 $(OCAMLFIND) $(LINK) -o main -package "$(OCAMLPACKAGES)" $(SYNTAX) -cclib \
55 "$(LIBS) ./libcamlshredder.a" $(MLOBJS)
57 .SUFFIXES: .ml .mli .cmx .cmi .cpp
61 $(CXX) $(CXXINCLUDES) -c $(CXXFLAGS) $<
63 $(OCAMLFIND) $(OCAMLOPT) -package "$(OCAMLPACKAGES)" $(SYNTAX) -c $<
65 $(OCAMLFIND) $(OCAMLOPT) -package "$(OCAMLPACKAGES)" $(SYNTAX) -c $<
67 libcamlshredder.a: $(CXXOBJECTS)
68 $(OCAMLMKLIB) -o camlshredder -custom $(CXXOBJECTS) $(LIBS)
71 rm -f *~ *.cm* *.[oa] *.so main
74 OCamlStorageInterface.o: OCamlStorageInterface.h OCamlStorageInterface.cpp StorageInterface.h
75 StorageInterface.o: StorageInterface.h
76 XMLDocShredder.o: XMLDocShredder.h XMLDocShredder.cpp OCamlStorageInterface.h StorageInterface.h
77 OCamlDriver.o: XMLDocShredder.h StorageInterface.h
80 $(OCAMLFIND) $(OCAMLDEP) -package "$(OCAMLPACKAGES)" $(SYNTAX) $(MLSRCS) $(MLISRCS) >depend