--- MITgcm/tools/xmakedepend 2004/12/16 14:11:10 1.5 +++ MITgcm/tools/xmakedepend 2013/04/04 21:50:09 1.9 @@ -1,5 +1,8 @@ #! /usr/bin/env sh # +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/xmakedepend,v 1.9 2013/04/04 21:50:09 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. @@ -26,14 +29,11 @@ # CPPARGS="-Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE " +CPPARGS="-traditional -P $CPPARGS" -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 +170,7 @@ ;; esac -if [ "$verbose"x = "y"x ]; then +if [ "$verbose"x = "y"x ]; then cat $CPPCMD fi @@ -179,11 +179,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 +251,6 @@ $TMPMAKEFILE) cat $TMPMAKEFILE ;; - esac rm -f ${TMP}*