]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mathml_editor/ocaml/Makefile.am
* this is a large commit
[helm.git] / helm / DEVEL / mathml_editor / ocaml / Makefile.am
diff --git a/helm/DEVEL/mathml_editor/ocaml/Makefile.am b/helm/DEVEL/mathml_editor/ocaml/Makefile.am
new file mode 100644 (file)
index 0000000..9c1cc70
--- /dev/null
@@ -0,0 +1,86 @@
+PKGNAME = mathml-editor
+ARCHIVE = mlmathml-editor
+REQUIRES = gdome2 gdome2-xslt
+OCAMLFIND = @OCAMLFIND@
+OCAMLC = $(OCAMLFIND) @OCAMLC@ -package "$(REQUIRES)"
+OCAMLOPT = $(OCAMLFIND) @OCAMLOPT@ -package "$(REQUIRES)"
+OCAMLDEP = $(OCAMLFIND) @OCAMLDEP@ -package "$(REQUIRES)"
+OCAMLMKLIB = @OCAMLMKLIB@
+DLL = dll$(ARCHIVE).so
+OCAMLSTDLIBDIR = $(DESTDIR)/@OCAMLSTDLIBDIR@
+OCAMLSTUBDIR = $(DESTDIR)/@OCAMLSTUBDIR@
+OCAMLINSTALLDIR = $(OCAMLSTDLIBDIR)/$(PKGNAME)
+MODULES = i_mathml_editor mathml_editor
+INIT =
+CMI_S = $(MODULES:%=%.cmi)
+CMO_S = $(MODULES:%=%.cmo)
+CMX_S = $(MODULES:%=%.cmx)
+O_S = ml_mathml_editor.o
+SHARED_LIBS = $(GMETADOM_LIBS) $(GDOMEXSLT_LIBS)
+BYTE_STUFF = $(ARCHIVE).cma
+NATIVE_STUFF = $(ARCHIVE).cmxa $(ARCHIVE).a
+BYTE_INSTALL_STUFF =   \
+       i_mathml_editor.cmi mathml_editor.cmi $(ARCHIVE).cma $(DLL) META
+NATIVE_INSTALL_STUFF = $(ARCHIVE).a $(ARCHIVE).cmxa
+
+EXTRA_DIST =   \
+       META.in mathml_editor.ml i_mathml_editor.ml     \
+       ml_mathml_editor.h c_mathml_editor.h .depend
+
+if HAVE_OCAMLOPT_COND
+noinst_DATA = $(BYTE_STUFF) $(NATIVE_STUFF)
+else
+noinst_DATA = $(BYTE_STUFF)
+endif
+
+noinst_LTLIBRARIES = libmlmathml_editor.la
+libmlmathml_editor_la_SOURCES = \
+  c_mathml_editor.cc \
+  ml_mathml_editor.c
+
+#test: test.ml $(ARCHIVE).cma
+#      $(OCAMLC) -o $@ -linkpkg $(INCLUDES) $<
+
+#test.opt: test.ml $(ARCHIVE).cmxa
+#      $(OCAMLOPT) -o $@ -linkpkg $(INCLUDES) $<
+
+if HAVE_OCAMLOPT_COND
+install-data-local:    $(BYTE_INSTALL_STUFF) $(NATIVE_INSTALL_STUFF)
+else
+install-data-local:    $(BYTE_INSTALL_STUFF)
+endif
+       $(mkinstalldirs) $(OCAMLSTDLIBDIR) $(OCAMLSTUBDIR)
+       chmod -x $(DLL)
+       $(OCAMLFIND) install -destdir $(OCAMLSTDLIBDIR) $(PKGNAME) $^
+       ln -fs $(DLL) $(OCAMLSTUBDIR)/lib$(ARCHIVE).so
+
+CLEANFILES =   \
+       $(ARCHIVE).{cma,cmxa,a} $(CMI_S) $(CMO_S) $(CMX_S) ml_mathml_editor.o   \
+       $(DLL) $(INIT).cm[iox] libmlmathml_editor.a
+
+INCLUDES =     \
+       $(GDOME_CFLAGS) $(MLGDOME_CFLAGS) \
+       $(GMETADOM_CFLAGS) $(GDOMEXSLT_CFLAGS) \
+       -I$(top_srcdir)/src
+
+$(ARCHIVE).cma $(DLL): $(CMO_S)
+       $(OCAMLMKLIB) -o $(ARCHIVE) -L@OCAMLSTUBDIR@ $(CMO_S) $(O_S) $(SHARED_LIBS)
+$(ARCHIVE).cmxa $(ARCHIVE).a: $(CMX_S)
+       $(OCAMLMKLIB) -o $(ARCHIVE) -L@OCAMLSTUBDIR@ $(CMX_S) $(O_S) $(SHARED_LIBS)
+
+%.cmi: %.mli
+       $(OCAMLC) -c $<
+%.cmo %.cmi: %.ml
+       $(OCAMLC) -c $<
+%.cmx: %.ml %.cmi
+       $(OCAMLOPT) -c $<
+
+i_mathml_editor.cmo: i_mathml_editor.ml
+       $(OCAMLC) -c $<
+i_mathml_editor.cmx: i_mathml_editor.ml
+       $(OCAMLOPT) -c $<
+
+depend: *.ml *.mli
+       $(OCAMLDEP) *.ml *.mli >.depend
+include .depend
+