Show
Ignore:
Timestamp:
01/19/03 20:34:18 (6 years ago)
Author:
miyoshi
Message:

Support Cygwin perl with new option `-cc'.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • work/cvs2svn/nt/makedepend.pl

    r2539 r2952  
    2727$makedepend_start = "### automatically generated dependency start\n"; 
    2828$makedepend_end = "### automatically generated dependency end\n"; 
    29 $usage = "makedepend.pl (-f|-F) OUTPUTFILE [-E] [-D] [-DO] [-ra] [[-rm REMOVE-RULE]  [-ag AGREEMENT-RULE] [-rp REPLACE-RULE] ...] TARGETS..."; 
     29$usage = "makedepend.pl (-f|-F) OUTPUTFILE [-E] [-D] [-DO] [-ra] [[-rm REMOVE-RULE]  [-ag AGREEMENT-RULE] [-rp REPLACE-RULE] ...] [-cc COMPILER (msvc or gcc)] TARGETS..."; 
    3030$remove_absolute_path = 0; 
    3131$generate_from_preprocess = 0; 
     
    3333$file_output_dos = 0; 
    3434$output_replace = 1; 
     35$interpret_pattern = '^\#line[ \t]*(\d+)[ \t]+(\"[^\"]+\")$'; 
    3536 
    3637sub create_dep_gcc { 
     
    7172    open(DEPFILE, $file); 
    7273    while(<DEPFILE>) { 
     74        s/\r\n$/\n/; 
    7375        chop; 
    74         if (/^\#line[ \t]+(\d+)[ \t]+(.+)$/) { 
     76        if (/$interpret_pattern/) { 
    7577            $line = $1; 
    7678            $srcfile = $2; 
    7779 
    78             if ($srcfile =~ /\"[^\"]+\"$/) { 
    79                 eval '$srcfile = '.$srcfile; 
    80             } 
    81  
    82             if ($filetype_dos) { 
    83                 $srcfile =~ tr!\\!/!; 
    84             } 
    85  
    86             @list = grep(($srcfile eq $_), @out); 
    87             if (!($#list >= 0) 
    88                 && ($srcfile =~ /[^ \t]/)) { 
    89                 push(@out, $srcfile); 
     80            if ($srcfile !~ /^\"<(built-in|command line)>\"$/) { 
     81 
     82                if ($srcfile =~ /\"[^\"]+\"$/) { 
     83                    eval '$srcfile = '.$srcfile; 
     84                } 
     85 
     86                if ($filetype_dos) { 
     87                    $srcfile =~ tr!\\!/!; 
     88                } 
     89 
     90                @list = grep(($srcfile eq $_), @out); 
     91                if (!($#list >= 0) 
     92                    && ($srcfile =~ /[^ \t]/)) { 
     93                    push(@out, $srcfile); 
     94                } 
    9095            } 
    9196        } 
     
    142147        open(INPUTFILE, $file); 
    143148        while(<INPUTFILE>) { 
     149            s/\r\n$/\n/; 
    144150            if ($_ eq $makedepend_start) { 
    145151                $output =  $output.$_.$createdep; 
     
    191197    }elsif ($ARGV[$i] eq "-ra") { 
    192198        $remove_absolute_path = 1; 
     199    }elsif ($ARGV[$i] eq "-cc") { 
     200        if ($ARGV[++$i] eq "gcc") { 
     201            $interpret_pattern = '^\#[ \t]+(\d+)[ \t]+(\"[^\"]+\") 1$'; 
     202        } else { 
     203            $interpret_pattern = '^\#line[ \t]*(\d+)[ \t]+(\"[^\"]+\")$'; 
     204        } 
    193205    }else{ 
    194206        push(@depfiles, $ARGV[$i]);