]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mlminidom/Makefile.in
- the mathql interpreter is not helm-dependent any more
[helm.git] / helm / DEVEL / mlminidom / Makefile.in
index 620bdb5832e398a8f46c3ec30aa0fa6d860022b6..1e4dfdd8f1aedde1133654a077ab01e718472bd6 100644 (file)
@@ -1,17 +1,30 @@
 PACKAGE = @PACKAGE@
-VERSION = @MLMINIDOM_VERSION@
+VERSION = @VERSION@
 INCLUDEDIR = @OCAML_INCLUDE_DIR@
-LIBDIR = @OCAML_LIB_DIR@
-INSTALLDIR = $(LIBDIR)/mlminidom
-OBJECTS = minidom.cmi minidom.cmo ml_minidom.o ominidom.cmi ominidom.cmo
+PREFIX = 
+OBJECTS_C = ml_minidom.o
+OBJECTS = minidom.cmo ominidom.cmo
 OBJECTS_OPT = minidom.cmx ominidom.cmx
-INST = minidom.o ominidom.o ml_minidom.h minidom.mli ml_minidom.h
-DIST_FILES = Makefile.in configure.in configure *.ml *.mli test.xml ml_minidom.c ml_minidom.h
+INST = ml_minidom.h minidom.mli minidom.cmi ominidom.mli ominidom.cmi META
+DIST_FILES = Makefile.in configure.in configure *.ml *.mli test.xml ml_minidom.c ml_minidom.h META.in mlminidom.spec.in .depend
 DOC_FILES = AUTHORS COPYING ChangeLog NEWS README
+REQUIRES =
+PREDICATES =
+OCAMLC = ocamlfind ocamlc
+OCAMLOPT = ocamlfind ocamlopt
+OCAMLDEP = ocamldep
+DESTDIR = @OCAML_LIB_DIR@
 
-all: $(OBJECTS) test
+ARCHIVE = $(PACKAGE).cma
+ARCHIVE_C = $(PACKAGE).a
+ARCHIVE_OPT = $(PACKAGE).cmxa
 
-opt: $(OBJECTS_OPT) test.opt
+TMPDIR = .test
+TMPPKGDIR = $(TMPDIR)/$(PACKAGE)
+
+all: $(OBJECTS_C) $(ARCHIVE) test
+
+opt: $(OBJECTS_C) $(ARCHIVE_OPT) test.opt
 
 dist:
        rm -rf $(PACKAGE)-$(VERSION)
@@ -23,48 +36,61 @@ dist:
 ml_minidom.o: ml_minidom.c
        gcc -c -I$(INCLUDEDIR) `glib-config --cflags` `minidom-config --cflags` $<
 
-minidom.cmi: minidom.mli
-       ocamlc -c $<
-
-minidom.cmo: minidom.ml minidom.cmi
-       ocamlc -c $<
-
-minidom.cmx: minidom.ml minidom.cmi
-       ocamlopt -c $<
-
-ominidom.cmi: ominidom.mli
-       ocamlc -c $<
-
-ominidom.cmo: ominidom.ml
-       ocamlc -c $<
-
-ominidom.cmx: ominidom.ml
-       ocamlopt -c $<
-
-test.cmo: test.ml minidom.cmo
-       ocamlc -c test.ml
-
-test.cmx: test.ml minidom.cmx
-       ocamlopt -c test.ml
-
-test: test.cmo minidom.cmo ml_minidom.o
-       ocamlc -custom -o test minidom.cmo test.cmo ml_minidom.o \
+.SUFFIXES: .cmo .cmi .cmx .ml .mli
+
+.ml.cmo:
+       $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
+                  -c $<
+.mli.cmi:
+       $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
+                  -c $<
+.ml.cmx:
+       $(OCAMLOPT) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
+                  -c $<
+
+depend: *.ml *.mli
+       $(OCAMLDEP) *.ml *.mli >.depend
+include .depend
+
+$(ARCHIVE): $(OBJECTS)
+       $(OCAMLC) -a -custom -package "$(REQUIRES)" \
+        -predicates "$(PREDICATES)" -o $@ $^ \
         -cclib "`glib-config --libs` `minidom-config --libs`"
 
-test.opt: test.cmx minidom.cmx ml_minidom.o
-       ocamlopt -o test.opt minidom.cmx test.cmx ml_minidom.o \
+$(ARCHIVE_OPT): $(OBJECTS_OPT)
+       $(OCAMLOPT) -a -package "$(REQUIRES)" \
+        -predicates "$(PREDICATES)" -o $@ $^ \
         -cclib "`glib-config --libs` `minidom-config --libs`"
 
+test: test.ml $(OBJECTS_C) $(ARCHIVE)
+       mkdir -p $(TMPPKGDIR)
+       cp $(OBJECTS_C) $(ARCHIVE) $(INST) $(TMPPKGDIR)
+       cp test.ml $(TMPDIR)
+       cd $(TMPDIR) ; export OCAMLPATH=.:$$OCAMLPATH ; \
+       $(OCAMLC) -package "$(PACKAGE)" -linkpkg -predicates "" -o $@ test.ml
+       mv $(TMPDIR)/$@ .
+       rm -r $(TMPDIR)
+
+test.opt: test.ml $(OBJECTS_C) $(ARCHIVE_C) $(ARCHIVE_OPT)
+       mkdir -p $(TMPPKGDIR)
+       cp $(OBJECTS_C) $(ARCHIVE_C) $(ARCHIVE_OPT) $(INST) $(TMPPKGDIR)
+       cp test.ml $(TMPDIR)
+       cd $(TMPDIR) ; export OCAMLPATH=.:$$OCAMLPATH ; \
+       $(OCAMLOPT) -package "$(PACKAGE)" -linkpkg -predicates "" -o $@ test.ml
+       mv $(TMPDIR)/$@ .
+       rm -r $(TMPDIR)
+
 install:
-       if test -d $(INSTALLDIR); then : ; else mkdir -p $(INSTALLDIR); fi
-       cp $(OBJECTS) $(OBJECTS_OPT) $(INST) $(INSTALLDIR)
+       test ! -f $(ARCHIVE_OPT) || extra="$(ARCHIVE_C) $(ARCHIVE_OPT)" ; \
+       ocamlfind install -destdir $(DESTDIR) $(PACKAGE) $(OBJECTS_C) $(ARCHIVE) $(INST) $$extra
 
 uninstall:
-       rm -rf $(INSTALLDIR)
+       ocamlfind remove $(PACKAGE)
 
 clean:
-       rm -f *.o *.cm? test test.opt
+       rm -f *.o *.cm? test test.opt $(ARCHIVE) $(ARCHIVE_C) $(ARCHIVE_OPT)
+       rm -rf $(TMPDIR)
 
 distclean: clean
-       rm -f configure config.log config.cache config.status Makefile
+       rm -f config.log config.cache config.status Makefile META mlminidom.spec