# Copyright (c) 1992, 1993
# The Regents of the University of California. All rights reserved.
# %sccs.include.redist.sh%
# @(#)systags.sh 8.1 (Berkeley) %G%
# systags.sh - construct a system tags file using dependence relations
# First written May 16, 1992 by Van Jacobson, Lawrence Berkeley Laboratory.
# from: $Header: systags.sh,v 1.7 92/07/12 08:18:21 torek Exp $
rm -f tags tags.tmp tags.cfiles tags.sfiles tags.hfiles
sed -e "s,\./machine/,../../$MACHINE/include/,g" \
-e 's,[a-z][^/ ]*/\.\./,,g' .depend |
awk '{
for (i = 1; i <= NF; ++i) {
t = substr($i, length($i) - 1)
ctags
-t -d -w `cat tags.cfiles tags.hfiles tags.sfiles`
egrep -o "^ENTRY\(.*\)|^ALTENTRY\(.*\)" `cat tags.sfiles` | \
sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$/;" >> tags
rm tags.tmp tags.cfiles tags.sfiles tags.hfiles