#----------------------------------------------------------------------
# specific rules for this package:

OBJECTS  = ds_context.cmo ds_style.cmo
XOBJECTS = $(OBJECTS:.cmo=.cmx)
ARCHIVE  = xmlforms.cma
XARCHIVE = xmlforms.cmxa
NAME     = xmlforms
REQUIRES = labltk str pxp

xmlforms: $(ARCHIVE) ds_app.cmo
	ocamlfind ocamlc -g -o xmlforms -package "$(REQUIRES)" \
		-linkpkg $(ARCHIVE) ds_app.cmo 

xmlform.opt: $(XARCHIVE) ds_app.cmx
	ocamlfind ocamlopt -o xmlforms.opt -package "$(REQUIRES)" \
		-linkpkg $(XARCHIVE) ds_app.cmx

$(ARCHIVE): $(OBJECTS)
	$(OCAMLC) -a -o $(ARCHIVE) $(OBJECTS)

$(XARCHIVE): $(XOBJECTS)
	$(OCAMLOPT) -a -o $(XARCHIVE) $(XOBJECTS)

#----------------------------------------------------------------------
# general rules:

OPTIONS   =
OCAMLC    = ocamlfind ocamlc -g -package "$(REQUIRES)"
OCAMLOPT  = ocamlfind ocamlopt  -package "$(REQUIRES)"
OCAMLDEP  = ocamldep $(OPTIONS)
OCAMLFIND = ocamlfind

depend: *.ml *.mli 
	$(OCAMLDEP) *.ml *.mli >depend

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

.ml.cmx:
	$(OCAMLOPT) -c $<

.ml.cmo:
	$(OCAMLC) -c $<

.mli.cmi:
	$(OCAMLC) -c $<

.mll.ml:
	ocamllex $<

*.mli:

include depend
