1 ##############################################################################
3 ##############################################################################
6 # note: if you add a file (a .mli or .ml), dont forget to redo a 'make depend'
7 MYSRC
=common.ml common_extra.ml \
8 interfaces.ml objet.ml \
11 oset.ml oassoc.ml osequence.ml ograph.ml \
12 ocollection
/oseti.ml ocollection
/oseth.ml ocollection
/osetb.ml ocollection
/osetpt.ml \
13 ocollection
/oassocb.ml ocollection
/oassoch.ml ocollection
/oassoc_buffer.ml ocollection
/oassocid.ml \
15 ocollection
/ograph2way.ml ograph_extended.ml \
17 glimpse.ml parser_combinators.ml
19 # src from other authors, got from the web or caml hump
20 SRC
=ocamlextra
/dumper.ml
21 SRC
+=ocamlextra
/ANSITerminal.ml
22 SRC
+=ocamlextra
/setb.ml ocamlextra
/mapb.ml
# defunctorized version of standard set/map
23 SRC
+=ocamlextra
/setPt.ml
25 SRC
+=ocamlextra
/enum.ml ocamlextra
/dynArray.ml
26 SRC
+=ocamlextra
/suffix_tree.ml ocamlextra
/suffix_tree_ext.ml
28 SYSLIBS
=str.cma unix.cma
30 INCLUDEDIRS
=ocamlextra ocollection
31 SUBDIRS
=ocamlextra ocollection
33 #-----------------------------------------------------------------------------
34 # Other common (thin wrapper) libraries
35 #-----------------------------------------------------------------------------
38 MYGDBMSRC
=ocollection
/oassocdbm.ml
41 #berkeley db (ocamlbdb)
42 BDBINCLUDES
=-I ..
/ocamlbdb
43 MYBDBSRC
=ocollection
/oassocbdb.ml ocollection
/oassocbdb_string.ml
48 GUIINCLUDES
=-I
+lablgtk2
-I
+lablgtksourceview
-I ..
/ocamlgtk
/src
50 GUISYSLIBS
=lablgtk.cma lablgtksourceview.cma
53 PYINCLUDES
=-I ..
/ocamlpython
-I ..
/..
/ocamlpython
58 MPIINCLUDES
=-I ..
/ocamlmpi
-I ..
/..
/ocamlmpi
-I
+ocamlmpi
59 MYMPISRC
=distribution.ml
63 #-----------------------------------------------------------------------------
65 #REGEXPINCLUDES=-I +pcre
66 REGEXPINCLUDES
=-I ..
/ocamlpcre
/lib
69 #-----------------------------------------------------------------------------
71 #-----------------------------------------------------------------------------
74 BACKTRACEINCLUDES
=-I
$(shell ocamlc
-where
)
75 MYBACKTRACESRC
=backtrace.ml
77 ##############################################################################
79 ##############################################################################
81 INCLUDES
=$(INCLUDEDIRS
:%=-I
%) $(INCLUDESEXTRA
)
83 ##############################################################################
84 # Generic ocaml variables
85 ##############################################################################
87 # This flag can also be used in subdirectories so don't change its name here.
88 # For profiling use: -p -inline 0
92 # The OPTBIN variable is here to allow to use ocamlc.opt instead of
93 # ocaml, when it is available, which speeds up compilation. So
94 # if you want the fast version of the ocaml chain tools, set this var
95 # or setenv it to ".opt" in your startup script.
98 OCAMLCFLAGS ?
= -g
-dtypes
101 OCAMLC
=ocamlc
$(OPTBIN
) $(OCAMLCFLAGS
) $(INCLUDES
)
102 OCAMLOPT
=ocamlopt
$(OPTBIN
) $(OPTFLAGS
) $(INCLUDES
)
103 OCAMLLEX
= ocamllex
$(OPTBIN
)
104 OCAMLYACC
= ocamlyacc
-v
105 OCAMLDEP
= ocamldep
$(OPTBIN
) $(INCLUDES
)
106 OCAMLMKTOP
=ocamlmktop
-g
-custom
$(INCLUDES
)
109 OCAMLMKLIB
=ocamlmklib
112 ##############################################################################
114 ##############################################################################
116 OPTLIB
=$(LIB
:.cma
=.cmxa
)
118 OBJS
= $(SRC
:.ml
=.cmo
)
119 OPTOBJS
= $(SRC
:.ml
=.cmx
)
128 $(OCAMLC
) -a
-o
$@
$^
130 $(OPTLIB
): $(OPTOBJS
)
131 $(OCAMLOPT
) -a
-o
$@
$^
133 $(TARGET
).top
: $(OBJS
)
134 $(OCAMLMKTOP
) -o
$@
$(SYSLIBS
) $^
139 ##############################################################################
140 # Other commons libs target
141 ##############################################################################
143 all_libs
: gdbm bdb gui mpi backtrace
145 #-----------------------------------------------------------------------------
146 gdbm
: commons_gdbm.cma
147 gdbm.opt
: commons_gdbm.cmxa
149 commons_gdbm.cma
: $(MYGDBMSRC
:.ml
=.cmo
)
150 $(OCAMLC
) -a
-o
$@
$^
152 commons_gdbm.cmxa
: $(MYGDBMSRC
:.ml
=.cmx
)
153 $(OCAMLOPT
) -a
-o
$@
$^
156 #-----------------------------------------------------------------------------
158 $(MAKE
) INCLUDESEXTRA
="$(BDBINCLUDES)" commons_bdb.cma
160 $(MAKE
) INCLUDESEXTRA
="$(BDBINCLUDES)" commons_bdb.cmxa
162 commons_bdb.cma
: $(MYBDBSRC
:.ml
=.cmo
)
163 $(OCAMLC
) -a
-o
$@
$^
165 commons_bdb.cmxa
: $(MYBDBSRC
:.ml
=.cmx
)
166 $(OCAMLOPT
) -a
-o
$@
$^
170 #-----------------------------------------------------------------------------
172 $(MAKE
) INCLUDESEXTRA
="$(GUIINCLUDES)" commons_gui.cma
174 $(MAKE
) INCLUDESEXTRA
="$(GUIINCLUDES)" commons_gui.cmxa
176 commons_gui.cma
: $(MYGUISRC
:.ml
=.cmo
)
177 $(OCAMLC
) -a
-o
$@
$^
179 commons_gui.cmxa
: $(MYGUISRC
:.ml
=.cmx
)
180 $(OCAMLOPT
) -a
-o
$@
$^
184 #-----------------------------------------------------------------------------
186 $(MAKE
) INCLUDESEXTRA
="$(MPIINCLUDES)" commons_mpi.cma
188 $(MAKE
) INCLUDESEXTRA
="$(MPIINCLUDES)" commons_mpi.cmxa
190 commons_mpi.cma
: $(MYMPISRC
:.ml
=.cmo
)
191 $(OCAMLC
) -a
-o
$@
$^
193 commons_mpi.cmxa
: $(MYMPISRC
:.ml
=.cmx
)
194 $(OCAMLOPT
) -a
-o
$@
$^
198 distribution.opt
: mpi.opt
202 #-----------------------------------------------------------------------------
204 $(MAKE
) INCLUDESEXTRA
="$(PYINCLUDES)" commons_python.cma
206 $(MAKE
) INCLUDESEXTRA
="$(PYINCLUDES)" commons_python.cmxa
209 commons_python.cma
: $(MYPYSRC
:.ml
=.cmo
)
210 $(OCAMLC
) -a
-o
$@
$^
212 commons_python.cmxa
: $(MYPYSRC
:.ml
=.cmx
)
213 $(OCAMLOPT
) -a
-o
$@
$^
216 #-----------------------------------------------------------------------------
218 $(MAKE
) INCLUDESEXTRA
="$(REGEXPINCLUDES)" commons_regexp.cma
220 $(MAKE
) INCLUDESEXTRA
="$(REGEXPINCLUDES)" commons_regexp.cmxa
222 commons_regexp.cma
: $(MYREGEXPSRC
:.ml
=.cmo
)
223 $(OCAMLC
) -a
-o
$@
$^
225 commons_regexp.cmxa
: $(MYREGEXPSRC
:.ml
=.cmx
)
226 $(OCAMLOPT
) -a
-o
$@
$^
229 #-----------------------------------------------------------------------------
230 backtrace
: commons_backtrace.cma
231 backtrace.opt
: commons_backtrace.cmxa
233 backtrace_c.o
: backtrace_c.c
234 $(CC
) $(BACKTRACEINCLUDES
) -c
$^
236 commons_backtrace.cma
: $(MYBACKTRACESRC
:.ml
=.cmo
) backtrace_c.o
237 $(OCAMLMKLIB
) -o commons_backtrace
$^
239 commons_backtrace.cmxa
: $(MYBACKTRACESRC
:.ml
=.cmx
) backtrace_c.o
240 $(OCAMLMKLIB
) -o commons_backtrace
$^
243 rm -f dllcommons_backtrace.so
246 ##############################################################################
248 ##############################################################################
251 otags
-no-mli-tags
-r .
257 $(MAKE
) OPTFLAGS
="-p -inline 0 " opt
260 ocamldep
*.mli
*.ml
> /tmp
/dependfull.depend
261 ocamldot
-fullgraph
/tmp
/dependfull.depend
> /tmp
/dependfull.dot
262 dot
-Tps
/tmp
/dependfull.dot
> /tmp
/dependfull.ps
265 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
266 ocamldot
-fullgraph
/tmp
/dependfull.depend
> /tmp
/dependfull.dot
267 dot
-Tps
/tmp
/dependfull.dot
> /tmp
/dependfull.ps
270 ##############################################################################
272 ##############################################################################
274 .SUFFIXES
: .ml .mli .cmo .cmi .cmx
284 rm -f
*.cm
[iox
] *.o
*.a
*.cma
*.cmxa
*.annot
288 for i in
$(SUBDIRS
); do
(cd
$$i; \
289 rm -f
*.cm
[iox
] *.o
*.a
*.cma
*.cmxa
*.annot
*~ .
*~
; \
294 $(OCAMLDEP
) *.mli
*.ml
> .depend
295 for i in
$(SUBDIRS
); do ocamldep
$$i/*.ml
$$i/*.mli
>> .depend
; done