
 This awk script creates make style dependency relationships given
 a source file name and the corresponding file it depends upon.
 For example, given:
	file.c:include <stdio.h>
	file.c:include foo.h
 the output would be:
	file.obj:$(CDIR)stdio.h foo.h

 Analgous output is generated for PLM files.


 The field separator between the file names is a colon.

BEGIN {FS = :}

 Store the current source file so that we only print it once.
{currname = $1}

 If this is the first time we see this file name, initialize variables.

newname = currname {newname = currname; new = 0; printf(\n\n)}
 
 Print the object file name which corresponds to the current source file.
 Print this just once for each source file.

new == 0 {newname = $1; getline temp < [scr]<$>AwkObject.fls
		printf(s:,temp); new = 1}

 PLM F0 EDF files
	Remove parentheses

:[Ff]0: {printf($(F0DIR)); gsub(\),,$NF) }

 PLM F1 EDF files
	Remove parentheses

:[Ff]1: {printf($(F1DIR)); gsub(\),,$NF) }

 PLM Local EDF files
	Remove parentheses

\$[Ii][Nn][Cc][Ll][Uu][Dd][Ee]\( {gsub(\(, ,$NF);gsub(\),,$NF) }

 C System Header files
	Remove angle brackets

include[\t ]< {printf($(CDIR));gsub(<,,$NF);gsub(>,,$NF) }

 C Local Header files
	Remove double quotes

include[\t ]\ {gsub(\,,$NF) }

 PLM and C Comments
	Remove comments

{ gsub([ \t]*\\*.*\*\[ \t]*, , $NF) }

 Print include file name.  There may be some junk still attached so
 we will run the output to Sed for a final cleanup.
 
newname == currname {printf(s ,$NF)}
END {printf(\n\n)}
