2014-04-03 01:45:22 +02:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# usage:
|
|
|
|
# create_Makefile.sh MOs AOs Electrons
|
|
|
|
# Creates the Makefile with the dependencies on other modules given
|
|
|
|
# in the command line. This command is supposed to be run in a module
|
|
|
|
# directory and searches the dependencies in ../
|
|
|
|
# Thu Apr 3 01:44:41 CEST 2014
|
|
|
|
|
|
|
|
DEPS_LONG=""
|
|
|
|
for i in $@
|
|
|
|
do
|
|
|
|
DEPS_LONG+=" $i "
|
2014-04-03 11:19:41 +02:00
|
|
|
DEPS_LONG+=$(cat ${QPACKAGE_ROOT}/src/${i}/NEEDED_MODULES)
|
2014-04-03 01:45:22 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
DEPS=($(
|
|
|
|
for d in $DEPS_LONG
|
|
|
|
do
|
|
|
|
echo $d
|
|
|
|
done | sort | uniq
|
|
|
|
))
|
|
|
|
|
2014-04-03 11:19:41 +02:00
|
|
|
# Create the NEEDED_MODULES file
|
|
|
|
cat << EOF > NEEDED_MODULES
|
|
|
|
${DEPS[@]}
|
|
|
|
EOF
|
|
|
|
|
2014-04-03 01:45:22 +02:00
|
|
|
# Create the Makefile
|
|
|
|
cat << EOF > Makefile
|
|
|
|
default: all
|
|
|
|
|
2014-04-03 11:28:54 +02:00
|
|
|
NEEDED_MODULES=\$(shell cat NEEDED_MODULES)
|
2014-04-03 01:45:22 +02:00
|
|
|
|
|
|
|
# Define here all new external source files and objects.Don't forget to prefix the
|
|
|
|
# object files with IRPF90_temp/
|
|
|
|
SRC=
|
|
|
|
OBJ=
|
|
|
|
|
|
|
|
include Makefile.depend
|
2014-04-03 01:50:22 +02:00
|
|
|
include \$(QPACKAGE_ROOT)/src/Makefile.config
|
|
|
|
include \$(QPACKAGE_ROOT)/src/Makefile.common
|
2014-04-03 01:45:22 +02:00
|
|
|
include irpf90.make
|
|
|
|
|
2014-04-03 11:19:41 +02:00
|
|
|
irpf90.make: \$(filter-out IRPF90_temp/%, \$(wildcard */*.irp.f)) \$(wildcard *.irp.f) \$(wildcard *.inc.f) Makefile \$(EZFIO) NEEDED_MODULES
|
2014-04-03 01:45:22 +02:00
|
|
|
\$(IRPF90)
|
|
|
|
|
2014-04-03 11:28:54 +02:00
|
|
|
Makefile.depend: NEEDED_MODULES
|
2014-04-03 01:50:22 +02:00
|
|
|
\$(QPACKAGE_ROOT)/scripts/create_Makefile_depend.sh
|
2014-04-03 01:45:22 +02:00
|
|
|
EOF
|
|
|
|
|
|
|
|
|