1 ##############################################################################
3 ##############################################################################
6 -include ..
/Makefile.config
10 # note: if you add a file (a .mli or .ml), dont forget to redo a 'make depend'
11 MYSRC
= common.ml common_extra.ml \
12 interfaces.ml objet.ml \
15 oset.ml oassoc.ml osequence.ml ograph.ml \
16 ocollection
/oseti.ml \
17 ocollection
/oseth.ml \
18 ocollection
/osetb.ml \
19 ocollection
/osetpt.ml \
20 ocollection
/oassocb.ml \
21 ocollection
/oassoch.ml \
22 ocollection
/oassoc_buffer.ml \
23 ocollection
/oassoc_cache.ml \
24 ocollection
/oassocid.ml \
26 ocollection
/ograph2way.ml \
27 ograph_simple.ml ograph_extended.ml \
29 glimpse.ml parser_combinators.ml
31 # src from other authors, got from the web or caml hump
32 SRC
=ocamlextra
/dumper.ml
33 SRC
+=ocamlextra
/ANSITerminal.ml
34 SRC
+=ocamlextra
/setb.ml ocamlextra
/mapb.ml
# defunctorized version of standard set/map
35 SRC
+=ocamlextra
/setPt.ml
37 SRC
+=ocamlextra
/enum.ml ocamlextra
/dynArray.ml
38 SRC
+=ocamlextra
/suffix_tree.ml ocamlextra
/suffix_tree_ext.ml
40 SYSLIBS
=str.cma bigarray.cma unix.cma
42 INCLUDEDIRS
=ocamlextra ocollection
43 SUBDIRS
=ocamlextra ocollection
45 #-----------------------------------------------------------------------------
46 # Other common (thin wrapper) libraries
47 #-----------------------------------------------------------------------------
49 #format: XXXSRC, XXXINCLUDE, XXXSYSLIBS
52 MYGDBMSRC
=ocollection
/oassocdbm.ml
55 #berkeley db (ocamlbdb)
56 MYBDBSRC
=ocollection
/oassocbdb.ml ocollection
/oassocbdb_string.ml
57 BDBINCLUDES
=-I ..
/ocamlbdb
63 GUIINCLUDES
=-I
+lablgtk2
-I
+lablgtksourceview
-I ..
/ocamlgtk
/src
64 GUISYSLIBS
=lablgtk.cma lablgtksourceview.cma
68 PYINCLUDES
=-I ..
/ocamlpython
-I ..
/..
/ocamlpython
72 MYMPISRC
=distribution.ml
73 MPIINCLUDES
=-I ..
/ocamlmpi
-I ..
/..
/ocamlmpi
-I
+ocamlmpi
77 #REGEXPINCLUDES=-I +pcre
79 REGEXPINCLUDES
=-I ..
/ocamlpcre
/lib
-I ..
/..
/ocamlpcre
/lib
82 MYSEXPSRC
=sexp_common.ml
83 ifeq ("$(SEXPDIR)","ocamlsexp")
84 SEXPDIRUSED
=..
/$(SEXPDIR
)
86 SEXPDIRUSED
=$(SEXPDIR
)
87 endif # Use local ocamlsexp
88 SEXPINCLUDES
=-I
$(SEXPDIRUSED
) \
89 -I ..
/ocamltarzan
/lib-sexp \
90 -I ..
/..
/ocamltarzan
/lib-sexp
93 MYBINSRC
=bin_common.ml
94 BININCLUDES
=-I ..
/ocamltarzan
/lib-binprot
-I ..
/..
/ocamltarzan
/lib-binprot
96 #-----------------------------------------------------------------------------
98 #-----------------------------------------------------------------------------
101 MYBACKTRACESRC
=backtrace.ml
102 BACKTRACEINCLUDES
=-I
$(shell ocamlc
-where
)
105 ##############################################################################
107 ##############################################################################
109 INCLUDES
=$(INCLUDEDIRS
:%=-I
%) $(INCLUDESEXTRA
)
111 ##############################################################################
112 # Generic ocaml variables
113 ##############################################################################
115 # This flag can also be used in subdirectories so don't change its name here.
116 # For profiling use: -p -inline 0
120 # The OPTBIN variable is here to allow to use ocamlc.opt instead of
121 # ocaml, when it is available, which speeds up compilation. So
122 # if you want the fast version of the ocaml chain tools, set this var
123 # or setenv it to ".opt" in your startup script.
126 OCAMLCFLAGS ?
= -g
-dtypes
129 OCAMLC
=ocamlc
$(OPTBIN
) $(OCAMLCFLAGS
) $(INCLUDES
)
130 OCAMLOPT
=ocamlopt
$(OPTBIN
) $(OPTFLAGS
) $(INCLUDES
)
131 OCAMLLEX
= ocamllex
$(OPTBIN
)
132 OCAMLYACC
= ocamlyacc
-v
133 OCAMLDEP
= ocamldep
$(OPTBIN
) $(INCLUDES
)
134 OCAMLMKTOP
=ocamlmktop
-g
-custom
$(INCLUDES
)
137 OCAMLMKLIB
=ocamlmklib
140 ##############################################################################
142 ##############################################################################
144 OPTLIB
=$(LIB
:.cma
=.cmxa
)
146 OBJS
= $(SRC
:.ml
=.cmo
)
147 OPTOBJS
= $(SRC
:.ml
=.cmx
)
156 $(OCAMLC
) -a
-o
$@
$^
158 $(OPTLIB
): $(OPTOBJS
)
159 $(OCAMLOPT
) -a
-o
$@
$^
161 $(TARGET
).top
: $(OBJS
)
162 $(OCAMLMKTOP
) -o
$@
$(SYSLIBS
) $^
167 ##############################################################################
168 # Other commons libs target
169 ##############################################################################
171 all_libs
: gdbm bdb gui mpi regexp backtrace
173 #-----------------------------------------------------------------------------
174 gdbm
: commons_gdbm.cma
175 gdbm.opt
: commons_gdbm.cmxa
177 commons_gdbm.cma
: $(MYGDBMSRC
:.ml
=.cmo
)
178 $(OCAMLC
) -a
-o
$@
$^
180 commons_gdbm.cmxa
: $(MYGDBMSRC
:.ml
=.cmx
)
181 $(OCAMLOPT
) -a
-o
$@
$^
184 #-----------------------------------------------------------------------------
186 $(MAKE
) INCLUDESEXTRA
="$(BDBINCLUDES)" commons_bdb.cma
188 $(MAKE
) INCLUDESEXTRA
="$(BDBINCLUDES)" commons_bdb.cmxa
190 commons_bdb.cma
: $(MYBDBSRC
:.ml
=.cmo
)
191 $(OCAMLC
) -a
-o
$@
$^
193 commons_bdb.cmxa
: $(MYBDBSRC
:.ml
=.cmx
)
194 $(OCAMLOPT
) -a
-o
$@
$^
198 #-----------------------------------------------------------------------------
200 $(MAKE
) INCLUDESEXTRA
="$(GUIINCLUDES)" commons_gui.cma
202 $(MAKE
) INCLUDESEXTRA
="$(GUIINCLUDES)" commons_gui.cmxa
204 commons_gui.cma
: $(MYGUISRC
:.ml
=.cmo
)
205 $(OCAMLC
) -a
-o
$@
$^
207 commons_gui.cmxa
: $(MYGUISRC
:.ml
=.cmx
)
208 $(OCAMLOPT
) -a
-o
$@
$^
212 #-----------------------------------------------------------------------------
214 $(MAKE
) INCLUDESEXTRA
="$(MPIINCLUDES)" commons_mpi.cma
216 $(MAKE
) INCLUDESEXTRA
="$(MPIINCLUDES)" commons_mpi.cmxa
218 commons_mpi.cma
: $(MYMPISRC
:.ml
=.cmo
)
219 $(OCAMLC
) -a
-o
$@
$^
221 commons_mpi.cmxa
: $(MYMPISRC
:.ml
=.cmx
)
222 $(OCAMLOPT
) -a
-o
$@
$^
226 distribution.opt
: mpi.opt
230 #-----------------------------------------------------------------------------
232 $(MAKE
) INCLUDESEXTRA
="$(PYINCLUDES)" commons_python.cma
234 $(MAKE
) INCLUDESEXTRA
="$(PYINCLUDES)" commons_python.cmxa
237 commons_python.cma
: $(MYPYSRC
:.ml
=.cmo
)
238 $(OCAMLC
) -a
-o
$@
$^
240 commons_python.cmxa
: $(MYPYSRC
:.ml
=.cmx
)
241 $(OCAMLOPT
) -a
-o
$@
$^
244 #-----------------------------------------------------------------------------
246 $(MAKE
) INCLUDESEXTRA
="$(REGEXPINCLUDES)" commons_regexp.cma
248 $(MAKE
) INCLUDESEXTRA
="$(REGEXPINCLUDES)" commons_regexp.cmxa
250 commons_regexp.cma
: $(MYREGEXPSRC
:.ml
=.cmo
)
251 $(OCAMLC
) -a
-o
$@
$^
253 commons_regexp.cmxa
: $(MYREGEXPSRC
:.ml
=.cmx
)
254 $(OCAMLOPT
) -a
-o
$@
$^
257 #-----------------------------------------------------------------------------
258 backtrace
: commons_backtrace.cma
259 backtrace.opt
: commons_backtrace.cmxa
261 backtrace_c.o
: backtrace_c.c
262 $(CC
) $(BACKTRACEINCLUDES
) -c
$^
264 commons_backtrace.cma
: $(MYBACKTRACESRC
:.ml
=.cmo
) backtrace_c.o
265 $(OCAMLMKLIB
) -o commons_backtrace
$^
267 commons_backtrace.cmxa
: $(MYBACKTRACESRC
:.ml
=.cmx
) backtrace_c.o
268 $(OCAMLMKLIB
) -o commons_backtrace
$^
271 rm -f dllcommons_backtrace.so
275 #-----------------------------------------------------------------------------
277 $(MAKE
) INCLUDESEXTRA
="$(SEXPINCLUDES)" commons_sexp.cma
279 $(MAKE
) INCLUDESEXTRA
="$(SEXPINCLUDES)" commons_sexp.cmxa
281 commons_sexp.cma
: $(MYSEXPSRC
:.ml
=.cmo
)
282 $(OCAMLC
) -a
-o
$@
$^
284 commons_sexp.cmxa
: $(MYSEXPSRC
:.ml
=.cmx
)
285 $(OCAMLOPT
) -a
-o
$@
$^
288 $(MAKE
) INCLUDESEXTRA
="$(BININCLUDES)" commons_bin.cma
290 $(MAKE
) INCLUDESEXTRA
="$(BININCLUDES)" commons_bin.cmxa
292 commons_bin.cma
: $(MYBINSRC
:.ml
=.cmo
)
293 $(OCAMLC
) -a
-o
$@
$^
295 commons_bin.cmxa
: $(MYBINSRC
:.ml
=.cmx
)
296 $(OCAMLOPT
) -a
-o
$@
$^
298 ##############################################################################
299 # The global "features" lib wrapper
300 ##############################################################################
302 features
: commons_features.cma
303 features.opt
: commons_features.cmxa
305 commons_features.cma
: features.cmo
306 $(OCAMLC
) -a
-o
$@
$^
308 commons_features.cmxa
: features.cmx
309 $(OCAMLOPT
) -a
-o
$@
$^
312 ##############################################################################
314 ##############################################################################
317 otags
-no-mli-tags
-r .
323 $(MAKE
) OPTFLAGS
="-p -inline 0 " opt
326 ocamldep
*.mli
*.ml
> /tmp
/dependfull.depend
327 ocamldot
-fullgraph
/tmp
/dependfull.depend
> /tmp
/dependfull.dot
328 dot
-Tps
/tmp
/dependfull.dot
> /tmp
/dependfull.ps
331 find
-name
"*.ml" |grep
-v
"scripts" | xargs ocamldep
-I commons
-I globals
-I ctl
-I parsing_cocci
-I parsing_c
-I engine
-I popl
-I extra
> /tmp
/dependfull.depend
332 ocamldot
-fullgraph
/tmp
/dependfull.depend
> /tmp
/dependfull.dot
333 dot
-Tps
/tmp
/dependfull.dot
> /tmp
/dependfull.ps
336 ##############################################################################
338 ##############################################################################
340 .SUFFIXES
: .ml .mli .cmo .cmi .cmx
350 rm -f
*.cm
[iox
] *.o
*.a
*.cma
*.cmxa
*.annot
354 for i in
$(SUBDIRS
); do
(cd
$$i; \
355 rm -f
*.cm
[iox
] *.o
*.a
*.cma
*.cmxa
*.annot
*~ .
*~
; \
360 $(OCAMLDEP
) *.mli
*.ml
> .depend
361 for i in
$(SUBDIRS
); do
$(OCAMLDEP
) $$i/*.ml
$$i/*.mli
>> .depend
; done