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 oseti.ml oseth.ml osetb.ml osetpt.ml \
13 oassocb.ml oassoch.ml oassoc_buffer.ml oassocid.ml \
15 ograph2way.ml ograph_extended.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
/parser_combinators.ml
27 SRC
+=ocamlextra
/suffix_tree.ml ocamlextra
/suffix_tree_ext.ml
29 SYSLIBS
=str.cma unix.cma
31 INCLUDEDIRS
=ocamlextra
34 #-----------------------------------------------------------------------------
35 # Other common (thin wrapper) libraries
36 #-----------------------------------------------------------------------------
39 MYGDBMSRC
=oassocdbm.ml
43 BDBINCLUDES
=-I ..
/ocamlbdb
49 GUIINCLUDES
=-I
+lablgtk2
-I
+lablgtksourceview
-I ..
/ocamlgtk
/src
51 GUISYSLIBS
=lablgtk.cma lablgtksourceview.cma
54 PYINCLUDES
=-I ..
/ocamlpython
-I ..
/..
/ocamlpython
59 MPIINCLUDES
=-I ..
/ocamlmpi
-I ..
/..
/ocamlmpi
-I
+ocamlmpi
60 MYMPISRC
=distribution.ml
64 MPIINCLUDES
=-I ..
/ocamlmpi
-I ..
/..
/ocamlmpi
-I
+ocamlmpi
65 MYMPISRC
=distribution.ml
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 gdbm
: commons_gdbm.cma
146 gdbm.opt
: commons_gdbm.cmxa
148 commons_gdbm.cma
: $(MYGDBMSRC
:.ml
=.cmo
)
149 $(OCAMLC
) -a
-o
$@
$^
151 commons_gdbm.cmxa
: $(MYGDBMSRC
:.ml
=.cmx
)
152 $(OCAMLOPT
) -a
-o
$@
$^
156 $(MAKE
) INCLUDESEXTRA
="$(BDBINCLUDES)" commons_bdb.cma
158 $(MAKE
) INCLUDESEXTRA
="$(BDBINCLUDES)" commons_bdb.cmxa
160 commons_bdb.cma
: $(MYBDBSRC
:.ml
=.cmo
)
161 $(OCAMLC
) -a
-o
$@
$^
163 commons_bdb.cmxa
: $(MYBDBSRC
:.ml
=.cmx
)
164 $(OCAMLOPT
) -a
-o
$@
$^
169 $(MAKE
) INCLUDESEXTRA
="$(GUIINCLUDES)" commons_gui.cma
171 $(MAKE
) INCLUDESEXTRA
="$(GUIINCLUDES)" commons_gui.cmxa
173 commons_gui.cma
: $(MYGUISRC
:.ml
=.cmo
)
174 $(OCAMLC
) -a
-o
$@
$^
176 commons_gui.cmxa
: $(MYGUISRC
:.ml
=.cmx
)
177 $(OCAMLOPT
) -a
-o
$@
$^
182 $(MAKE
) INCLUDESEXTRA
="$(MPIINCLUDES)" commons_mpi.cma
184 $(MAKE
) INCLUDESEXTRA
="$(MPIINCLUDES)" commons_mpi.cmxa
186 commons_mpi.cma
: $(MYMPISRC
:.ml
=.cmo
)
187 $(OCAMLC
) -a
-o
$@
$^
189 commons_mpi.cmxa
: $(MYMPISRC
:.ml
=.cmx
)
190 $(OCAMLOPT
) -a
-o
$@
$^
194 distribution.opt
: mpi.opt
199 $(MAKE
) INCLUDESEXTRA
="$(PYINCLUDES)" commons_python.cma
201 $(MAKE
) INCLUDESEXTRA
="$(PYINCLUDES)" commons_python.cmxa
204 commons_python.cma
: $(MYPYSRC
:.ml
=.cmo
)
205 $(OCAMLC
) -a
-o
$@
$^
207 commons_python.cmxa
: $(MYPYSRC
:.ml
=.cmx
)
208 $(OCAMLOPT
) -a
-o
$@
$^
211 backtrace
: commons_backtrace.cma
212 backtrace.opt
: commons_backtrace.cmxa
214 backtrace_c.o
: backtrace_c.c
215 $(CC
) $(BACKTRACEINCLUDES
) -c
$^
217 commons_backtrace.cma
: $(MYBACKTRACESRC
:.ml
=.cmo
) backtrace_c.o
218 $(OCAMLMKLIB
) -o commons_backtrace
$^
220 commons_backtrace.cmxa
: $(MYBACKTRACESRC
:.ml
=.cmx
) backtrace_c.o
221 $(OCAMLMKLIB
) -o commons_backtrace
$^
224 rm -f dllcommons_backtrace.so
227 ##############################################################################
229 ##############################################################################
232 otags
-no-mli-tags
-r .
238 $(MAKE
) OPTFLAGS
="-p -inline 0 " opt
241 ocamldep
*.mli
*.ml
> /tmp
/dependfull.depend
242 ocamldot
-fullgraph
/tmp
/dependfull.depend
> /tmp
/dependfull.dot
243 dot
-Tps
/tmp
/dependfull.dot
> /tmp
/dependfull.ps
246 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
247 ocamldot
-fullgraph
/tmp
/dependfull.depend
> /tmp
/dependfull.dot
248 dot
-Tps
/tmp
/dependfull.dot
> /tmp
/dependfull.ps
251 ##############################################################################
253 ##############################################################################
255 .SUFFIXES
: .ml .mli .cmo .cmi .cmx
265 rm -f
*.cm
[iox
] *.o
*.a
*.cma
*.cmxa
*.annot
269 rm -f
$(SUBDIR
)/*.cm
[iox
] $(SUBDIR
)/*.o
$(SUBDIR
)/*.a
270 rm -f
$(SUBDIR
)/*.cma
$(SUBDIR
)/*.cmxa
$(SUBDIR
)/*.annot
271 rm -f
$(SUBDIR
)/*~
$(SUBDIR
)/.
*~
#*#
274 $(OCAMLDEP
) *.mli
*.ml
$(SUBDIR
)/*.ml
$(SUBDIR
)/*.mli
> .depend