#Adjust this directory for installation
LIBDIR=/usr/local/lib/ocaml
COMPILER=ocamlc -labels -c
LIBRARIAN=ocamlc -a
OPTCOMP=ocamlopt -labels -c
OPTLIB=ocamlopt -a
INSTALL=cp

OBJECTS=obuffer.cmo	ohashtbl.cmo	oqueue.cmo	ostack.cmo \
	omap.cmo	oset.cmo	ostream.cmo	ogenlex.cmo \
	omapping.cmo
OPTOBJS=$(OBJECTS:.cmo=.cmx)

# Default rules

.SUFFIXES: .ml .mli .cmo .cmi .cmx

.ml.cmo:
	$(COMPILER) $(INCLUDES) $<

.ml.cmx:
	$(OPTCOMP) $(INCLUDES) $<

.mli.cmi:
	$(COMPILER) $(INCLUDES) $<

all: stdclass.cma
opt: stdclass.cmxa

stdclass.cma: $(OBJECTS)
	$(LIBRARIAN) -o stdclass.cma $(OBJECTS)

stdclass.cmxa: $(OPTOBJS)
	$(OPTLIB) -o stdclass.cmxa $(OPTOBJS)

install:
	$(INSTALL) stdclass.cma *.cmi *.mli $(LIBDIR)
	if test -f stdclass.cmxa; \
		then $(INSTALL) stdclass.cmxa stdclass.a $(LIBDIR); fi

clean:
	rm -f *.cm* *.o *.a *~ #*

depend:
	ocamldep *.ml *.mli > .depend

include .depend
