10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-25 22:52:15 +02:00
quantum_package/ocaml/Makefile

40 lines
978 B
Makefile
Raw Normal View History

2014-08-26 14:39:23 +02:00
#TODO : Opam auto-installer in makefile
2014-08-24 20:00:26 +02:00
# Check if QPACKAGE_ROOT is defined
ifndef QPACKAGE_ROOT
$(info -------------------- Error --------------------)
$(info QPACKAGE_ROOT undefined. Source the quantum_package.rc script)
$(info -----------------------------------------------)
$(error )
endif
2014-08-13 17:54:32 +02:00
LIBS=
PKGS=
OCAMLCFLAGS=-g
OCAMLBUILD=ocamlbuild -cflags $(OCAMLCFLAGS) -lflags -g
2014-08-24 20:00:26 +02:00
MLFILES=$(wildcard *.ml) ezfio.ml
MLIFILES=$(wildcard *.mli)
ALL_TESTS=$(patsubst %.ml,%.byte,$(wildcard test_*.ml))
2014-08-13 17:54:32 +02:00
2014-08-24 20:00:26 +02:00
default: $(ALL_TESTS)
2014-08-13 17:54:32 +02:00
2014-08-24 20:00:26 +02:00
%.inferred.mli: $(MLFILES)
2014-08-13 17:54:32 +02:00
$(OCAMLBUILD) $*.inferred.mli -cflags -i -use-ocamlfind $(PKGS)
2014-08-24 20:00:26 +02:00
%.byte: $(MLFILES) $(MLIFILES)
2014-08-13 17:54:32 +02:00
$(OCAMLBUILD) $*.byte -use-ocamlfind $(PKGS)
2014-08-24 20:00:26 +02:00
%.native: $(MLFILES) $(MLIFILES)
2014-08-13 17:54:32 +02:00
$(OCAMLBUILD) $*.native -use-ocamlfind $(PKGS)
2014-08-24 20:00:26 +02:00
ezfio.ml: ${QPACKAGE_ROOT}/EZFIO/Ocaml/ezfio.ml
cp ${QPACKAGE_ROOT}/EZFIO/Ocaml/ezfio.ml .
${QPACKAGE_ROOT}/EZFIO/Ocaml/ezfio.ml:
$(MAKE) -C ${QPACKAGE_ROOT}/src ezfio
2014-08-13 17:54:32 +02:00
clean:
rm -rf _build