1 ## Process the output of makedepend.
2 ## Copyright (c) 1994 Amdahl Corporation.
3 ## Written by Ben Wing, December 1994.
5 ## This file is used as part of 'make depend', to produce the
6 ## dependency list for src/Makefile.in.in.
8 ## Unfortunately, makedepend (at least the one that comes as part
9 ## of Open Windows under Solaris) is stupid and doesn't follow the
10 ## documented behavior. So we have to force the definitions of
11 ## certain options through -D flags (even though it's supposed to
12 ## pick this up), and post-process the output to get rid of stuff
15 ## The sed stage gets rid of include files in other directories,
16 ## except for lwlib.h (makedepend puts system include files in,
17 ## which is pretty stupid). We also get rid of some standard
18 ## include files that are in every or pretty much every file
19 ## and where changes in those files don't usually merit
20 ## recompilation of everything. Finally, we eliminate entirely
21 ## the dependencies for some files (such as unex*.c) that get
22 ## screwed up by makedepend. We just put those in by hand at
23 ## the top of the dependency list.
25 ## For Mule, we need to do some additional processing: conversion
26 ## to MULESRCDIR (at least so that the include files don't get
27 ## wiped out by the next stage) and removing the mule/ prefix
28 ## from the object file names.
30 ## The awk stage puts one dependency per line. Then we pass
31 ## the result through sort and uniq (makedepend is supposed
32 ## to not put in duplicate dependencies, but it does so
35 ## After running 'make depend', verify that the output (in
36 ## depend.out) is reasonable and then replace the stuff in
37 ## Makefile.in.in marked "generated by 'make depend'".
41 s/ \/[^ ]*\/lwlib\// $(LWLIBSRCDIR)\//g
42 s/\.\.\/etc\//${srcdir}\/${etcdir}/g
44 s/ mule\// $(MULESRCDIR)\/mule\//g
47 s/ [a-z][^ ]*\/[^ ]*\.h//g
50 s/ lisp-disunion\.h//g
65 { for (i = 2; i <= NF; i++)
66 printf ("%s %s\n", $1, $i)