makefile 1.64 KB
OCAMLC=ocamlc
OCAMLOPT=ocamlopt
OCAMLDEP=ocamldep
INCLUDES=-I +xml-light -I +xlib -I +zip -I +bz2 -I +eniam -I +yojson
OCAMLFLAGS=$(INCLUDES) -g
OCAMLOPTFLAGS=$(INCLUDES) unix.cmxa xml-light.cmxa str.cmxa nums.cmxa zip.cmxa bz2.cmxa xlib.cmxa eniam-lcg-parser.cmxa yojson.cmx
INSTALLDIR=`ocamlc -where`/eniam

SOURCES=ENIAMmstModel.ml ENIAMmstFeatures.ml ENIAMmstDisambiguation.ml

all: eniam-mst-disambiguation.cma eniam-mst-disambiguation.cmxa

install: all
	mkdir -p $(INSTALLDIR)
	cp eniam-mst-disambiguation.cmxa eniam-mst-disambiguation.a eniam-mst-disambiguation.cma $(INSTALLDIR)
	cp ENIAMmstDisambiguation.cmi ENIAMmstModel.cmi ENIAMmstFeatures.cmi $(INSTALLDIR)
	cp ENIAMmstDisambiguation.cmx ENIAMmstModel.cmx ENIAMmstFeatures.cmx $(INSTALLDIR)

install-local: all
	mkdir -p $(INSTALLDIR)
	cp eniam-mst-disambiguation.cmxa eniam-mst-disambiguation.a eniam-mst-disambiguation.cma $(INSTALLDIR)
	cp ENIAMmstDisambiguation.cmi ENIAMmstModel.cmi ENIAMmstFeatures.cmi $(INSTALLDIR)
	cp ENIAMmstDisambiguation.cmx ENIAMmstModel.cmx ENIAMmstFeatures.cmx $(INSTALLDIR)

eniam-mst-disambiguation.cma: $(SOURCES)
	ocamlc -linkall -a -o eniam-mst-disambiguation.cma $(OCAMLFLAGS) $^

eniam-mst-disambiguation.cmxa: $(SOURCES)
	ocamlopt -linkall -a -o eniam-mst-disambiguation.cmxa $(INCLUDES) $^

test: test.ml
	mkdir -p results
	$(OCAMLOPT) -o test $(OCAMLOPTFLAGS) test.ml

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

.mll.ml:
	ocamllex $<

.mly.mli:
	ocamlyacc $<

.mly.ml:
	ocamlyacc $<

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

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

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

clean:
	rm -f *~ *.cm[aoix] *.o *.so *.cmxa *.a test