annotate lib-src/process-depends.sh @ 229:434959a2fba3 r20-5b13

Import from CVS: tag r20-5b13
author cvs
date Mon, 13 Aug 2007 10:13:02 +0200
parents 131b0175ea99
children
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
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 0
diff changeset
25 ## For Mule, we need to do some additional processing: conversion
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 0
diff changeset
26 ## to MULESRCDIR (at least so that the include files don't get
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 0
diff changeset
27 ## wiped out by the next stage) and removing the mule/ prefix
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 0
diff changeset
28 ## from the object file names.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 0
diff changeset
29
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ## The awk stage puts one dependency per line. Then we pass
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ## the result through sort and uniq (makedepend is supposed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ## to not put in duplicate dependencies, but it does so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ## occasionally).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ## After running 'make depend', verify that the output (in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ## depend.out) is reasonable and then replace the stuff in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ## Makefile.in.in marked "generated by 'make depend'".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 sed -e '
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 1d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 s/ \/[^ ]*\/lwlib\// $(LWLIBSRCDIR)\//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 s/\.\.\/etc\//${srcdir}\/${etcdir}/g
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 0
diff changeset
43 s/^mule\///g
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 0
diff changeset
44 s/ mule\// $(MULESRCDIR)\/mule\//g
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 s/ \/[^ ]*\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 s/ \/[^ ]*gray//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 s/ [a-z][^ ]*\/[^ ]*\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 s/ lisp\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 s/ lisp-union\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 s/ lisp-disunion\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 s/ lrecord\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 s/ emacsfns\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 s/ symeval\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 s/ symsinit\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 s/ syssignal\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 s/ intl\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 s/ tt_c\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 s/ descrip\.h//g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 /^unex/d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 /^sgiplay/d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 /^Extern/d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 /^extw/d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 /^[^ ]*\.o:$/d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 ' | awk '
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 { for (i = 2; i <= NF; i++)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 printf ("%s %s\n", $1, $i)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 ' | sort | uniq