--- MITgcm/tools/genmake2 2011/09/30 20:03:10 1.226 +++ MITgcm/tools/genmake2 2012/01/24 14:54:57 1.229 @@ -1,6 +1,6 @@ #! /usr/bin/env bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/genmake2,v 1.226 2011/09/30 20:03:10 jmc Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/genmake2,v 1.229 2012/01/24 14:54:57 jmc Exp $ # $Name: $ # # Makefile generator for MITgcm UV codes @@ -297,7 +297,7 @@ .F.$tfs: $LN \$< \$@ EOF - $MAKE "genmake_hello."$tfs > /dev/null 2>&1 + $MAKE -f $MAKEFILE "genmake_hello."$tfs > /dev/null 2>&1 RETVAL=$? if test "x$RETVAL" != x0 -o ! -f "genmake_hello."$tfs ; then if test "x$FS" = x ; then @@ -384,7 +384,7 @@ stop end EOF - makedepend genmake_tc.f > /dev/null 2>&1 + makedepend -f $MAKEFILE genmake_tc.f > /dev/null 2>&1 RV1=$? test -f $MAKEFILE && rm -f $MAKEFILE test -f $MAKEFILE".tst" && mv -f $MAKEFILE".tst" $MAKEFILE @@ -2658,7 +2658,7 @@ NOOPTFLAGS = ${NOOPTFLAGS} # Flags and libraries needed for linking LIBS = ${LIBS} -# Name of the Mekfile +# Name of the makefile MAKEFILE=${MAKEFILE} EOF @@ -2696,8 +2696,8 @@ \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) \$(LIBS) depend: - @make links - \$(MAKEDEPEND) -o .$FS \$(DEFINES) \$(INCLUDES) \$(F77_SRC_FILES) + @make -f \$(MAKEFILE) links + \$(MAKEDEPEND) -f \$(MAKEFILE) -o .$FS \$(DEFINES) \$(INCLUDES) \$(F77_SRC_FILES) \$(TOOLSDIR)/f90mkdepend >> \$(MAKEFILE) -rm -f makedepend.out @@ -2726,8 +2726,8 @@ # remove most of the files that "make" and "make depend" generate Clean: - @make clean - @make cleanlinks + @make -f \$(MAKEFILE) clean + @make -f \$(MAKEFILE) cleanlinks -rm -f \$(SPECIAL_FILES) f90mkdepend.log $MAKEFILE.old -rm -f taf_command taf_output taf_ad.log taf_ad_flow.log -rm -f genmake_warnings genmake_errors make.log @@ -2735,7 +2735,7 @@ # remove also the executable, files that "genmake2" generates (except Makefile) # and output from a run (plus log files from testreport) CLEAN: - @make Clean + @make -f \$(MAKEFILE) Clean -rm -f \$(EXECUTABLE) \$(EXE_AD) *.bak -rm -f $LOGFILE genmake_state genmake_*optfile -rm -f SIZE.h.mpi genmake.tr_log make.tr_log @@ -2874,8 +2874,8 @@ @$BASH\$(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 cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h -rm -f ad_config.template - @make \$(F77_PP_SRC_FILES) - @make \$(FLOFILES) + @make -f \$(MAKEFILE) \$(F77_PP_SRC_FILES) + @make -f \$(MAKEFILE) \$(FLOFILES) cat \$(FLOFILES) \$(AD_FILES) | sed -f \$(TOOLSDIR)/remove_comments_sed > ad_input_code.$FS ad_taf_output.$FS: ad_input_code.$FS @@ -2915,8 +2915,8 @@ @$BASH\$(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 cmp ftl_config.template AD_CONFIG.h || cat ftl_config.template > AD_CONFIG.h -rm -f ftl_config.template - @make \$(F77_PP_SRC_FILES) - @make \$(AD_FLOW_FILES) + @make -f \$(MAKEFILE) \$(F77_PP_SRC_FILES) + @make -f \$(MAKEFILE) \$(AD_FLOW_FILES) cat \$(AD_FLOW_FILES) \$(AD_FILES) > ftl_input_code.$FS ftl_taf_output.$FS: ftl_input_code.$FS @@ -3036,7 +3036,7 @@ .PHONY: adDepend adDepend: \$(ALL_LINKED_FILES) \$(addsuffix _mod.h, \$(CB2M_F90_SRC_NAMES)) \$(addsuffix _mod.FF90, \$(CB2M_F90_SRC_NAMES)) \$(F77_SRC_FILES:.F=_cb2m.FF90) - \$(MAKEDEPEND) -o .$FS \$(DEFINES) \$(INCLUDES) \$(F77_SRC_FILES) + \$(MAKEDEPEND) -f \$(MAKEFILE) -o .$FS \$(DEFINES) \$(INCLUDES) \$(F77_SRC_FILES) \$(TOOLSDIR)/f90mkdepend >> \$(MAKEFILE) -rm -f makedepend.out @@ -3175,7 +3175,7 @@ # this step also creates the file postProcess.make but we cannot # name it as the target or else make will try to remake it for # the include directive above for any rule, e.g. make clean - ./postProcess.py --progress --timing --outputFormat=fixed -m r -i ../OAD_support/ad_inline.f --width 4 \$< + ./postProcess.py --progress --timing --infoUnitFile w2f__types.f90 --outputFormat=fixed -m r -i ../OAD_support/ad_inline.f --width 4 \$< # setup some links %.xsd: