1 |
#!/bin/sh |
#! /usr/bin/env bash |
2 |
# |
# |
3 |
# $Header$ |
# $Header$ |
4 |
# |
# |
1147 |
|
|
1148 |
# Create a list of #define and #undef to enable/disable packages |
# Create a list of #define and #undef to enable/disable packages |
1149 |
PACKAGES_DOT_H=PACKAGES_CONFIG.h |
PACKAGES_DOT_H=PACKAGES_CONFIG.h |
|
cat <<EOF >$PACKAGES_DOT_H".tmp" |
|
|
C=== GENMAKE v2 === |
|
|
C The following defines have been set by GENMAKE, so please do not |
|
|
C edit anything below these comments. In general, you should |
|
|
C add or remove packages by re-running genmake with different |
|
|
C "-enable" and/or "-disable" options. |
|
|
|
|
|
#ifndef PACKAGES_H |
|
|
#define PACKAGES_H |
|
|
|
|
|
C Packages disabled by genmake: |
|
|
EOF |
|
1150 |
# The following UGLY HACK sets multiple "#undef"s and it needs to go |
# The following UGLY HACK sets multiple "#undef"s and it needs to go |
1151 |
# away. On 2003-08-12, CNH, JMC, and EH3 agreed that the CPP_OPTIONS.h |
# away. On 2003-08-12, CNH, JMC, and EH3 agreed that the CPP_OPTIONS.h |
1152 |
# file would eventually be split up so that all package-related #define |
# file would eventually be split up so that all package-related #define |
1165 |
done |
done |
1166 |
if test "x$has_pack" = xf ; then |
if test "x$has_pack" = xf ; then |
1167 |
undef=`echo "ALLOW_$n" | $AWK '{print toupper($0)}'` |
undef=`echo "ALLOW_$n" | $AWK '{print toupper($0)}'` |
|
echo "#undef $undef" >> $PACKAGES_DOT_H".tmp" |
|
1168 |
DISABLED_PACKAGES="$DISABLED_PACKAGES -U$undef" |
DISABLED_PACKAGES="$DISABLED_PACKAGES -U$undef" |
1169 |
fi |
fi |
1170 |
fi |
fi |
1171 |
done |
done |
|
cat <<EOF >>$PACKAGES_DOT_H".tmp" |
|
|
|
|
|
C Packages enabled by genmake: |
|
|
EOF |
|
1172 |
ENABLED_PACKAGES= |
ENABLED_PACKAGES= |
1173 |
for i in $PACKAGES ; do |
for i in $PACKAGES ; do |
1174 |
def=`echo "ALLOW_$i" | $AWK '{print toupper($0)}'` |
def=`echo "ALLOW_$i" | $AWK '{print toupper($0)}'` |
|
echo "#define $def" >> $PACKAGES_DOT_H".tmp" |
|
1175 |
ENABLED_PACKAGES="$ENABLED_PACKAGES -D$def" |
ENABLED_PACKAGES="$ENABLED_PACKAGES -D$def" |
1176 |
#eh3 DEFINES="$DEFINES -D$def" |
#eh3 DEFINES="$DEFINES -D$def" |
1177 |
|
|
1178 |
#EH3 WARNING : This is an UGLY HACK that needs to be removed!!! |
#EH3 WARNING : This is an UGLY HACK that needs to be removed!!! |
1179 |
case $i in |
case $i in |
1180 |
aim_v23) |
aim_v23) |
|
echo "#define ALLOW_AIM" >> $PACKAGES_DOT_H".tmp" |
|
1181 |
DEFINES="$DEFINES -DALLOW_AIM" |
DEFINES="$DEFINES -DALLOW_AIM" |
1182 |
|
ENABLED_PACKAGES="$ENABLED_PACKAGES -DALLOW_AIM" |
1183 |
echo "Warning: ALLOW_AIM is set to enable aim_v23. This is REALLY ugly Jean-Michel :-)" |
echo "Warning: ALLOW_AIM is set to enable aim_v23. This is REALLY ugly Jean-Michel :-)" |
1184 |
;; |
;; |
1185 |
esac |
esac |
1186 |
#EH3 WARNING : This is an UGLY HACK that needs to be removed!!! |
#EH3 WARNING : This is an UGLY HACK that needs to be removed!!! |
1187 |
|
|
1188 |
done |
done |
|
cat <<EOF >>$PACKAGES_DOT_H".tmp" |
|
|
|
|
|
#endif /* PACKAGES_H */ |
|
|
EOF |
|
|
|
|
|
if test ! -f $PACKAGES_DOT_H ; then |
|
|
mv -f $PACKAGES_DOT_H".tmp" $PACKAGES_DOT_H |
|
|
else |
|
|
cmp $PACKAGES_DOT_H".tmp" $PACKAGES_DOT_H |
|
|
RETVAL=$? |
|
|
if test "x$RETVAL" = x0 ; then |
|
|
rm -f $PACKAGES_DOT_H".tmp" |
|
|
else |
|
|
mv -f $PACKAGES_DOT_H $PACKAGES_DOT_H".bak" |
|
|
mv -f $PACKAGES_DOT_H".tmp" $PACKAGES_DOT_H |
|
|
fi |
|
|
fi |
|
1189 |
|
|
1190 |
echo " Adding STANDARDDIRS" |
echo " Adding STANDARDDIRS" |
1191 |
BUILDDIR=${BUILDDIR:-.} |
BUILDDIR=${BUILDDIR:-.} |
1486 |
# Special targets |
# Special targets |
1487 |
${PACKAGES_DOT_H}: |
${PACKAGES_DOT_H}: |
1488 |
@echo Creating \$@ ... |
@echo Creating \$@ ... |
1489 |
@\$(TOOLSDIR)/convert_cpp_cmd2defines "Warngin - this file is automatically generated - do NOT edit" "Enabled packages:" \$(ENABLED_PACKAGES) " " "Disabled packages:" \$(DISABLED_PACKAGES) > \$@ |
@\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -bPACKAGES_CONFIG_H "Disabled packages:" \$(DISABLED_PACKAGES) " " "Enabled packages:" \$(ENABLED_PACKAGES) > \$@ |
1490 |
AD_CONFIG.h: |
AD_CONFIG.h: |
1491 |
@echo Creating \$@ ... |
@echo Creating \$@ ... |
1492 |
@\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > \$@ |
@\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > \$@ |
1493 |
|
|
1494 |
# The normal chain of rules is ( .F - .f - .o ) |
# The normal chain of rules is ( .F - .f - .o ) |
1495 |
.F.f: |
.F.f: |
1549 |
adtaf: ad_taf_output.f |
adtaf: ad_taf_output.f |
1550 |
adtamc: ad_tamc_output.f |
adtamc: ad_tamc_output.f |
1551 |
|
|
1552 |
ad_input_code.f: links \$(AD_FILES) \$(HEADERFILES) |
ad_input_code.f: \$(AD_FILES) \$(HEADERFILES) |
1553 |
@\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > ad_config.template |
@\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > ad_config.template |
1554 |
cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h |
cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h |
1555 |
-rm -f ad_config.template |
-rm -f ad_config.template |
1581 |
ftltaf: ftl_taf_output.f |
ftltaf: ftl_taf_output.f |
1582 |
ftltamc: ftl_tamc_output.f |
ftltamc: ftl_tamc_output.f |
1583 |
|
|
1584 |
ftl_input_code.f: links \$(AD_FILES) \$(HEADERFILES) |
ftl_input_code.f: \$(AD_FILES) \$(HEADERFILES) |
1585 |
@\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > ftl_config.template |
@\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > ftl_config.template |
1586 |
cmp ftl_config.template AD_CONFIG.h || cat ftl_config.template > AD_CONFIG.h |
cmp ftl_config.template AD_CONFIG.h || cat ftl_config.template > AD_CONFIG.h |
1587 |
-rm -f ftl_config.template |
-rm -f ftl_config.template |
1654 |
|
|
1655 |
printf "\n=== Done ===\n" |
printf "\n=== Done ===\n" |
1656 |
|
|
1657 |
# Write the "template" files for the adjoint builds |
# Create special header files |
1658 |
cat >AD_CONFIG.template <<EOF |
$TOOLSDIR/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -bPACKAGES_CONFIG_H "Disabled packages:" $DISABLED_PACKAGES " " "Enabled packages:" $ENABLED_PACKAGES > $PACKAGES_DOT_H".tmp" |
1659 |
C WARNING: This file is automatically generated by genmake2 and |
if test ! -f $PACKAGES_DOT_H ; then |
1660 |
C used by the Makefile rules. Please DO NOT EDIT this file |
mv -f $PACKAGES_DOT_H".tmp" $PACKAGES_DOT_H |
1661 |
C unless you are CERTAIN that you know what you are doing. |
else |
1662 |
|
cmp $PACKAGES_DOT_H".tmp" $PACKAGES_DOT_H |
1663 |
#undef ALLOW_ADJOINT_RUN |
RETVAL=$? |
1664 |
#undef ALLOW_TANGENTLINEAR_RUN |
if test "x$RETVAL" = x0 ; then |
1665 |
#undef ALLOW_ECCO_OPTIMIZATION |
rm -f $PACKAGES_DOT_H".tmp" |
1666 |
EOF |
else |
1667 |
cat >ad_config.template <<EOF |
mv -f $PACKAGES_DOT_H $PACKAGES_DOT_H".bak" |
1668 |
C WARNING: This file is automatically generated by genmake2 and |
mv -f $PACKAGES_DOT_H".tmp" $PACKAGES_DOT_H |
1669 |
C used by the Makefile rules. Please DO NOT EDIT this file |
fi |
1670 |
C unless you are CERTAIN that you know what you are doing. |
fi |
1671 |
|
if test ! -f AD_CONFIG.h ; then |
1672 |
#define ALLOW_ADJOINT_RUN |
$TOOLSDIR/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > AD_CONFIG.h |
1673 |
#undef ALLOW_TANGENTLINEAR_RUN |
fi |
|
#undef ALLOW_ECCO_OPTIMIZATION |
|
|
EOF |
|
|
cat >ftl_config.template <<EOF |
|
|
C WARNING: This file is automatically generated by genmake2 and |
|
|
C used by the Makefile rules. Please DO NOT EDIT this file |
|
|
C unless you are CERTAIN that you know what you are doing. |
|
|
|
|
|
#undef ALLOW_ADJOINT_RUN |
|
|
#define ALLOW_TANGENTLINEAR_RUN |
|
|
#undef ALLOW_ECCO_OPTIMIZATION |
|
|
EOF |
|
|
cat >svd_config.template <<EOF |
|
|
C WARNING: This file is automatically generated by genmake2 and |
|
|
C used by the Makefile rules. Please DO NOT EDIT this file |
|
|
C unless you are CERTAIN that you know what you are doing. |
|
|
|
|
|
#undef ALLOW_ADJOINT_RUN |
|
|
#undef ALLOW_TANGENTLINEAR_RUN |
|
|
#undef ALLOW_ECCO_OPTIMIZATION |
|
|
EOF |
|
|
cp AD_CONFIG.template AD_CONFIG.h |
|
1674 |
|
|
1675 |
|
|
1676 |
# Write the "state" for future records |
# Write the "state" for future records |