library dependencies are lost

Fixed the problem where library dependencies for header and source files are
saved to the same file and half are lost.  Did this by not removing the
suffix when creating the library dependency file name.

refs #128
This commit is contained in:
Alex Lin 2015-09-24 09:25:16 -05:00
parent cab267c6c4
commit f5b30a4841
2 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@ sub read_lib_deps($@) {
next if ( $l =~ /^-|\.a$/ ) ;
$non_lib_processed_files{$l} = 1 ;
my ( $file, $dir, $suffix) = fileparse($l, qr/\.[^.]*/) ;
my ($lib_dep_file_name) = "build$dir${file}.lib_deps" ;
my ($lib_dep_file_name) = "build$dir${file}.${suffix}.lib_deps" ;
if ( -e $lib_dep_file_name ) {
open FH, "$lib_dep_file_name" or die 'cannot open $lib_dep_file_name' ;
my (@all_lines) = <FH> ;

View File

@ -82,8 +82,8 @@ sub get_lib_deps ($$) {
foreach my $inc ( $file_path_dir , @inc_paths) {
foreach my $ext ( "cpp" , "cc" , "c" , "c++" , "cxx" , "C" ) {
if ( -e "$inc/$rel_dir/$base$ext" ) {
#print "found $inc/$l$ext\n" ;
my $f = abs_path("$inc/$rel_dir") . "/$base$ext" ;
#print "found $f\n" ;
if ( ! exists $resolved_files{$f} ) {
$resolved_files{$f} = 1 ;
push @ordered_resolved_files , $f ;
@ -92,8 +92,8 @@ sub get_lib_deps ($$) {
last ;
}
elsif ( -e "$inc/$rel_dir/src/$base$ext" ) {
#print "found $inc/src/$l$ext\n" ;
my $f = abs_path("$inc/$rel_dir/src") . "/$base$ext" ;
#print "found $f\n" ;
if ( ! exists $resolved_files{$f} ) {
$resolved_files{$f} = 1 ;
push @ordered_resolved_files , $f ;
@ -136,7 +136,7 @@ sub write_lib_deps($) {
# Build the library dependencies file name to store results
my ( $file, $dir, $suffix) = fileparse($source_file_name, qr/\.[^.]*/) ;
my ($lib_dep_file_name) = "build$dir${file}.lib_deps" ;
my ($lib_dep_file_name) = "build$dir${file}.${suffix}.lib_deps" ;
if ( ! -e "build$dir" ) {
make_path("build$dir") ;
}