6 BASESRC=custom.ml memoizer.ml hcons.ml memhashtbl.ml hlist.ml ptset.ml finiteCofinite.ml tag.ml tagSet.ml options.ml tree.ml ata.ml
7 BASEMLI=sigs.mli memoizer.mli hcons.mli memhashtbl.ml hlist.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
40 ifeq ($(VERBOSE),true)
49 SYNT_DEBUG = -ppopt -DDEBUG
54 ifeq ($(PROFILE), true)
56 SYNT_PROF = $(SYNT_DEBUG) -ppopt -DPROFILE
59 OPT_FLAGS = $(DEBUG_FLAGS) $(PROFILE_FLAGS) -nodynlink
61 OCAMLOPT = ocamlopt -cc "$(CXX)" $(OPT_FLAGS) -ccopt -O3 -ccopt -std=c++0x -noassert -inline $(INLINE)
65 OCAMLMKLIB = ocamlmklib
67 #Ugly but seems difficult with a makefile
69 LINK=$(OCAMLOPT) -linkpkg `ocamlc -version | grep -q "3.11.0" && echo dynlink.cmxa` camlp4lib.cmxa
70 SYNTAX= -syntax camlp4o $(PPINCLUDES) -ppopt pa_macro.cmo $(SYNT_PROF)
74 LIBS=-lxml2 -lxml++-2.6 -lglibmm-2.4 -lgobject-2.0 -lglib-2.0 -lsigc-2.0
78 main: libcamlshredder.a $(MLOBJS)
80 $(HIDE) $(OCAMLFIND) $(LINK) -o main -package "$(OCAMLPACKAGES)" $(SYNTAX) -cclib \
81 "$(LIBS) ./libcamlshredder.a" $(MLOBJS)
83 unit_test: libcamlshredder.a $(BASEOBJS) unit_test.cmx
85 $(HIDE) $(OCAMLFIND) $(LINK) -o unit_test -package "$(OCAMLPACKAGES)" $(SYNTAX) -cclib \
86 "$(LIBS) ./libcamlshredder.a" $(BASEOBJS) unit_test.cmx
88 .SUFFIXES: .ml .mli .cmx .cmi .cpp
89 .PHONY:compute_depend version
93 $(HIDE) $(CXX) $(CXXINCLUDES) -c $(CXXFLAGS) $<
97 $(HIDE) $(OCAMLFIND) $(OCAMLOPT) -package "$(OCAMLPACKAGES)" $(SYNTAX) -c $<
100 # @echo [OCAMLOPTPROF] $@
101 # $(HIDE) $(OCAMLFIND) $(OCAMLOPT) -ccopt -gp -p -package "$(OCAMLPACKAGES)" $(SYNTAX) -c $<
105 $(HIDE) $(OCAMLFIND) $(OCAMLOPT) -package "$(OCAMLPACKAGES)" $(SYNTAX) -c $<
107 libcamlshredder.a: $(CXXOBJECTS) XMLTree/XMLTree.a
109 $(HIDE) mkdir -p .libs/
110 $(HIDE) cd .libs/ && ar x ../XMLTree/XMLTree.a
111 $(HIDE) $(OCAMLMKLIB) -o camlshredder -custom $(CXXOBJECTS) .libs/*.o $(LIBS)
116 $(HIDE) rm -f *~ *.cm* *.[oa] *.so main
120 timeXMLTree: $(CXXOBJECTS) XMLTree/XMLTree.a timeXMLTree.cpp myTimeXMLTree.cpp
122 cd .libs/ && ar x ../XMLTree/XMLTree.a
123 $(CXX) -o timeXMLTree $(CXXFLAGS) $(CXXINCLUDES) XMLDocShredder.o \
124 SXSIStorageInterface.o StorageInterface.o ./.libs/*.o \
125 $(LIBS) timeXMLTree.cpp
126 $(CXX) -o myTimeXMLTree $(CXXFLAGS) $(CXXINCLUDES) XMLDocShredder.o \
127 SXSIStorageInterface.o StorageInterface.o ./.libs/*.o \
128 $(LIBS) myTimeXMLTree.cpp
129 # $(CXX) -o testXMLTree $(CXXFLAGS) $(CXXINCLUDES) XMLDocShredder.o \
130 # SXSIStorageInterface.o StorageInterface.o ./.libs/*.o \
131 # $(LIBS) testXMLTree.cpp
134 SXSIStorageInterface.o: SXSIStorageInterface.h SXSIStorageInterface.cpp StorageInterface.h
135 StorageInterface.o: StorageInterface.h
136 XMLDocShredder.o: XMLDocShredder.h XMLDocShredder.cpp SXSIStorageInterface.h StorageInterface.h
137 OCamlDriver.o: XMLDocShredder.h StorageInterface.h
141 $(HIDE) $(OCAMLFIND) $(OCAMLDEP) -package "$(OCAMLPACKAGES)" $(SYNTAX) $(MLSRCS) $(MLISRCS) >depend