--- MITgcm/tools/xmakedepend 2005/03/03 18:05:39 1.6 +++ MITgcm/tools/xmakedepend 2013/04/05 13:47:19 1.10 @@ -1,5 +1,8 @@ #! /usr/bin/env sh # +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/xmakedepend,v 1.10 2013/04/05 13:47:19 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,6 +29,7 @@ # 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 $CPPARGS" CC="cpp $CPPARGS" if test -x /lib/cpp ; then @@ -166,7 +170,7 @@ ;; esac -if [ "$verbose"x = "y"x ]; then +if [ "$verbose"x = "y"x ]; then cat $CPPCMD fi @@ -175,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 @@ -249,7 +251,6 @@ $TMPMAKEFILE) cat $TMPMAKEFILE ;; - esac rm -f ${TMP}*