2015-03-25 23:03:51 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# This script should run from the directory $QPACKAGE_ROOT/src
|
|
|
|
|
2015-05-13 15:32:55 +02:00
|
|
|
# Check is we are in `QPROOT_SRC` and all the dependancy are corect
|
2015-05-13 11:18:11 +02:00
|
|
|
${QPACKAGE_ROOT}/scripts/check_src.sh
|
2015-03-25 23:03:51 +01:00
|
|
|
|
|
|
|
NPROC=$(cat /proc/cpuinfo | grep MHz | wc -l)
|
|
|
|
|
|
|
|
export IN_MAKE=1
|
|
|
|
|
|
|
|
for MODULE in $@
|
|
|
|
do
|
|
|
|
if [[ ! -d ${MODULE} ]]
|
|
|
|
then
|
|
|
|
error "Module ${MODULE} doesn't exist"
|
|
|
|
fi
|
|
|
|
cd ${MODULE}
|
|
|
|
echo ${MODULE}
|
2015-05-13 15:32:55 +02:00
|
|
|
|
|
|
|
# Update Makefile.depend
|
2015-05-13 11:18:11 +02:00
|
|
|
${QPACKAGE_ROOT}/scripts/check_module.sh
|
2015-05-13 15:32:55 +02:00
|
|
|
|
|
|
|
# Update Makefile.depend
|
|
|
|
${QPACKAGE_ROOT}/scripts/module/create_Makefile_depend.sh
|
|
|
|
${QPACKAGE_ROOT}/scripts/module/module_handler.py save_makefile_depend
|
|
|
|
|
|
|
|
# save_makefile_depend
|
|
|
|
|
|
|
|
# Update EZFIO interface (create the irp.f90 and the ocaml)
|
|
|
|
${QPACKAGE_ROOT}/scripts/ezfio_interface/ei_handler.py --irpf90 --ocaml
|
|
|
|
|
|
|
|
# Create symlink
|
|
|
|
${QPACKAGE_ROOT}/scripts/module/module_handler.py create_symlick
|
|
|
|
|
2015-03-25 23:03:51 +01:00
|
|
|
if [[ $# -eq 1 ]]
|
|
|
|
then
|
|
|
|
env make -j ${NPROC} all
|
|
|
|
else
|
|
|
|
env make -j ${NPROC} all &> make.log
|
|
|
|
if [[ $? -ne 0 ]]
|
|
|
|
then
|
|
|
|
cat make.log
|
|
|
|
error "
|
|
|
|
Build failed for module $MODULE
|
|
|
|
"
|
|
|
|
fi
|
|
|
|
fi
|
2015-05-13 15:32:55 +02:00
|
|
|
# Create gitignore
|
2015-05-04 15:54:51 +02:00
|
|
|
${QPACKAGE_ROOT}/scripts/module/create_gitignore.sh
|
2015-05-13 15:32:55 +02:00
|
|
|
|
|
|
|
# Create png
|
|
|
|
${QPACKAGE_ROOT}/scripts/module/module_handler.py create_png
|
|
|
|
|
2015-03-25 23:03:51 +01:00
|
|
|
cd ${OLDPWD}
|
|
|
|
done
|
2015-05-04 15:54:51 +02:00
|
|
|
${QPACKAGE_ROOT}/scripts/module/create_executables_list.sh
|