10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-12-22 12:23:31 +01:00
QCaml/Makefile.include

62 lines
1.8 KiB
Makefile

.NOPARALLEL:
INCLUDE_DIRS=Parallel,Nuclei,Utils,Basis,SCF,MOBasis,CI
LIBS=
PKGS=
OCAMLBUILD=ocamlbuild -j 0 -cflags $(ocamlcflags) -lflags $(ocamllflags) $(ocamldocflags) -Is $(INCLUDE_DIRS) -ocamlopt $(ocamloptflags) $(mpi)
MLLFILES=$(filter-out $(wildcard _build/*), $(wildcard */*.mll) $(wildcard *.mll)) Utils/math_functions.c
MLYFILES=$(filter-out $(wildcard _build/*), $(wildcard */*.mly) $(wildcard *.mly))
MLFILES= $(filter-out $(wildcard Parallel_*/*) $(wildcard _build/*), $(wildcard */*.ml) $(wildcard *.ml) )
MLIFILES=$(filter-out $(wildcard Parallel_*/*) $(wildcard _build/*), $(wildcard */*.mli) $(wildcard *.mli) )
ALL_NATIVE=$(patsubst %.ml,%.native,$(wildcard run_*.ml))
ALL_BYTE=$(patsubst %.ml,%.byte,$(wildcard run_*.ml))
ALL_EXE=$(ALL_BYTE) $(ALL_NATIVE)
.PHONY: default doc
default: $(ALL_EXE) doc
tests: run_tests.native
QCaml.odocl: $(MLIFILES)
ls $(MLIFILES) | sed "s/\.mli//" > QCaml.odocl
doc: QCaml.odocl
$(OCAMLBUILD) QCaml.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)
%.native: $(MLFILES) $(MLIFILES) $(MLLFILES) $(MLYFILES)
rm -f -- $*
$(OCAMLBUILD) $*.native -use-ocamlfind $(PKGS)
ln -s $*.native $*
%.p.native: $(MLFILES) $(MLIFILES) $(MLLFILES) $(MLYFILES)
rm -f -- $*
$(OCAMLBUILD) $*.p.native -use-ocamlfind $(PKGS)
%.p.byte: $(MLFILES) $(MLIFILES) $(MLLFILES) $(MLYFILES)
rm -f -- $*
$(OCAMLBUILD) -ocamlc ocamlcp $*.byte -use-ocamlfind $(PKGS)
clean:
$(OCAMLBUILD) -clean # rm -rf _build $(ALL_EXE) *.native *.byte
debug: run_integrals.native
./debug.sh
install: $(ALL_NATIVE)
cp run_hartree_fock.native $(bin)/run_hartree_fock
uninstall:
rm -f $(bin)/run_hartree_fock