ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/DependencyMangler
Revision: 1.6
Committed: Tue Dec 11 10:05:04 2001 UTC (23 years, 5 months ago) by sashby
Branch: MAIN
CVS Tags: V0_19_7, V0_19_6, V0_19_6p1, V0_19_5, SFATEST, V0_19_4, V0_19_4_pre3, V0_19_4_pre2, V0_19_4_pre1, V0_19_3, V0_19_2, V0_19_1
Branch point for: SCRAM_V1_BRANCH, V0_19_4_B
Changes since 1.5: +18 -0 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 williamc 1.1 #
2     # Take a standard dependency file (output from a makedepend)
3     # Add additional targets to reflect mangled names of objects
4     #
5    
6 williamc 1.5 @manglenames=qw(_d _o _pic _picd _PIC _Insure);
7 sashby 1.6
8     # Input file is called "dependencies.mk":
9 williamc 1.1 open ( INFILE, "<$ARGV[0]" );
10 williamc 1.4 open (OUTFILE, ">$ARGV[0]_tmp");
11 sashby 1.6
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 williamc 1.1 while ( <INFILE> ) {
28 williamc 1.5 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 williamc 1.1 }
39 williamc 1.5 print OUTFILE $orig."\n";
40 williamc 1.1 }
41     close INFILE;
42 williamc 1.2 close OUTFILE;
43     use File::Copy;
44     copy "$ARGV[0]_tmp", "$ARGV[0]";