diff --git a/create_base.pl b/create_base.pl index a87c0199..8e18703b 100755 --- a/create_base.pl +++ b/create_base.pl @@ -32,7 +32,7 @@ # Data Section # ****************************************************************** -my $version = '0.1'; +my $version = '0.2'; # ****************************************************************** # Subroutine Section @@ -45,6 +45,8 @@ sub gather_info { if (open($fh, $name)) { my @lines = (); my $pname = undef; + my $pline = undef; + while(<$fh>) { ## Get the line a remove leading and trailing white space my $line = $_; @@ -81,6 +83,7 @@ sub gather_info { ## us. $pname = Creator::fill_type_name(undef, $pname, $def); push(@lines, "project$parents {"); + $pline = $def; } elsif ($line =~ /^(shared|static)name\s*=\s*(.+)$/) { ## Add in the libs and after settings. @@ -95,10 +98,15 @@ sub gather_info { } close($fh); - ## Only return the lines if there is more than one line. It is - ## possible (and likely) that we've read in the project declaration, - ## but the project did not contain a sharedname or staticname - ## setting. + ## If we have the unmodified project name, but the user did not provide + ## a sharedname or staticname, we will use that as the library name. + if (defined $pline && $#lines == 0) { + push(@lines, " libs += $pline", + " after += $pname", + "}"); + } + + ## Only return the lines if there is more than one line. return @lines if ($#lines > 0); } @@ -148,9 +156,7 @@ sub usageAndExit { print STDERR "Create Base Project v$version\n", "Usage: ", basename($0), " \n\nThis script will create a base project ", - "based on the contents of the\nsupplied MPC file. ", - "This is only useful if the project ", - "explicitly sets\nsharedname or staticname.\n"; + "based on the contents of the\nsupplied MPC file.\n"; exit(0); } diff --git a/modules/CommandHelper.pm b/modules/CommandHelper.pm index 2437edfc..98053a08 100644 --- a/modules/CommandHelper.pm +++ b/modules/CommandHelper.pm @@ -51,6 +51,7 @@ sub get { ## create a singleton of that type and return it. foreach my $inc (@INC) { if (-r "$inc/$type.pm") { + OutputMessage::debug(undef, "Found $type.pm in $inc"); require "$type.pm"; $required{$type} = $type->new(); return $required{$type}; diff --git a/modules/MakeWorkspaceCreator.pm b/modules/MakeWorkspaceCreator.pm index d8abd0f1..dc627f5f 100644 --- a/modules/MakeWorkspaceCreator.pm +++ b/modules/MakeWorkspaceCreator.pm @@ -38,7 +38,7 @@ sub write_project_targets { my $chdir = ($dname ne '.'); print $fh "\t\@", ($chdir ? "cd $dname && " : ''), - "\$(MAKE) -f ", + '"$(MAKE)" -f ', ($chdir ? $self->mpc_basename($project) : $project), " $target$crlf"; } diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm index ea32c143..0ee9d27d 100644 --- a/modules/ProjectCreator.pm +++ b/modules/ProjectCreator.pm @@ -194,7 +194,7 @@ my $cppresource = 'resource_files'; my %cppvc = ('source_files' => [ "\\.cpp", "\\.cxx", "\\.cc", "\\.c", "\\.C", ], 'template_files' => [ "_T\\.cpp", "_T\\.cxx", "_T\\.cc", "_T\\.c", "_T\\.C", "_t\\.cpp", "_t\\.cxx", "_t\\.cc", "_t\\.c", "_t\\.C", "\\.tpp" ], 'header_files' => [ "\\.h", "\\.hpp", "\\.hxx", "\\.hh", ], - 'inline_files' => [ "\\.i", "\\.ipp", "\\.inl", ], + 'inline_files' => [ "\\.i", "\\.ipp", "\\.ixx", "\\.inl", ], 'documentation_files' => [ "README", "readme", "\\.doc", "\\.txt", "\\.html" ], $cppresource => [ "\\.rc", ], );