5 MLSRCS = memory.ml custom.ml ptset.ml finiteCofinite.ml tag.ml tagSet.ml options.ml tree.ml ata.ml ulexer.ml xPath.ml main.ml
6 MLISRCS = memory.mli sigs.mli ptset.mli finiteCofinite.ml options.mli tag.mli tagSet.mli tree.mli ata.mli ulexer.mli xPath.mli
7 MLOBJS = $(MLSRCS:.ml=.cmx)
8 MLCINT = $(MLISRCS:.mli=.cmi)
11 OCAMLPACKAGES = str,unix,ulex,camlp4
13 PPINCLUDES=$(OCAMLINCLUDES:%=-ppopt %)
15 CXXSOURCES = XMLDocShredder.cpp SXSIStorageInterface.cpp StorageInterface.cpp OCamlDriver.cpp
16 CXXOBJECTS = $(CXXSOURCES:.cpp=.o)
19 -I/usr/include/libxml++-2.6 \
20 -I/usr/include/libxml2 \
21 -I/usr/include/glibmm-2.4 \
22 -I/usr/include/glib-2.0 \
23 -I/usr/include/sigc++-2.0 \
24 -I/usr/lib/libxml++-2.6/include \
25 -I/usr/lib/glibmm-2.4/include \
26 -I/usr/lib/sigc++-2.0/include \
27 -I/usr/lib/glib-2.0/include\
30 -IXMLTree/libcds/includes \
31 -IXMLTree/TextCollection
33 CXXFLAGS = -O3 -Wall $(INCLUDEDIRS) -fPIC -std=c++0x
34 ifeq ($(VERBOSE),true)
42 OCAMLOPT = ocamlopt -g -cc "$(CXX)"
43 SYNT_DEBUG = -ppopt -DDEBUG
46 OCAMLOPT = ocamlopt -S -cc "$(CXX)" -ccopt -O3 -ccopt -std=c++0x -noassert -inline 1000
48 ifeq ($(PROFILE), true)
49 SYNT_PROF = $(SYNT_DEBUG) -ppopt -DPROFILE
53 OCAMLMKLIB = ocamlmklib
55 #Ugly but seems difficult with a makefile
57 LINK=$(OCAMLOPT) -linkpkg `ocamlc -version | grep -q "3.11.0" && echo dynlink.cmxa` camlp4lib.cmxa
58 SYNTAX= -syntax camlp4o $(PPINCLUDES) -ppopt pa_macro.cmo $(SYNT_PROF)
62 LIBS=-lxml2 -lxml++-2.6 -lglibmm-2.4 -lgobject-2.0 -lglib-2.0 -lsigc-2.0
66 main: libcamlshredder.a $(MLOBJS)
68 $(HIDE) $(OCAMLFIND) $(LINK) -o main -package "$(OCAMLPACKAGES)" $(SYNTAX) -cclib \
69 "$(LIBS) ./libcamlshredder.a" $(MLOBJS)
71 .SUFFIXES: .ml .mli .cmx .cmi .cpp
72 .PHONY:compute_depend version
76 $(HIDE) $(CXX) $(CXXINCLUDES) -c $(CXXFLAGS) $<
80 $(HIDE) $(OCAMLFIND) $(OCAMLOPT) -package "$(OCAMLPACKAGES)" $(SYNTAX) -c $<
83 $(HIDE) $(OCAMLFIND) $(OCAMLOPT) -package "$(OCAMLPACKAGES)" $(SYNTAX) -c $<
85 libcamlshredder.a: $(CXXOBJECTS) XMLTree/XMLTree.a
87 $(HIDE) mkdir -p .libs/
88 $(HIDE) cd .libs/ && ar x ../XMLTree/XMLTree.a
89 $(HIDE) $(OCAMLMKLIB) -o camlshredder -custom $(CXXOBJECTS) ./.libs/*.o $(LIBS)
94 $(HIDE) rm -f *~ *.cm* *.[oa] *.so main .libs
97 testSuccint: $(CXXOBJECTS) XMLTree/XMLTree.a
99 cd .libs/ && ar x ../XMLTree/XMLTree.a
100 $(CXX) -o testSuccint $(CXXFLAGS) $(CXXINCLUDES) XMLDocShredder.o \
101 SXSIStorageInterface.o StorageInterface.o ./.libs/*.o \
102 $(LIBS) testSuccint.cpp
105 SXSIStorageInterface.o: SXSIStorageInterface.h SXSIStorageInterface.cpp StorageInterface.h
106 StorageInterface.o: StorageInterface.h
107 XMLDocShredder.o: XMLDocShredder.h XMLDocShredder.cpp SXSIStorageInterface.h StorageInterface.h
108 OCamlDriver.o: XMLDocShredder.h StorageInterface.h
112 $(HIDE) $(OCAMLFIND) $(OCAMLDEP) -package "$(OCAMLPACKAGES)" $(SYNTAX) $(MLSRCS) $(MLISRCS) >depend