Skip to content

Commit

Permalink
Merge pull request DOCGroup#184 from DOCGroup/random-minor-changes
Browse files Browse the repository at this point in the history
Random minor changes
  • Loading branch information
ocielliottc authored Apr 26, 2023
2 parents 516e0a2 + 62c4492 commit 4cbc59f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
22 changes: 14 additions & 8 deletions create_base.pl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# Data Section
# ******************************************************************

my $version = '0.1';
my $version = '0.2';

# ******************************************************************
# Subroutine Section
Expand All @@ -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 = $_;
Expand Down Expand Up @@ -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.
Expand All @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down
1 change: 1 addition & 0 deletions modules/CommandHelper.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion modules/MakeWorkspaceCreator.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down
2 changes: 1 addition & 1 deletion modules/ProjectCreator.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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", ],
);
Expand Down

0 comments on commit 4cbc59f

Please sign in to comment.