From 2df8d6501eb4bb6f977929585dc6da2f898f9099 Mon Sep 17 00:00:00 2001 From: Chad Elliott Date: Wed, 26 Apr 2023 08:24:11 -0500 Subject: Support projects without explicit sharedname or staticname settings. --- create_base.pl | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) 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 @@ require Creator; # 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); } -- cgit v1.2.1 From 1a9aa5e55a091fd42ad4d72c99e33828b322b8ab Mon Sep 17 00:00:00 2001 From: Chad Elliott Date: Wed, 26 Apr 2023 08:24:33 -0500 Subject: Added a deug message for finding command helpers. --- modules/CommandHelper.pm | 1 + 1 file changed, 1 insertion(+) 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}; -- cgit v1.2.1 From 5f017a0a36c1b98557d39a68689f20c7909c668e Mon Sep 17 00:00:00 2001 From: Chad Elliott Date: Wed, 26 Apr 2023 08:24:57 -0500 Subject: Support running make from a path with spaces in it. --- modules/MakeWorkspaceCreator.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"; } -- cgit v1.2.1 From 62c44927b0616a85e9b5afed5975678d97343c18 Mon Sep 17 00:00:00 2001 From: Chad Elliott Date: Wed, 26 Apr 2023 08:25:25 -0500 Subject: Support .ixx as an inline file extension. --- modules/ProjectCreator.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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", ], ); -- cgit v1.2.1