/[MITgcm]/MITgcm/tools/genmake2
ViewVC logotype

Diff of /MITgcm/tools/genmake2

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.140 by ce107, Thu Dec 22 01:36:24 2005 UTC revision 1.141 by edhill, Wed Jan 11 06:02:31 2006 UTC
# Line 248  build_cyrus_makedepend()  { Line 248  build_cyrus_makedepend()  {
248      fi      fi
249  }  }
250    
251    
252    build_embed_encode()
253    {
254        printf "  building the embed-encode utility...  "
255        if test ! -e "$ROOTDIR/tools/embed_encode/encode_files" ; then
256            if test ! -d "$ROOTDIR/tools/embed_encode" ; then
257                echo
258                echo "    Error: can't locate \"$ROOTDIR/tools/embed_encode\""
259                echo
260                EMBED_SRC=f
261                return 1
262            fi
263            clist="cc gcc c89 $CC"
264            for ic in $clist ; do
265                comm="$ic -o encode_files encode_files.c"
266                ( cd $ROOTDIR/tools/embed_encode && $comm ) > /dev/null 2>&1
267                RETVAL=$?
268                if test "x$RETVAL" = x0 ; then
269                    echo "OK"
270                    DEFINES="$DEFINES -DHAVE_EMBED_SRC"
271                    return 0
272                fi
273            done
274            echo
275            echo "    Error: unable to build $ROOTDIR/embed_encode/encode_files"
276            echo "      so it has been disabled"
277            echo
278            EMBED_SRC=f
279            return 1
280        fi
281        echo "OK"
282        DEFINES="$DEFINES -DHAVE_EMBED_SRC"
283    }
284    
285    
286  # Guess possible config options for this host  # Guess possible config options for this host
287  find_possible_configs()  {  find_possible_configs()  {
288    
# Line 556  Usage: "$0" [OPTIONS] Line 591  Usage: "$0" [OPTIONS]
591            set to PATH. i.e. Include files from \$PATH/include, link to libraries            set to PATH. i.e. Include files from \$PATH/include, link to libraries
592            from \$PATH/lib and use binaries from \$PATH/bin.            from \$PATH/lib and use binaries from \$PATH/bin.
593    
594        -es | --es | -embed-source | --embed-source
595              Embed a tarball containing the full source code
596              (including the Makefile, etc.) used to build the
597              executable [off by default]
598    
599      -bash NAME      -bash NAME
600            Explicitly specify the Bourne or BASH shell to use            Explicitly specify the Bourne or BASH shell to use
601    
# Line 990  BASH= Line 1030  BASH=
1030  PWD=`pwd`  PWD=`pwd`
1031  test "x$MAKE" = x  &&  MAKE=make  test "x$MAKE" = x  &&  MAKE=make
1032  test "x$AWK" = x   &&  AWK=awk  test "x$AWK" = x   &&  AWK=awk
1033    EMBED_SRC=
1034  THISHOST=`hostname`  THISHOST=`hostname`
1035  THISCWD=`pwd`  THISCWD=`pwd`
1036  THISDATE=`date`  THISDATE=`date`
# Line 1244  for ac_option in "$@" ; do Line 1285  for ac_option in "$@" ; do
1285          -ignoretime | -ignore_time | --ignoretime | --ignore_time)          -ignoretime | -ignore_time | --ignoretime | --ignore_time)
1286              IGNORE_TIME="-DIGNORE_TIME" ;;              IGNORE_TIME="-DIGNORE_TIME" ;;
1287    
1288            -es | --es | -embed-source | --embed-source)
1289                EMBED_SRC=t ;;
1290    
1291          -*)          -*)
1292              echo "Error: unrecognized option: "$ac_option              echo "Error: unrecognized option: "$ac_option
1293              usage              usage
# Line 1576  if test "x$HAVE_CLOC" != x ; then Line 1620  if test "x$HAVE_CLOC" != x ; then
1620      echo "yes"      echo "yes"
1621  else  else
1622      echo "no"      echo "no"
1623        if test "x$EMBED_SRC" = xt ; then
1624            echo "    WARNING: you requested file embedding but it has"
1625            echo "      been disabled since C code cannot be called"
1626            EMBED_SRC=
1627        fi
1628  fi  fi
1629  rm -f genmake_t*  rm -f genmake_t*
1630    
# Line 1615  else Line 1664  else
1664  fi  fi
1665  DEFINES="$DEFINES $IGNORE_TIME"  DEFINES="$DEFINES $IGNORE_TIME"
1666    
1667    if test "x$EMBED_SRC" = xt ; then
1668        build_embed_encode
1669    fi
1670    if test "x$EMBED_SRC" = xt ; then
1671        ENABLE="$ENABLE embed_files"
1672    fi
1673    
1674    
1675  printf "\n===  Setting defaults  ===\n"  printf "\n===  Setting defaults  ===\n"
1676  printf "  Adding MODS directories:  "  printf "  Adding MODS directories:  "
1677  for d in $MODS ; do  for d in $MODS ; do
# Line 2112  for d in $alldirs ; do Line 2169  for d in $alldirs ; do
2169                  ignore_f=f                  ignore_f=f
2170                  case $d/$sf in                  case $d/$sf in
2171                    ./$PACKAGES_DOT_H)                    ./$PACKAGES_DOT_H)
2172                            ignore_f=t
2173                          ;;                          ;;
2174                    ./AD_CONFIG.h)                    ./AD_CONFIG.h)
2175                            ignore_f=t
2176                          ;;                          ;;
2177                    ./FC_NAMEMANGLE.h)                    ./FC_NAMEMANGLE.h)
2178                            ignore_f=t
2179                          ;;                          ;;
2180                    ./BUILD_INFO.h)                    ./BUILD_INFO.h)
2181                            ignore_f=t
2182                            ;;
2183                      ./EMBEDDED_FILES.h)
2184                            ignore_f=t
2185                          ;;                          ;;
2186                    *)                    *)
2187                          #  For the local directory *ONLY*,                          #  For the local directory *ONLY*,
# Line 2230  DISABLED_PACKAGES = ${DISABLED_PACKAGES} Line 2294  DISABLED_PACKAGES = ${DISABLED_PACKAGES}
2294    
2295  # These files are created by Makefile  # These files are created by Makefile
2296  SPECIAL_FILES = ${PACKAGES_DOT_H} AD_CONFIG.h FC_NAMEMANGLE.h BUILD_INFO.h  SPECIAL_FILES = ${PACKAGES_DOT_H} AD_CONFIG.h FC_NAMEMANGLE.h BUILD_INFO.h
   
