Commit | Line | Data |
---|---|---|
fc86871b CT |
1 | #! /bin/sh |
2 | # | |
3 | # Copyright (c) 1992 Regents of the University of California. | |
4 | # All rights reserved. | |
5 | # | |
6 | # %sccs.include.redist.sh% | |
7 | # | |
8 | # @(#)systags.sh 7.1 (Berkeley) %G% | |
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 | ||
17 | rm -f tags tags.tmp tags.cfiles tags.sfiles tags.hfiles | |
18 | MACHINE=`machine` | |
19 | sed -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 | ||
40 | ctags -t -d -w `cat tags.cfiles tags.hfiles tags.sfiles` | |
41 | egrep -o "^ENTRY\(.*\)|^ALTENTRY\(.*\)" `cat tags.sfiles` | \ | |
42 | sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$/;" >> tags | |
43 | ||
44 | mv tags tags.tmp | |
45 | sort -u tags.tmp > tags | |
46 | rm tags.tmp tags.cfiles tags.sfiles tags.hfiles |