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 \
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
33 #-----------------------------------------------------------------------------
34 # Other common (thin wrapper) libraries
35 #-----------------------------------------------------------------------------
38 MYGDBMSRC
=oassocdbm.ml
42 BDBINCLUDES
=-I ..
/ocamlbdb
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
62 #-----------------------------------------------------------------------------
64 #-----------------------------------------------------------------------------
67 BACKTRACEINCLUDES
=-I
$(shell ocamlc
-where
)
68 MYBACKTRACESRC
=backtrace.ml
70 ##############################################################################
72 ##############################################################################
74 INCLUDES
=$(INCLUDEDIRS
:%=-I
%) $(INCLUDESEXTRA
)
76 ##############################################################################
77 # Generic ocaml variables
78 ##############################################################################
80 # This flag can also be used in subdirectories so don't change its name here.
81 # For profiling use: -p -inline 0
85 # The OPTBIN variable is here to allow to use ocamlc.opt instead of
86 # ocaml, when it is available, which speeds up compilation. So
87 # if you want the fast version of the ocaml chain tools, set this var
88 # or setenv it to ".opt" in your startup script.
91 OCAMLCFLAGS ?
= -g
-dtypes
94 OCAMLC
=ocamlc
$(OPTBIN
) $(OCAMLCFLAGS
) $(INCLUDES
)
95 OCAMLOPT
=ocamlopt
$(OPTBIN
) $(OPTFLAGS
) $(INCLUDES
)
96 OCAMLLEX
= ocamllex
$(OPTBIN
)
97 OCAMLYACC
= ocamlyacc
-v
98 OCAMLDEP
= ocamldep
$(OPTBIN
) $(INCLUDES
)
99 OCAMLMKTOP
=ocamlmktop
-g
-custom
$(INCLUDES
)
102 OCAMLMKLIB
=ocamlmklib
105 ##############################################################################
107 ##############################################################################
109 OPTLIB
=$(LIB
:.cma
=.cmxa
)
111 OBJS
= $(SRC
:.ml
=.cmo
)
112 OPTOBJS
= $(SRC
:.ml
=.cmx
)
121 $(OCAMLC
) -a
-o
$@
$^
123 $(OPTLIB
): $(OPTOBJS
)
124 $(OCAMLOPT
) -a
-o
$@
$^
126 $(TARGET
).top
: $(OBJS
)
127 $(OCAMLMKTOP
) -o
$@
$(SYSLIBS
) $^
132 ##############################################################################
133 # Other commons libs target
134 ##############################################################################
136 all_libs
: gdbm bdb gui mpi backtrace
138 gdbm
: commons_gdbm.cma
139 gdbm.opt
: commons_gdbm.cmxa
141 commons_gdbm.cma
: $(MYGDBMSRC
:.ml
=.cmo
)
142 $(OCAMLC
) -a
-o
$@
$^
144 commons_gdbm.cmxa
: $(MYGDBMSRC
:.ml
=.cmx
)
145 $(OCAMLOPT
) -a
-o
$@
$^
149 $(MAKE
) INCLUDESEXTRA
="$(BDBINCLUDES)" commons_bdb.cma
151 $(MAKE
) INCLUDESEXTRA
="$(BDBINCLUDES)" commons_bdb.cmxa
153 commons_bdb.cma
: $(MYBDBSRC
:.ml
=.cmo
)
154 $(OCAMLC
) -a
-o
$@
$^
156 commons_bdb.cmxa
: $(MYBDBSRC
:.ml
=.cmx
)
157 $(OCAMLOPT
) -a
-o
$@
$^
162 $(MAKE
) INCLUDESEXTRA
="$(GUIINCLUDES)" commons_gui.cma
164 $(MAKE
) INCLUDESEXTRA
="$(GUIINCLUDES)" commons_gui.cmxa
166 commons_gui.cma
: $(MYGUISRC
:.ml
=.cmo
)
167 $(OCAMLC
) -a
-o
$@
$^
169 commons_gui.cmxa
: $(MYGUISRC
:.ml
=.cmx
)
170 $(OCAMLOPT
) -a
-o
$@
$^
175 $(MAKE
) INCLUDESEXTRA
="$(MPIINCLUDES)" commons_mpi.cma
177 $(MAKE
) INCLUDESEXTRA
="$(MPIINCLUDES)" commons_mpi.cmxa
179 commons_mpi.cma
: $(MYMPISRC
:.ml
=.cmo
)
180 $(OCAMLC
) -a
-o
$@
$^
182 commons_mpi.cmxa
: $(MYMPISRC
:.ml
=.cmx
)
183 $(OCAMLOPT
) -a
-o
$@
$^
187 distribution.opt
: mpi.opt
192 $(MAKE
) INCLUDESEXTRA
="$(PYINCLUDES)" commons_python.cma
194 $(MAKE
) INCLUDESEXTRA
="$(PYINCLUDES)" commons_python.cmxa
197 commons_python.cma
: $(MYPYSRC
:.ml
=.cmo
)
198 $(OCAMLC
) -a
-o
$@
$^
200 commons_python.cmxa
: $(MYPYSRC
:.ml
=.cmx
)
201 $(OCAMLOPT
) -a
-o
$@
$^
204 backtrace
: commons_backtrace.cma
205 backtrace.opt
: commons_backtrace.cmxa
207 backtrace_c.o
: backtrace_c.c
208 $(CC
) $(BACKTRACEINCLUDES
) -c
$^
210 commons_backtrace.cma
: $(MYBACKTRACESRC
:.ml
=.cmo
) backtrace_c.o
211 $(OCAMLMKLIB
) -o commons_backtrace
$^
213 commons_backtrace.cmxa
: $(MYBACKTRACESRC
:.ml
=.cmx
) backtrace_c.o
214 $(OCAMLMKLIB
) -o commons_backtrace
$^
217 rm -f dllcommons_backtrace.so
220 ##############################################################################
222 ##############################################################################
225 otags
-no-mli-tags
-r .
231 $(MAKE
) OPTFLAGS
="-p -inline 0 " opt
234 ocamldep
*.mli
*.ml
> /tmp
/dependfull.depend
235 ocamldot
-fullgraph
/tmp
/dependfull.depend
> /tmp
/dependfull.dot
236 dot
-Tps
/tmp
/dependfull.dot
> /tmp
/dependfull.ps
239 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
240 ocamldot
-fullgraph
/tmp
/dependfull.depend
> /tmp
/dependfull.dot
241 dot
-Tps
/tmp
/dependfull.dot
> /tmp
/dependfull.ps
244 ##############################################################################
246 ##############################################################################
248 .SUFFIXES
: .ml .mli .cmo .cmi .cmx
258 rm -f
*.cm
[iox
] *.o
*.a
*.cma
*.cmxa
*.annot
262 rm -f
$(SUBDIR
)/*.cm
[iox
] $(SUBDIR
)/*.o
$(SUBDIR
)/*.a
263 rm -f
$(SUBDIR
)/*.cma
$(SUBDIR
)/*.cmxa
$(SUBDIR
)/*.annot
264 rm -f
$(SUBDIR
)/*~
$(SUBDIR
)/.
*~
#*#
267 $(OCAMLDEP
) *.mli
*.ml
$(SUBDIR
)/*.ml
$(SUBDIR
)/*.mli
> .depend