10
1
mirror of https://gitlab.com/scemama/qmcchem.git synced 2024-12-22 12:23:30 +01:00
qmcchem/ocaml/Makefile

60 lines
1.5 KiB
Makefile
Raw Normal View History

2019-07-14 18:50:44 +02:00
.NOPARALLEL:
# Check if QMCCHEM_PATH is defined
ifndef QMCCHEM_PATH
$(info -------------------- Error --------------------)
$(info QMCCHEM_PATH undefined. Source the qmcchem.rc script)
$(info -----------------------------------------------)
$(error )
endif
LIBS=
PKGS=
OCAMLCFLAGS="-g"
OCAMLOPTFLAGS="opt -O3 -remove-unused-arguments -rounds 16 -inline 100 -inline-max-unroll 100"
OCAMLBUILD=ocamlbuild -j 0 -cflags $(OCAMLCFLAGS) -lflags $(OCAMLCFLAGS) -ocamlopt $(OCAMLOPTFLAGS)
MLLFILES=$(wildcard *.mll)
MLFILES=$(wildcard *.ml) ezfio.ml Qptypes.ml
MLIFILES=$(wildcard *.mli)
ALL_TESTS=$(patsubst %.ml,%.byte,$(wildcard test_*.ml))
ALL_EXE=$(patsubst %.ml,%.native,$(wildcard qp_*.ml)) qmcchem.native
.PHONY: default
default: $(ALL_EXE)
2019-07-22 12:19:12 +02:00
2019-07-14 18:50:44 +02:00
tests: $(ALL_TESTS)
%.inferred.mli: $(MLFILES)
$(OCAMLBUILD) $*.inferred.mli -use-ocamlfind $(PKGS)
mv _build/$*.inferred.mli .
%.byte: $(MLFILES) $(MLIFILES)
rm -f -- $*
$(OCAMLBUILD) $*.byte -use-ocamlfind $(PKGS)
ln -s $*.byte $*
%.native: $(MLFILES) $(MLIFILES)
rm -f -- $*
$(OCAMLBUILD) $*.native -use-ocamlfind $(PKGS)
ln -s $*.native $*
ezfio.ml: ${QMCCHEM_PATH}/EZFIO/Ocaml/ezfio.ml
cp ${QMCCHEM_PATH}/EZFIO/Ocaml/ezfio.ml .
qptypes_generator.byte: qptypes_generator.ml
$(OCAMLBUILD) qptypes_generator.byte -use-ocamlfind
Qptypes.ml: qptypes_generator.byte
./qptypes_generator.byte > Qptypes.ml
${QMCCHEM_PATH}/EZFIO/Ocaml/ezfio.ml:
${MAKE) -C ${QMCCHEM_PATH}/EZFIO/
clean:
rm -rf _build Qptypes.ml $(ALL_EXE) $(ALL_TESTS)