From 3266b8874638d5d871643fe92e2d9e6efd830a87 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Sat, 3 Mar 2001 00:17:11 +0000 Subject: [PATCH] Add files found in an 'include' directory, to the 'misc sources' list. --- tools/winemaker | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/tools/winemaker b/tools/winemaker index 1053477fc23..71c6c1c335c 100755 --- a/tools/winemaker +++ b/tools/winemaker @@ -441,6 +441,9 @@ sub source_scan_directory # the name of this directory, including a trailing '/', or an empty # string if this is the top level directory my $dirname=$_[2]; + # if set then no targets will be looked for and the sources will all + # end up in the parent_project's 'misc' bucket + my $no_target=$_[3]; # reference to the project for this directory. May not be used my $project; @@ -493,11 +496,12 @@ sub source_scan_directory } elsif ($dentry =~ /^include/i) { # This directory must contain headers we're going to need push @{@$project_settings[$T_INCLUDE_PATH]},"-I$dentry"; + source_scan_directory($project,"$fullentry/","$dentry/",1); } else { # Recursively scan this directory. Any source file that cannot be - # attributed to a project in one of the subdirectories will be attributed - # to this project. - source_scan_directory($project,"$fullentry/","$dentry/"); + # attributed to a project in one of the subdirectories will be + # attributed to this project. + source_scan_directory($project,"$fullentry/","$dentry/",$no_target); } } elsif (-f "$fullentry") { if ($dentry =~ s/\.exe$//i) { @@ -544,6 +548,14 @@ sub source_scan_directory push @{@$target[$T_SOURCES_MISC]},map "$path$_",@sources_misc; return; } + if ($no_target) { + my $parent_settings=@$parent_project[$P_SETTINGS]; + push @{@$parent_settings[$T_SOURCES_MISC]},map "$dirname$_",@sources_c; + push @{@$parent_settings[$T_SOURCES_MISC]},map "$dirname$_",@sources_cxx; + push @{@$parent_settings[$T_SOURCES_MISC]},map "$dirname$_",@sources_rc; + push @{@$parent_settings[$T_SOURCES_MISC]},map "$dirname$_",@sources_misc; + return; + } my $source_count=@sources_c+@sources_cxx+@sources_rc+ @{@$project_settings[$T_SOURCES_C]}+ @@ -552,7 +564,7 @@ sub source_scan_directory if ($source_count == 0) { # A project without real sources is not a project, get out! if ($project!=$parent_project) { - $parent_settings=@$parent_project[$P_SETTINGS]; + my $parent_settings=@$parent_project[$P_SETTINGS]; push @{@$parent_settings[$T_SOURCES_MISC]},map "$dirname$_",@sources_misc; push @{@$parent_settings[$T_SOURCES_MISC]},map "$dirname$_",@{@$project_settings[$T_SOURCES_MISC]}; } @@ -900,7 +912,7 @@ sub source_scan # Now scan the directory tree looking for source files and, maybe, targets print "Scanning the source directories...\n"; - source_scan_directory(\@main_project,"",""); + source_scan_directory(\@main_project,"","",0); @projects=sort { @$a[$P_PATH] cmp @$b[$P_PATH] } @projects; } -- 2.11.4.GIT