2017-12-30 19:06:07 +01:00
|
|
|
.NOPARALLEL:
|
|
|
|
|
|
|
|
LIBS=
|
|
|
|
PKGS=
|
|
|
|
OCAMLCFLAGS="-g"
|
2017-12-30 19:12:20 +01:00
|
|
|
OCAMLBUILD=ocamlbuild -j 0 -cflags $(OCAMLCFLAGS) -lflags $(OCAMLCFLAGS)
|
2017-12-30 19:06:07 +01:00
|
|
|
MLLFILES=$(wildcard *.mll)
|
|
|
|
MLYFILES=$(wildcard *.mly)
|
|
|
|
MLFILES=$(wildcard *.ml)
|
|
|
|
MLIFILES=$(wildcard *.mli)
|
|
|
|
ALL_TESTS=$(patsubst %.ml,%.byte,$(wildcard test_*.ml))
|
|
|
|
ALL_EXE=$(patsubst %.ml,%.native,$(wildcard qp_*.ml))
|
|
|
|
|
|
|
|
.PHONY: default
|
|
|
|
|
|
|
|
default: $(ALL_EXE)
|
|
|
|
tests: $(ALL_TESTS)
|
|
|
|
|
|
|
|
qpackage.odocl: $(MLIFILES)
|
|
|
|
ls $(MLIFILES) | sed "s/\.mli//" > qpackage.odocl
|
|
|
|
|
|
|
|
doc: qpackage.odocl
|
|
|
|
$(OCAMLBUILD) qpackage.docdir/index.html -use-ocamlfind $(PKGS)
|
|
|
|
|
|
|
|
%.inferred.mli: $(MLFILES)
|
|
|
|
$(OCAMLBUILD) $*.inferred.mli -use-ocamlfind $(PKGS)
|
|
|
|
mv _build/$*.inferred.mli .
|
|
|
|
|
|
|
|
%.byte: $(MLFILES) $(MLIFILES) $(MLLFILES) $(MLYFILES)
|
|
|
|
rm -f -- $*
|
|
|
|
$(OCAMLBUILD) $*.byte -use-ocamlfind $(PKGS)
|
|
|
|
ln -s $*.byte $*
|
|
|
|
|
|
|
|
%.native: $(MLFILES) $(MLIFILES) $(MLLFILES) $(MLYFILES)
|
|
|
|
rm -f -- $*
|
|
|
|
$(OCAMLBUILD) $*.native -use-ocamlfind $(PKGS)
|
|
|
|
ln -s $*.native $*
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf _build $(ALL_EXE) $(ALL_TESTS) *.native *.byte
|
|
|
|
|