]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/mathml_editor/ocaml/Makefile.am
* added missing dependencies
[helm.git] / helm / DEVEL / mathml_editor / ocaml / Makefile.am
1 PKGNAME = mathml-editor
2 ARCHIVE = mlmathml-editor
3 REQUIRES = gdome2 gdome2-xslt
4 OCAMLFIND = @OCAMLFIND@
5 OCAMLC = $(OCAMLFIND) @OCAMLC@ -package "$(REQUIRES)"
6 OCAMLOPT = $(OCAMLFIND) @OCAMLOPT@ -package "$(REQUIRES)"
7 OCAMLDEP = $(OCAMLFIND) @OCAMLDEP@ -package "$(REQUIRES)"
8 OCAMLMKLIB = @OCAMLMKLIB@
9 DLL = dll$(ARCHIVE).so
10 OCAMLSTDLIBDIR = $(DESTDIR)/@OCAMLSTDLIBDIR@
11 OCAMLSTUBDIR = $(DESTDIR)/@OCAMLSTUBDIR@
12 OCAMLINSTALLDIR = $(OCAMLSTDLIBDIR)/$(PKGNAME)
13 MODULES = i_mathml_editor mathml_editor
14 INIT =
15 CMI_S = $(MODULES:%=%.cmi)
16 CMO_S = $(MODULES:%=%.cmo)
17 CMX_S = $(MODULES:%=%.cmx)
18 O_S = ml_mathml_editor.o c_mathml_editor.o
19 SHARED_LIBS = $(GMETADOM_LIBS) $(GDOMEXSLT_LIBS) -lmlgdome2-xslt -lmlgdome
20 BYTE_STUFF = $(ARCHIVE).cma
21 NATIVE_STUFF = $(ARCHIVE).cmxa $(ARCHIVE).a
22 BYTE_INSTALL_STUFF =    \
23         i_mathml_editor.cmi mathml_editor.cmi $(ARCHIVE).cma $(DLL) META
24 NATIVE_INSTALL_STUFF = $(ARCHIVE).a $(ARCHIVE).cmxa
25
26 EXTRA_DIST =    \
27         META.in mathml_editor.ml i_mathml_editor.ml     \
28         ml_mathml_editor.h c_mathml_editor.h .depend
29
30 if HAVE_OCAMLOPT_COND
31 noinst_DATA = $(BYTE_STUFF) $(NATIVE_STUFF)
32 else
33 noinst_DATA = $(BYTE_STUFF)
34 endif
35
36 noinst_LTLIBRARIES = libmlmathml_editor.la
37 libmlmathml_editor_la_SOURCES = \
38   c_mathml_editor.cc \
39   ml_mathml_editor.c
40
41 #test: test.ml $(ARCHIVE).cma
42 #       $(OCAMLC) -o $@ -linkpkg $(INCLUDES) $<
43
44 #test.opt: test.ml $(ARCHIVE).cmxa
45 #       $(OCAMLOPT) -o $@ -linkpkg $(INCLUDES) $<
46
47 if HAVE_OCAMLOPT_COND
48 install-data-local:     $(BYTE_INSTALL_STUFF) $(NATIVE_INSTALL_STUFF)
49 else
50 install-data-local:     $(BYTE_INSTALL_STUFF)
51 endif
52         $(mkinstalldirs) $(OCAMLSTDLIBDIR) $(OCAMLSTUBDIR)
53         chmod -x $(DLL)
54         $(OCAMLFIND) install -destdir $(OCAMLSTDLIBDIR) $(PKGNAME) $^
55         ln -fs $(DLL) $(OCAMLSTUBDIR)/lib$(ARCHIVE).so
56
57 CLEANFILES =    \
58         $(ARCHIVE).{cma,cmxa,a} $(CMI_S) $(CMO_S) $(CMX_S) ml_mathml_editor.o   \
59         $(DLL) $(INIT).cm[iox] libmlmathml_editor.a
60
61 INCLUDES =      \
62         $(GDOME_CFLAGS) $(MLGDOME_CFLAGS) \
63         $(GMETADOM_CFLAGS) $(GDOMEXSLT_CFLAGS) \
64         -I$(top_srcdir)/src
65
66 $(ARCHIVE).cma $(DLL): $(CMO_S)
67         $(OCAMLMKLIB) -o $(ARCHIVE) -L@OCAMLSTUBDIR@ $(CMO_S) $(O_S) $(SHARED_LIBS)
68 $(ARCHIVE).cmxa $(ARCHIVE).a: $(CMX_S)
69         $(OCAMLMKLIB) -o $(ARCHIVE) -L@OCAMLSTUBDIR@ $(CMX_S) $(O_S) $(SHARED_LIBS)
70
71 %.cmi: %.mli
72         $(OCAMLC) -c $<
73 %.cmo %.cmi: %.ml
74         $(OCAMLC) -c $<
75 %.cmx: %.ml %.cmi
76         $(OCAMLOPT) -c $<
77
78 i_mathml_editor.cmo: i_mathml_editor.ml
79         $(OCAMLC) -c $<
80 i_mathml_editor.cmx: i_mathml_editor.ml
81         $(OCAMLOPT) -c $<
82
83 depend: *.ml *.mli
84         $(OCAMLDEP) *.ml *.mli >.depend
85 include .depend
86