1#! /bin/sh 2# 3# Copyright (c) 1992, 1993 4# The Regents of the University of California. All rights reserved. 5# 6# %sccs.include.redist.sh% 7# 8# @(#)systags.sh 8.1 (Berkeley) 06/10/93 9# 10# systags.sh - construct a system tags file using dependence relations 11# in a .depend file 12# 13# First written May 16, 1992 by Van Jacobson, Lawrence Berkeley Laboratory. 14# 15# from: $Header: systags.sh,v 1.7 92/07/12 08:18:21 torek Exp $ 16 17rm -f tags tags.tmp tags.cfiles tags.sfiles tags.hfiles 18MACHINE=`machine` 19sed -e "s,\./machine/,../../$MACHINE/include/,g" \ 20 -e 's,[a-z][^/ ]*/\.\./,,g' .depend | awk '{ 21 for (i = 1; i <= NF; ++i) { 22 t = substr($i, length($i) - 1) 23 if (t == ".c") 24 cfiles[$i] = 1; 25 else if (t == ".h") 26 hfiles[$i] = 1; 27 else if (t == ".s") 28 sfiles[$i] = 1; 29 } 30 }; 31 END { 32 for (i in cfiles) 33 print i > "tags.cfiles"; 34 for (i in sfiles) 35 print i > "tags.sfiles"; 36 for (i in hfiles) 37 print i > "tags.hfiles"; 38 }' 39 40ctags -t -d -w `cat tags.cfiles tags.hfiles tags.sfiles` 41egrep -o "^ENTRY\(.*\)|^ALTENTRY\(.*\)" `cat tags.sfiles` | \ 42 sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$/;" >> tags 43 44mv tags tags.tmp 45sort -u tags.tmp > tags 46rm tags.tmp tags.cfiles tags.sfiles tags.hfiles 47