6 BASESRC=custom.ml ptset.ml finiteCofinite.ml tag.ml tagSet.ml options.ml tree.ml ata.ml
7 BASEMLI=sigs.mli ptset.mli finiteCofinite.mli tag.mli tagSet.mli options.mli tree.mli ata.mli
8 MLSRCS = memory.ml $(BASESRC) ulexer.ml xPath.ml main.ml
9 MLISRCS = memory.mli $(BASEMLI) ulexer.mli xPath.mli
10 BASEOBJS= $(BASESRC:.ml=.cmx)
11 BASEINT= $(BASEMLI:.ml=.cmi)
12 MLOBJS = $(MLSRCS:.ml=.cmx)
13 MLCINT = $(MLISRCS:.mli=.cmi)
16 OCAMLPACKAGES = str,unix,ulex,camlp4
18 PPINCLUDES=$(OCAMLINCLUDES:%=-ppopt %)
20 CXXSOURCES = XMLDocShredder.cpp SXSIStorageInterface.cpp StorageInterface.cpp OCamlDriver.cpp
21 CXXOBJECTS = $(CXXSOURCES:.cpp=.o)
24 -I/usr/include/libxml++-2.6 \
25 -I/usr/include/libxml2 \
26 -I/usr/include/glibmm-2.4 \
27 -I/usr/include/glib-2.0 \
28 -I/usr/include/sigc++-2.0 \
29 -I/usr/lib/libxml++-2.6/include \
30 -I/usr/lib/glibmm-2.4/include \
31 -I/usr/lib/sigc++-2.0/include \
32 -I/usr/lib/glib-2.0/include\
35 -IXMLTree/libcds/includes \
36 -IXMLTree/TextCollection
38 CXXFLAGS = -O3 -Wall $(INCLUDEDIRS) -fPIC -std=c++0x
39 ifeq ($(VERBOSE),true)
47 OCAMLOPT = ocamlopt -g -cc "$(CXX)"
48 SYNT_DEBUG = -ppopt -DDEBUG
51 OCAMLOPT = ocamlopt -cc "$(CXX)" -ccopt -O3 -ccopt -std=c++0x -noassert -inline $(INLINE)
53 ifeq ($(PROFILE), true)
54 SYNT_PROF = $(SYNT_DEBUG) -ppopt -DPROFILE
58 OCAMLMKLIB = ocamlmklib
60 #Ugly but seems difficult with a makefile
62 LINK=$(OCAMLOPT) -linkpkg `ocamlc -version | grep -q "3.11.0" && echo dynlink.cmxa` camlp4lib.cmxa
63 SYNTAX= -syntax camlp4o $(PPINCLUDES) -ppopt pa_macro.cmo $(SYNT_PROF)
67 LIBS=-lxml2 -lxml++-2.6 -lglibmm-2.4 -lgobject-2.0 -lglib-2.0 -lsigc-2.0
71 main: libcamlshredder.a $(MLOBJS)
73 $(HIDE) $(OCAMLFIND) $(LINK) -o main -package "$(OCAMLPACKAGES)" $(SYNTAX) -cclib \
74 "$(LIBS) ./libcamlshredder.a" $(MLOBJS)
76 unit_test: libcamlshredder.a $(BASEOBJS) unit_test.cmx
78 $(HIDE) $(OCAMLFIND) $(LINK) -o unit_test -package "$(OCAMLPACKAGES)" $(SYNTAX) -cclib \
79 "$(LIBS) ./libcamlshredder.a" $(BASEOBJS) unit_test.cmx
81 .SUFFIXES: .ml .mli .cmx .cmi .cpp
82 .PHONY:compute_depend version
86 $(HIDE) $(CXX) $(CXXINCLUDES) -c $(CXXFLAGS) $<
90 $(HIDE) $(OCAMLFIND) $(OCAMLOPT) -package "$(OCAMLPACKAGES)" $(SYNTAX) -c $<
93 # @echo [OCAMLOPTPROF] $@
94 # $(HIDE) $(OCAMLFIND) $(OCAMLOPT) -ccopt -gp -p -package "$(OCAMLPACKAGES)" $(SYNTAX) -c $<
98 $(HIDE) $(OCAMLFIND) $(OCAMLOPT) -package "$(OCAMLPACKAGES)" $(SYNTAX) -c $<
100 libcamlshredder.a: $(CXXOBJECTS) XMLTree/XMLTree.a
102 $(HIDE) mkdir -p .libs/
103 $(HIDE) cd .libs/ && ar x ../XMLTree/XMLTree.a
104 $(HIDE) $(OCAMLMKLIB) -o camlshredder -custom $(CXXOBJECTS) .libs/*.o $(LIBS)
109 $(HIDE) rm -f *~ *.cm* *.[oa] *.so main
113 timeXMLTree: $(CXXOBJECTS) XMLTree/XMLTree.a timeXMLTree.cpp myTimeXMLTree.cpp
115 cd .libs/ && ar x ../XMLTree/XMLTree.a
116 $(CXX) -o timeXMLTree $(CXXFLAGS) $(CXXINCLUDES) XMLDocShredder.o \
117 SXSIStorageInterface.o StorageInterface.o ./.libs/*.o \
118 $(LIBS) timeXMLTree.cpp
119 $(CXX) -o myTimeXMLTree $(CXXFLAGS) $(CXXINCLUDES) XMLDocShredder.o \
120 SXSIStorageInterface.o StorageInterface.o ./.libs/*.o \
121 $(LIBS) myTimeXMLTree.cpp
122 # $(CXX) -o testXMLTree $(CXXFLAGS) $(CXXINCLUDES) XMLDocShredder.o \
123 # SXSIStorageInterface.o StorageInterface.o ./.libs/*.o \
124 # $(LIBS) testXMLTree.cpp
127 SXSIStorageInterface.o: SXSIStorageInterface.h SXSIStorageInterface.cpp StorageInterface.h
128 StorageInterface.o: StorageInterface.h
129 XMLDocShredder.o: XMLDocShredder.h XMLDocShredder.cpp SXSIStorageInterface.h StorageInterface.h
130 OCamlDriver.o: XMLDocShredder.h StorageInterface.h
134 $(HIDE) $(OCAMLFIND) $(OCAMLDEP) -package "$(OCAMLPACKAGES)" $(SYNTAX) $(MLSRCS) $(MLISRCS) >depend