summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorocielliottc <elliottc@objectcomputing.com>2023-04-26 10:35:51 -0500
committerGitHub <noreply@github.com>2023-04-26 10:35:51 -0500
commit4cbc59f2e70ceb74c9dec65b57b02b1c2397f961 (patch)
treef45a8cdc36c703a9c41d2730e3a2801079c1a053
parent516e0a2bdb9ec407b220f84e5df6cfe933d29f02 (diff)
parent62c44927b0616a85e9b5afed5975678d97343c18 (diff)
downloadMPC-master.tar.gz
Merge pull request #184 from DOCGroup/random-minor-changesHEADmaster
Random minor changes
-rwxr-xr-xcreate_base.pl22
-rw-r--r--modules/CommandHelper.pm1
-rw-r--r--modules/MakeWorkspaceCreator.pm2
-rw-r--r--modules/ProjectCreator.pm2
4 files changed, 17 insertions, 10 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), " <mpc files> <output file or ",
"directory>\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", ],
);