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 ocollection
/oseth.ml ocollection
/osetb.ml ocollection
/osetpt.ml \
17 ocollection
/oassocb.ml ocollection
/oassoch.ml ocollection
/oassoc_buffer.ml ocollection
/oassoc_cache.ml ocollection
/oassocid.ml \
19 ocollection
/ograph2way.ml ograph_extended.ml \
21 glimpse.ml parser_combinators.ml
23 # src from other authors, got from the web or caml hump
24 SRC
=ocamlextra
/dumper.ml
25 SRC
+=ocamlextra
/ANSITerminal.ml
26 SRC
+=ocamlextra
/setb.ml ocamlextra
/mapb.ml
# defunctorized version of standard set/map
27 SRC
+=ocamlextra
/setPt.ml
29 SRC
+=ocamlextra
/enum.ml ocamlextra
/dynArray.ml
30 SRC
+=ocamlextra
/suffix_tree.ml ocamlextra
/suffix_tree_ext.ml
32 SYSLIBS
=str.cma unix.cma
34 INCLUDEDIRS
=ocamlextra ocollection
35 SUBDIRS
=ocamlextra ocollection
37 #-----------------------------------------------------------------------------
38 # Other common (thin wrapper) libraries
39 #-----------------------------------------------------------------------------
41 #format: XXXSRC, XXXINCLUDE, XXXSYSLIBS
44 MYGDBMSRC
=ocollection
/oassocdbm.ml
47 #berkeley db (ocamlbdb)
48 MYBDBSRC
=ocollection
/oassocbdb.ml ocollection
/oassocbdb_string.ml
49 BDBINCLUDES
=-I ..
/ocamlbdb
55 GUIINCLUDES
=-I
+lablgtk2
-I
+lablgtksourceview
-I ..
/ocamlgtk
/src
56 GUISYSLIBS
=lablgtk.cma lablgtksourceview.cma
60 PYINCLUDES
=-I ..
/ocamlpython
-I ..
/..
/ocamlpython
64 MYMPISRC
=distribution.ml
65 MPIINCLUDES
=-I ..
/ocamlmpi
-I ..
/..
/ocamlmpi
-I
+ocamlmpi
69 #REGEXPINCLUDES=-I +pcre
71 REGEXPINCLUDES
=-I ..
/ocamlpcre
/lib
-I ..
/..
/ocamlpcre
/lib
74 MYSEXPSRC
=sexp_common.ml
75 SEXPINCLUDES
=-I ..
/ocamlsexp
-I ..
/ocamltarzan
/lib-sexp
-I ..
/..
/ocamltarzan
/lib-sexp
77 MYBINSRC
=bin_common.ml
78 BININCLUDES
=-I ..
/ocamltarzan
/lib-binprot
-I ..
/..
/ocamltarzan
/lib-binprot
80 #-----------------------------------------------------------------------------
82 #-----------------------------------------------------------------------------
85 MYBACKTRACESRC
=backtrace.ml
86 BACKTRACEINCLUDES
=-I
$(shell ocamlc
-where
)
89 ##############################################################################
91 ##############################################################################
93 INCLUDES
=$(INCLUDEDIRS
:%=-I
%) $(INCLUDESEXTRA
)
95 ##############################################################################
96 # Generic ocaml variables
97 ##############################################################################
99 # This flag can also be used in subdirectories so don't change its name here.
100 # For profiling use: -p -inline 0
104 # The OPTBIN variable is here to allow to use ocamlc.opt instead of
105 # ocaml, when it is available, which speeds up compilation. So
106 # if you want the fast version of the ocaml chain tools, set this var
107 # or setenv it to ".opt" in your startup script.
110 OCAMLCFLAGS ?
= -g
-dtypes
113 OCAMLC
=ocamlc
$(OPTBIN
) $(OCAMLCFLAGS
) $(INCLUDES
)
114 OCAMLOPT
=ocamlopt
$(OPTBIN
) $(OPTFLAGS
) $(INCLUDES
)
115 OCAMLLEX
= ocamllex
$(OPTBIN
)
116 OCAMLYACC
= ocamlyacc
-v
117 OCAMLDEP
= ocamldep
$(OPTBIN
) $(INCLUDES
)
118 OCAMLMKTOP
=ocamlmktop
-g
-custom
$(INCLUDES
)
121 OCAMLMKLIB
=ocamlmklib
124 ##############################################################################
126 ##############################################################################
128 OPTLIB
=$(LIB
:.cma
=.cmxa
)
130 OBJS
= $(SRC
:.ml
=.cmo
)
131 OPTOBJS
= $(SRC
:.ml
=.cmx
)
140 $(OCAMLC
) -a
-o
$@
$^
142 $(OPTLIB
): $(OPTOBJS
)
143 $(OCAMLOPT
) -a
-o
$@
$^
145 $(TARGET
).top
: $(OBJS
)
146 $(OCAMLMKTOP
) -o
$@
$(SYSLIBS
) $^
151 ##############################################################################
152 # Other commons libs target
153 ##############################################################################
155 all_libs
: gdbm bdb gui mpi regexp backtrace
157 #-----------------------------------------------------------------------------
158 gdbm
: commons_gdbm.cma
159 gdbm.opt
: commons_gdbm.cmxa
161 commons_gdbm.cma
: $(MYGDBMSRC
:.ml
=.cmo
)
162 $(OCAMLC
) -a
-o
$@
$^
164 commons_gdbm.cmxa
: $(MYGDBMSRC
:.ml
=.cmx
)
165 $(OCAMLOPT
) -a
-o
$@
$^
168 #-----------------------------------------------------------------------------
170 $(MAKE
) INCLUDESEXTRA
="$(BDBINCLUDES)" commons_bdb.cma
172 $(MAKE
) INCLUDESEXTRA
="$(BDBINCLUDES)" commons_bdb.cmxa
174 commons_bdb.cma
: $(MYBDBSRC
:.ml
=.cmo
)
175 $(OCAMLC
) -a
-o
$@
$^
177 commons_bdb.cmxa
: $(MYBDBSRC
:.ml
=.cmx
)
178 $(OCAMLOPT
) -a
-o
$@
$^
182 #-----------------------------------------------------------------------------
184 $(MAKE
) INCLUDESEXTRA
="$(GUIINCLUDES)" commons_gui.cma
186 $(MAKE
) INCLUDESEXTRA
="$(GUIINCLUDES)" commons_gui.cmxa
188 commons_gui.cma
: $(MYGUISRC
:.ml
=.cmo
)
189 $(OCAMLC
) -a
-o
$@
$^
191 commons_gui.cmxa
: $(MYGUISRC
:.ml
=.cmx
)
192 $(OCAMLOPT
) -a
-o
$@
$^
196 #-----------------------------------------------------------------------------
198 $(MAKE
) INCLUDESEXTRA
="$(MPIINCLUDES)" commons_mpi.cma
200 $(MAKE
) INCLUDESEXTRA
="$(MPIINCLUDES)" commons_mpi.cmxa
202 commons_mpi.cma
: $(MYMPISRC
:.ml
=.cmo
)
203 $(OCAMLC
) -a
-o
$@
$^
205 commons_mpi.cmxa
: $(MYMPISRC
:.ml
=.cmx
)
206 $(OCAMLOPT
) -a
-o
$@
$^
210 distribution.opt
: mpi.opt
214 #-----------------------------------------------------------------------------
216 $(MAKE
) INCLUDESEXTRA
="$(PYINCLUDES)" commons_python.cma
218 $(MAKE
) INCLUDESEXTRA
="$(PYINCLUDES)" commons_python.cmxa
221 commons_python.cma
: $(MYPYSRC
:.ml
=.cmo
)
222 $(OCAMLC
) -a
-o
$@
$^
224 commons_python.cmxa
: $(MYPYSRC
:.ml
=.cmx
)
225 $(OCAMLOPT
) -a
-o
$@
$^
228 #-----------------------------------------------------------------------------
230 $(MAKE
) INCLUDESEXTRA
="$(REGEXPINCLUDES)" commons_regexp.cma
232 $(MAKE
) INCLUDESEXTRA
="$(REGEXPINCLUDES)" commons_regexp.cmxa
234 commons_regexp.cma
: $(MYREGEXPSRC
:.ml
=.cmo
)
235 $(OCAMLC
) -a
-o
$@
$^
237 commons_regexp.cmxa
: $(MYREGEXPSRC
:.ml
=.cmx
)
238 $(OCAMLOPT
) -a
-o
$@
$^
241 #-----------------------------------------------------------------------------
242 backtrace
: commons_backtrace.cma
243 backtrace.opt
: commons_backtrace.cmxa
245 backtrace_c.o
: backtrace_c.c
246 $(CC
) $(BACKTRACEINCLUDES
) -c
$^
248 commons_backtrace.cma
: $(MYBACKTRACESRC
:.ml
=.cmo
) backtrace_c.o
249 $(OCAMLMKLIB
) -o commons_backtrace
$^
251 commons_backtrace.cmxa
: $(MYBACKTRACESRC
:.ml
=.cmx
) backtrace_c.o
252 $(OCAMLMKLIB
) -o commons_backtrace
$^
255 rm -f dllcommons_backtrace.so
259 #-----------------------------------------------------------------------------
261 $(MAKE
) INCLUDESEXTRA
="$(SEXPINCLUDES)" commons_sexp.cma
263 $(MAKE
) INCLUDESEXTRA
="$(SEXPINCLUDES)" commons_sexp.cmxa
265 commons_sexp.cma
: $(MYSEXPSRC
:.ml
=.cmo
)
266 $(OCAMLC
) -a
-o
$@
$^
268 commons_sexp.cmxa
: $(MYSEXPSRC
:.ml
=.cmx
)
269 $(OCAMLOPT
) -a
-o
$@
$^
272 $(MAKE
) INCLUDESEXTRA
="$(BININCLUDES)" commons_bin.cma
274 $(MAKE
) INCLUDESEXTRA
="$(BININCLUDES)" commons_bin.cmxa
276 commons_bin.cma
: $(MYBINSRC
:.ml
=.cmo
)
277 $(OCAMLC
) -a
-o
$@
$^
279 commons_bin.cmxa
: $(MYBINSRC
:.ml
=.cmx
)
280 $(OCAMLOPT
) -a
-o
$@
$^
282 ##############################################################################
283 # The global "features" lib wrapper
284 ##############################################################################
286 features
: commons_features.cma
287 features.opt
: commons_features.cmxa
289 commons_features.cma
: features.cmo
290 $(OCAMLC
) -a
-o
$@
$^
292 commons_features.cmxa
: features.cmx
293 $(OCAMLOPT
) -a
-o
$@
$^
296 ##############################################################################
298 ##############################################################################
301 otags
-no-mli-tags
-r .
307 $(MAKE
) OPTFLAGS
="-p -inline 0 " opt
310 ocamldep
*.mli
*.ml
> /tmp
/dependfull.depend
311 ocamldot
-fullgraph
/tmp
/dependfull.depend
> /tmp
/dependfull.dot
312 dot
-Tps
/tmp
/dependfull.dot
> /tmp
/dependfull.ps
315 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
316 ocamldot
-fullgraph
/tmp
/dependfull.depend
> /tmp
/dependfull.dot
317 dot
-Tps
/tmp
/dependfull.dot
> /tmp
/dependfull.ps
320 ##############################################################################
322 ##############################################################################
324 .SUFFIXES
: .ml .mli .cmo .cmi .cmx
334 rm -f
*.cm
[iox
] *.o
*.a
*.cma
*.cmxa
*.annot
338 for i in
$(SUBDIRS
); do
(cd
$$i; \
339 rm -f
*.cm
[iox
] *.o
*.a
*.cma
*.cmxa
*.annot
*~ .
*~
; \
344 $(OCAMLDEP
) *.mli
*.ml
> .depend
345 for i in
$(SUBDIRS
); do
$(OCAMLDEP
) $$i/*.ml
$$i/*.mli
>> .depend
; done