3 INCLUDEDIR = @OCAML_INCLUDE_DIR@
5 OBJECTS_C = ml_minidom.o
6 OBJECTS = minidom.cmo ominidom.cmo
7 OBJECTS_OPT = minidom.cmx ominidom.cmx
8 INST = ml_minidom.h minidom.mli minidom.cmi ominidom.mli ominidom.cmi META
9 DIST_FILES = Makefile.in configure.in configure *.ml *.mli test.xml ml_minidom.c ml_minidom.h META.in mlminidom.spec.in .depend
10 DOC_FILES = AUTHORS COPYING ChangeLog NEWS README
13 OCAMLC = ocamlfind ocamlc
14 OCAMLOPT = ocamlfind ocamlopt
16 DESTDIR = @OCAML_LIB_DIR@
18 ARCHIVE = $(PACKAGE).cma
19 ARCHIVE_C = $(PACKAGE).a
20 ARCHIVE_OPT = $(PACKAGE).cmxa
23 TMPPKGDIR = $(TMPDIR)/$(PACKAGE)
25 all: $(OBJECTS_C) $(ARCHIVE) test
27 opt: $(OBJECTS_C) $(ARCHIVE_OPT) test.opt
30 rm -rf $(PACKAGE)-$(VERSION)
31 mkdir $(PACKAGE)-$(VERSION)
32 cp $(DIST_FILES) $(DOC_FILES) $(PACKAGE)-$(VERSION)
33 tar cvfz $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
34 rm -rf $(PACKAGE)-$(VERSION)
36 ml_minidom.o: ml_minidom.c
37 gcc -c -I$(INCLUDEDIR) `glib-config --cflags` `minidom-config --cflags` $<
39 .SUFFIXES: .cmo .cmi .cmx .ml .mli
42 $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
45 $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
48 $(OCAMLOPT) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
52 $(OCAMLDEP) *.ml *.mli >.depend
55 $(ARCHIVE): $(OBJECTS)
56 $(OCAMLC) -a -custom -package "$(REQUIRES)" \
57 -predicates "$(PREDICATES)" -o $@ $^ \
58 -cclib "`glib-config --libs` `minidom-config --libs`"
60 $(ARCHIVE_OPT): $(OBJECTS_OPT)
61 $(OCAMLOPT) -a -package "$(REQUIRES)" \
62 -predicates "$(PREDICATES)" -o $@ $^ \
63 -cclib "`glib-config --libs` `minidom-config --libs`"
65 test: test.ml $(OBJECTS_C) $(ARCHIVE)
67 cp $(OBJECTS_C) $(ARCHIVE) $(INST) $(TMPPKGDIR)
69 cd $(TMPDIR) ; export OCAMLPATH=.:$$OCAMLPATH ; \
70 $(OCAMLC) -package "$(PACKAGE)" -linkpkg -predicates "" -o $@ test.ml
74 test.opt: test.ml $(OBJECTS_C) $(ARCHIVE_C) $(ARCHIVE_OPT)
76 cp $(OBJECTS_C) $(ARCHIVE_C) $(ARCHIVE_OPT) $(INST) $(TMPPKGDIR)
78 cd $(TMPDIR) ; export OCAMLPATH=.:$$OCAMLPATH ; \
79 $(OCAMLOPT) -package "$(PACKAGE)" -linkpkg -predicates "" -o $@ test.ml
84 test ! -f $(ARCHIVE_OPT) || extra="$(ARCHIVE_C) $(ARCHIVE_OPT)" ; \
85 ocamlfind install -destdir $(DESTDIR) $(PACKAGE) $(OBJECTS_C) $(ARCHIVE) $(INST) $$extra
88 ocamlfind remove $(PACKAGE)
91 rm -f *.o *.cm? test test.opt $(ARCHIVE) $(ARCHIVE_C) $(ARCHIVE_OPT)
95 rm -f config.log config.cache config.status Makefile META mlminidom.spec