mirror of
https://gitlab.com/scemama/qmcchem.git
synced 2024-11-15 18:43:39 +01:00
40 lines
659 B
Bash
40 lines
659 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
if [[ -z ${QMCCHEM_PATH} ]]
|
||
|
then
|
||
|
echo "Error: qmcchemrc not loaded"
|
||
|
exit -1
|
||
|
fi
|
||
|
|
||
|
cd ${QMCCHEM_PATH}/ocaml || exit -1
|
||
|
|
||
|
LSMD5_FILE=${QMCCHEM_PATH}/ocaml/.ls_md5
|
||
|
FILES="*.ml *.mli"
|
||
|
MD5=$(ls -ltr --full-time ${FILES} 2>/dev/null | md5sum | cut -d ' ' -f 1)
|
||
|
|
||
|
REF=0
|
||
|
|
||
|
if [[ -f ${LSMD5_FILE} ]]
|
||
|
then
|
||
|
REF=$(cat ${LSMD5_FILE})
|
||
|
fi
|
||
|
|
||
|
if [[ ${MD5} != ${REF} ]]
|
||
|
then
|
||
|
echo ${MD5} > ${LSMD5_FILE}
|
||
|
echo Finding dependencies in OCaml files
|
||
|
python ./ninja_ocaml.py
|
||
|
if [[ ! -f qptypes_generator ]]
|
||
|
then
|
||
|
ninja -f generated.ninja qptypes_generator
|
||
|
fi
|
||
|
if [[ ! -f Qptypes.ml ]]
|
||
|
then
|
||
|
./qptypes_generator
|
||
|
python ./ninja_ocaml.py
|
||
|
fi
|
||
|
|
||
|
fi
|
||
|
|
||
|
|