aboutsummaryrefslogtreecommitdiff
path: root/gdb/createtags
blob: aa2797f52489d2a667dc8cbd31c7c7df1ab8910f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
#
# Here we check to see if we are compiling in a directory that contains
# symlinks to the source files instead of the actual files.  If this is so, 
# we setup the TAGS entries to point to the actual source directory.
#
filelist=""
if test "`find main.c -type l -print `" != "" ; then
	prefix=`ls -l main.c | awk '{print $11}' | sed 's;main.c$;;'`
else
	prefix=""
fi
for i in $@ ; do
	filelist="$filelist $prefix$i"
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