From f5b30a484169446a03cb8b8ca35135a24d0a4463 Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Thu, 24 Sep 2015 09:25:16 -0500 Subject: [PATCH] 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 --- libexec/trick/make_makefile_src | 2 +- libexec/trick/pm/get_lib_deps.pm | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libexec/trick/make_makefile_src b/libexec/trick/make_makefile_src index b856c544..886fedc1 100755 --- a/libexec/trick/make_makefile_src +++ b/libexec/trick/make_makefile_src @@ -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) = ; diff --git a/libexec/trick/pm/get_lib_deps.pm b/libexec/trick/pm/get_lib_deps.pm index b8f44af1..1a2441f4 100644 --- a/libexec/trick/pm/get_lib_deps.pm +++ b/libexec/trick/pm/get_lib_deps.pm @@ -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") ; }