10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-11-07 22:53:57 +01:00
quantum_package/ocaml/Makefile

52 lines
1.3 KiB
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-26 15:31:16 +02:00
EXECUTABLES=set_mo_class
2014-08-13 17:54:32 +02:00
LIBS=
PKGS=
OCAMLCFLAGS=-g
OCAMLBUILD=ocamlbuild -cflags $(OCAMLCFLAGS) -lflags -g
2014-08-26 15:31:16 +02:00
MLFILES=$(wildcard *.ml) ezfio.ml qptypes.ml
2014-08-24 20:00:26 +02:00
MLIFILES=$(wildcard *.mli)
ALL_TESTS=$(patsubst %.ml,%.byte,$(wildcard test_*.ml))
2014-08-13 17:54:32 +02:00
2014-08-26 15:31:16 +02:00
default: $(ALL_TESTS) executables
executables: $(patsubst %, %.native, $(EXECUTABLES))
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 .
2014-08-26 15:31:16 +02:00
qptypes_generator.byte: qptypes_generator.ml
$(OCAMLBUILD) qptypes_generator.byte -use-ocamlfind
qptypes.ml: qptypes_generator.byte
./qptypes_generator.byte > qptypes.ml
rm qptypes_generator.byte
2014-08-24 20:00:26 +02:00
${QPACKAGE_ROOT}/EZFIO/Ocaml/ezfio.ml:
$(MAKE) -C ${QPACKAGE_ROOT}/src ezfio
2014-08-13 17:54:32 +02:00
clean:
rm -rf _build