2297  EOF  EOF
2298    
2299  #  Note: figure out some way to add Hyades JAM libraries here  if test "x$EMBED_SRC" = xt ; then
2300        echo "EMBEDDED_FILES = EMBEDDED_FILES.h" >>$MAKEFILE
2301    else
2302        echo "EMBEDDED_FILES = " >>$MAKEFILE
2303    fi
2304    
2305    #  Note: figure out some way to add Hyades JAM libraries here
2306  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
2307  # Unix ln (link)  # Unix ln (link)
2308  LN = ${LN}  LN = ${LN}
# Line 2296  rm -f ad_flow_files.inc Line 2364  rm -f ad_flow_files.inc
2364  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
2365    
2366  all: \$(EXECUTABLE)  all: \$(EXECUTABLE)
2367  \$(EXECUTABLE): \$(SPECIAL_FILES) \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES) \$(F90SRCFILES) \$(OBJFILES)  \$(EXECUTABLE): \$(SPECIAL_FILES) \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES) \$(F90SRCFILES) \$(OBJFILES) \$(EMBEDDED_FILES)
2368          @echo Creating \$@ ...          @echo Creating \$@ ...
2369          \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) \$(LIBS)          \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) \$(LIBS)
2370  depend:  depend:
# Line 2358  test ! "x$THISUSER" = x && echo "      -echo Line 2426  test ! "x$THISUSER" = x && echo "      -echo
2426  test ! "x$THISDATE" = x && echo "       -echo \"#define THISDATE '$THISDATE'\" >> \$@" >> $MAKEFILE  test ! "x$THISDATE" = x && echo "       -echo \"#define THISDATE '$THISDATE'\" >> \$@" >> $MAKEFILE
2427  test ! "x$THISHOST" = x && echo "       -echo \"#define THISHOST '$THISHOST'\" >> \$@" >> $MAKEFILE  test ! "x$THISHOST" = x && echo "       -echo \"#define THISHOST '$THISHOST'\" >> \$@" >> $MAKEFILE
2428    
2429    if test "x$EMBED_SRC" = xt ; then
2430        cat >>$MAKEFILE <<EOF
2431    
2432    decode_files.o : EMBEDDED_FILES.h
2433    
2434    ##  \$(F77FILES)
2435    all_fF.tar.gz : \$(SPECIAL_FILES) \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES) \$(F90SRCFILES) \$(F77FILES) Makefile
2436            @echo Creating \$@ ...
2437            -tar -hcf all_fF.tar \$(SPECIAL_FILES) \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES) \$(F90SRCFILES) \$(F77FILES) Makefile
2438            -rm -f all_fF.tar.gz
2439            -gzip all_fF.tar
2440    
2441    EMBEDDED_FILES.h : all_fF.tar.gz
2442            @echo Creating \$@ ...
2443            -\${ROOTDIR}/tools/embed_encode/encode_files EMBEDDED_FILES.h all_fF.tar.gz
2444    
2445    EOF
2446    fi
2447    
2448  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
2449    
2450  # The normal chain of rules is (  .F - .$FS - .o  )  # The normal chain of rules is (  .F - .$FS - .o  )

Legend:
Removed from v.1.140  
changed lines
  Added in v.1.141

  ViewVC Help
Powered by ViewVC 1.1.22