1 GETLIBDIR = ocamlc -v | grep "^Standard" | sed 's/^.*: *//'
2 LIBDIR = `$(GETLIBDIR)`
3 INSTALLDIR = $(LIBDIR)/minidom
4 OBJECTS = minidom.cmi minidom.cmo ml_minidom.o ominidom.cmi ominidom.cmo
5 OBJECTS_OPT = minidom.cmx ominidom.cmx
6 INST = minidom.o ominidom.o ml_minidom.h minidom.mli
10 opt: $(OBJECTS_OPT) test.opt
12 ml_minidom.o: ml_minidom.c
13 gcc -c -I$(LIBDIR)/caml/ `glib-config --cflags` `minidom-config --cflags` $<
15 minidom.cmi: minidom.mli
18 minidom.cmo: minidom.ml minidom.cmi
21 minidom.cmx: minidom.ml minidom.cmi
24 ominidom.cmi: ominidom.mli
27 ominidom.cmo: ominidom.ml
30 ominidom.cmx: ominidom.ml
33 test.cmo: test.ml minidom.cmo
36 test.cmx: test.ml minidom.cmx
39 test: test.cmo minidom.cmo ml_minidom.o
40 ocamlc -custom -o test minidom.cmo test.cmo ml_minidom.o \
41 -cclib "`glib-config --libs` `minidom-config --libs`"
43 test.opt: test.cmx minidom.cmx ml_minidom.o
44 ocamlopt -o test.opt minidom.cmx test.cmx ml_minidom.o \
45 -cclib "`glib-config --libs` `minidom-config --libs`"
48 if test -d $(INSTALLDIR); then : ; else mkdir -p $(INSTALLDIR); fi
49 cp $(OBJECTS) $(OBJECTS_OPT) $(INST) $(INSTALLDIR)
52 rm -f *.o *.cm? test test.opt