--- MITgcm/tools/xmakedepend 2003/11/25 17:22:47 1.4 +++ MITgcm/tools/xmakedepend 2010/03/16 00:59:38 1.8 @@ -1,5 +1,8 @@ #! /usr/bin/env sh # +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/xmakedepend,v 1.8 2010/03/16 00:59:38 jmc Exp $ +# $Name: $ +# # $TOG: mdepend.cpp /main/13 1997/06/20 21:12:18 kaleb $ # # Do the equivalent of the 'makedepend' program, but do it right. @@ -25,15 +28,11 @@ # $XFree86: xc/config/util/mdepend.cpp,v 3.2 1997/06/29 07:54:20 dawes Exp $ # -CPPARGS="-traditional -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE " +CPPARGS="-Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE " -if test -r ./genmake_optfile ; then - . ./genmake_optfile -fi -if test "x$CPP" != x0 ; then - CC="$CPP $CPPARGS" -else - CC="cpp $CPPARGS" +CC="cpp $CPPARGS" +if test -x /lib/cpp ; then + CC="/lib/cpp $CPPARGS" fi silent='-' @@ -170,7 +169,7 @@ ;; esac -if [ "$verbose"x = "y"x ]; then +if [ "$verbose"x = "y"x ]; then cat $CPPCMD fi @@ -179,11 +178,9 @@ do $CPPCMD $i | sed -n "/^#/s;^;$i ;p" -done | sed -e 's|/[^/.][^/]*/\.\.||g' -e 's|/\.[^.][^/]*/\.\.||g' -e 's|"||g' -e 's| \./| |' | awk '{ +done | sed -e 's|/[^/.][^/]*/\.\.||g' -e 's|/\.[^.][^/]*/\.\.||g' -e 's|"||g' -e 's| \./| |' | awk '!/<.*>/{ if ($1 != $4 && $2 != "#ident" && $2 != "#pragma") - - { ofile = substr ($1, 1, length ($1) - 2) "'"$objsuffix"'" print ofile, $4 @@ -253,7 +250,6 @@ $TMPMAKEFILE) cat $TMPMAKEFILE ;; - esac rm -f ${TMP}*