/[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.14 by edhill, Tue Oct 21 15:29:20 2003 UTC revision 1.15 by edhill, Tue Oct 21 18:35:08 2003 UTC
# Line 46  expand_pkg_groups() { Line 46  expand_pkg_groups() {
46      PKG_GROUPS=$ROOTDIR"/pkg/pkg_groups"      PKG_GROUPS=$ROOTDIR"/pkg/pkg_groups"
47      if test -r $PKG_GROUPS ; then      if test -r $PKG_GROUPS ; then
48          cat $PKG_GROUPS | sed -e 's/#.*$//g' | sed -e 's/:/ : /g' > ./p1.tmp          cat $PKG_GROUPS | sed -e 's/#.*$//g' | sed -e 's/:/ : /g' > ./p1.tmp
49          cat ./p1.tmp | awk '(NF>2 && $2==":"){ print $0 }' > ./p2.tmp          cat ./p1.tmp | $AWK '(NF>2 && $2==":"){ print $0 }' > ./p2.tmp
50          matched=0          matched=0
51          for i in $PACKAGES ; do          for i in $PACKAGES ; do
52              line=`grep "^ *$i" ./p2.tmp`              line=`grep "^ *$i" ./p2.tmp`
53              RETVAL=$?              RETVAL=$?
54              if test "x$RETVAL" = x0 ; then              if test "x$RETVAL" = x0 ; then
55                  matched=1                  matched=1
56                  replace=`echo $line | awk '{ $1=""; $2=""; print $0 }'`                  replace=`echo $line | $AWK '{ $1=""; $2=""; print $0 }'`
57                  echo "    replacing \"$i\" with: $replace"                  echo "    replacing \"$i\" with: $replace"
58                  new_packages="$new_packages $replace"                  new_packages="$new_packages $replace"
59              else              else
# Line 136  EOF Line 136  EOF
136          echo "  The possible FORTRAN compilers found in your path are:"          echo "  The possible FORTRAN compilers found in your path are:"
137          echo "   "$p_FC          echo "   "$p_FC
138          if test "x$FC" = x ; then          if test "x$FC" = x ; then
139              FC=`echo $p_FC | awk '{print $1}'`              FC=`echo $p_FC | $AWK '{print $1}'`
140          fi          fi
141      fi      fi
142    
# Line 202  get_pdepend_list()  { Line 202  get_pdepend_list()  {
202      #  strip the comments and then convert the dependency file into      #  strip the comments and then convert the dependency file into
203      #  two arrays: PNAME, DNAME      #  two arrays: PNAME, DNAME
204      cat $1 | sed -e 's/#.*$//g' \      cat $1 | sed -e 's/#.*$//g' \
205          | awk 'BEGIN{nn=0;} (NF>0){ for(i=2;i<=NF;i++){nn++; print "PNAME["nn"]="$1"\nDNAME["nn"]="$i} }' \          | $AWK 'BEGIN{nn=0;} (NF>0){ for(i=2;i<=NF;i++){nn++; print "PNAME["nn"]="$1"\nDNAME["nn"]="$i} }' \
206          > ./.pd_tmp          > ./.pd_tmp
207      source ./.pd_tmp      source ./.pd_tmp
208      rm -f ./.pd_tmp      rm -f ./.pd_tmp
# Line 319  STANDARDDIRS= Line 319  STANDARDDIRS=
319    
320  PWD=`pwd`  PWD=`pwd`
321  MAKE=make  MAKE=make
322    AWK=awk
323  THISHOSTNAME=`hostname`  THISHOSTNAME=`hostname`
324  THISCWD=`pwd`  THISCWD=`pwd`
325  THISDATE=`date`  THISDATE=`date`
# Line 721  echo "  getting package dependency info Line 722  echo "  getting package dependency info
722  #  Strip the comments and then convert the dependency file into  #  Strip the comments and then convert the dependency file into
723  #  two arrays: PNAME, DNAME  #  two arrays: PNAME, DNAME
724  cat $PDEPEND | sed -e 's/#.*$//g' \  cat $PDEPEND | sed -e 's/#.*$//g' \
725      | awk 'BEGIN{nn=-1;} (NF>0){ for(i=2;i<=NF;i++){nn++; print "PNAME_"nn"="$1"\nDNAME_"nn"="$i}} END{print "nname="nn}' \      | $AWK 'BEGIN{nn=-1;} (NF>0){ for(i=2;i<=NF;i++){nn++; print "PNAME_"nn"="$1"\nDNAME_"nn"="$i}} END{print "nname="nn}' \
726      > ./.pd_tmp      > ./.pd_tmp
727  RETVAL=$?  RETVAL=$?
728  if test ! "x${RETVAL}" = x0 ; then  if test ! "x${RETVAL}" = x0 ; then
# Line 755  else Line 756  else
756      else      else
757          echo "  using PDEFAULT=\"$PDEFAULT\""          echo "  using PDEFAULT=\"$PDEFAULT\""
758          #  Strip the comments and add all the names          #  Strip the comments and add all the names
759          def=`cat $PDEFAULT | sed -e 's/#.*$//g' | awk '(NF>0){print $0}'`          def=`cat $PDEFAULT | sed -e 's/#.*$//g' | $AWK '(NF>0){print $0}'`
760          RETVAL=$?          RETVAL=$?
761          if test "x${RETVAL}" != x0 ; then          if test "x${RETVAL}" != x0 ; then
762              echo -n "Error: can't parse default package list "              echo -n "Error: can't parse default package list "
# Line 935  for n in $names ; do Line 936  for n in $names ; do
936              fi              fi
937          done          done
938          if test "x$has_pack" = xf ; then          if test "x$has_pack" = xf ; then
939              undef=`echo "ALLOW_$n" | awk '{print toupper($0)}'`              undef=`echo "ALLOW_$n" | $AWK '{print toupper($0)}'`
940              echo "#undef $undef" >> $PACKAGES_DOT_H".tmp"              echo "#undef $undef" >> $PACKAGES_DOT_H".tmp"
941  #           DEFINES="$DEFINES -U$undef"  #           DEFINES="$DEFINES -U$undef"
942    
# Line 961  cat <<EOF >>$PACKAGES_DOT_H".tmp" Line 962  cat <<EOF >>$PACKAGES_DOT_H".tmp"
962  C  Packages enabled by genmake:  C  Packages enabled by genmake:
963  EOF  EOF
964  for i in $PACKAGES ; do  for i in $PACKAGES ; do
965      def=`echo "ALLOW_$i" | awk '{print toupper($0)}'`      def=`echo "ALLOW_$i" | $AWK '{print toupper($0)}'`
966      echo "#define $def" >> $PACKAGES_DOT_H".tmp"      echo "#define $def" >> $PACKAGES_DOT_H".tmp"
967  #eh3 DEFINES="$DEFINES -D$def"  #eh3 DEFINES="$DEFINES -D$def"
968    
# Line 1096  for d in $alldirs ; do Line 1097  for d in $alldirs ; do
1097      for sf in $sfiles ; do      for sf in $sfiles ; do
1098          if test ! -r ".links.tmp/$sf" ; then          if test ! -r ".links.tmp/$sf" ; then
1099              if test -f "$d/$sf" ; then              if test -f "$d/$sf" ; then
1100                  extn=`echo $sf | awk -F '.' '{print $NF}'`                  extn=`echo $sf | $AWK -F '.' '{print $NF}'`
1101                  touch .links.tmp/$sf                  touch .links.tmp/$sf
1102                  deplist="$deplist $sf"                  deplist="$deplist $sf"
1103                  case $extn in                  case $extn in

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.22