# we setup the TAGS entries to point to the actual source directory.
#
filelist=""
-if test -h main.c ; then
+if test "`find main.c -type l -print `" != "" ; then
prefix=`ls -l main.c | awk '{print $11}' | sed 's;main.c$;;'`
- echo path 1
else
prefix=""
fi
+
+# Replace .o at end of filename with .c
for i in $@ ; do
- filelist="$prefix$i $filelist"
+ file=`echo $i-x- | sed -e 's/\.o-x-/\.c-x-/' | sed -e 's/-x-//'`
+ filelist="$filelist $prefix$file"
done
-#
-# Here we simply make sure that the actual machine dependent files being used
-# (if any) are ahead of all of the other machine dependent files in the list.
-# This means that M-. will (almost) always give you exactly the routine
-# you want.
-#
-if test -f param.h ; then
- if `grep '^#define[ ]*COFF_FORMAT' param.h > /dev/null 2>&1`; then
- frmatfile=${prefix}coffread.c
- else
- frmatfile=${prefix}dbxread.c
- fi
- hfile=$prefix`ls -l param.h | awk '{print $11}'`
- dfile=$prefix`ls -l dep.c | awk '{print $11}'`
- ofile=$prefix`ls -l opcode.h | awk '{print $11}'`
- pfile=$prefix`ls -l pinsn.c | awk '{print $11}'`
- etags $hfile $dfile $ofile $pfile $frmatfile $filelist
-else
- etags $filelist
-fi
+
+etags $filelist