ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/DependencyMangler
Revision: 1.7
Committed: Fri Dec 10 13:57:46 2004 UTC (20 years, 5 months ago) by sashby
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +0 -0 lines
State: FILE REMOVED
Error occurred while calculating annotation data.
Log Message:
*** empty log message ***

File Contents

# Content
1 #
2 # Take a standard dependency file (output from a makedepend)
3 # Add additional targets to reflect mangled names of objects
4 #
5
6 @manglenames=qw(_d _o _pic _picd _PIC _Insure);
7
8 # Input file is called "dependencies.mk":
9 open ( INFILE, "<$ARGV[0]" );
10 open (OUTFILE, ">$ARGV[0]_tmp");
11
12 # Stuff from LAT. Need to include this somewhere, somehow......
13 #
14 # Rewrite dependencies to avoid the ``deleted header file'' problem:
15 # when a file mentioned in the *.d files is removed, make will die
16 # because of the dependency (normally there is no way to rebuild
17 # headers). This macro adds a dummy dependency for each header
18 # file to keep make happy.
19 # .frags/dep: $(__dep_files)
20 # @cat $^ /dev/null > $@.1; \
21 # tr ' ' '\012' < $@.1 | sed -e 's/^'\\\\'$$//' -e '/^$$/ d' \
22 # -e '/:$$/ d' -e 's/$$/ :/' > $@.2; \
23 # cat $@.1 $@.2 > $@; \
24 # rm -f $@.1 $@.2
25 #
26
27 while ( <INFILE> ) {
28 chomp;
29 $orig=$_;
30 if ( $_=~/.*\.o *:/ ) {
31 ($file=$_)=~s/(.*)\.o *:.*/\1/;
32 $out="";
33 foreach $mang ( @manglenames ) {
34 $out=$out." ".$file.$mang.".o";
35 }
36 $out=~s/^ //;
37 $orig=$out." ".$orig;
38 }
39 print OUTFILE $orig."\n";
40 }
41 close INFILE;
42 close OUTFILE;
43 use File::Copy;
44 copy "$ARGV[0]_tmp", "$ARGV[0]";