annotate lib-src/process-depends.sh @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children 131b0175ea99
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ## Process the output of makedepend.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ## Copyright (c) 1994 Amdahl Corporation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ## Written by Ben Wing, December 1994.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ## This file is used as part of 'make depend', to produce the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ## dependency list for src/Makefile.in.in.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ## Unfortunately, makedepend (at least the one that comes as part
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ## of Open Windows under Solaris) is stupid and doesn't follow the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ## documented behavior. So we have to force the definitions of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ## certain options through -D flags (even though it's supposed to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ## pick this up), and post-process the output to get rid of stuff
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ## we don't want.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ## The sed stage gets rid of include files in other directories,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ## except for lwlib.h (makedepend puts system include files in,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ## which is pretty stupid). We also get rid of some standard
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ## include files that are in every or pretty much every file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ## and where changes in those files don't usually merit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ## recompilation of everything. Finally, we eliminate entirely
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ## the dependencies for some files (such as unex*.c) that get
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ## screwed up by makedepend. We just put those in by hand at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ## the top of the dependency list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ## The awk stage puts one dependency per line. Then we pass
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ## the result through sort and uniq (makedepend is supposed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ## to not put in duplicate dependencies, but it does so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ## occasionally).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ## After running 'make depend', verify that the output (in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ## depend.out) is reasonable and then replace the stuff in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ## Makefile.in.in marked "generated by 'make depend'".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 sed -e '
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 1d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 s/ \/[^ ]*\/lwlib\// $(LWLIBSRCDIR)\//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 s/\.\.\/etc\//${srcdir}\/${etcdir}/g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 s/ \/[^ ]*\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 s/ \/[^ ]*gray//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 s/ [a-z][^ ]*\/[^ ]*\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 s/ lisp\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 s/ lisp-union\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 s/ lisp-disunion\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 s/ lrecord\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 s/ emacsfns\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 s/ symeval\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 s/ symsinit\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 s/ syssignal\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 s/ intl\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 s/ tt_c\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 s/ descrip\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 /^unex/d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 /^sgiplay/d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 /^Extern/d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 /^extw/d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 /^[^ ]*\.o:$/d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 ' | awk '
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 { for (i = 2; i <= NF; i++)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 printf ("%s %s\n", $1, $i)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ' | sort | uniq