summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2005-08-11 11:42:48 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2005-08-11 11:42:48 +0000
commitdf43c1fcf61898c1c5a892078dee3ca77f62d626 (patch)
tree09d36e18229795f68585856e82a20caa12706146
parent264cec35829b392dd156666153b7814efc217440 (diff)
downloadMPC-df43c1fcf61898c1c5a892078dee3ca77f62d626.tar.gz
ChangeLogTag: Thu Aug 11 06:42:33 2005 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--ChangeLog48
-rw-r--r--README54
-rw-r--r--USAGE9
-rwxr-xr-xclone_build_tree.pl65
-rwxr-xr-xcombine_dsw.pl4
-rw-r--r--modules/AutomakeWorkspaceCreator.pm13
-rw-r--r--modules/Creator.pm75
-rw-r--r--modules/Driver.pm14
-rw-r--r--modules/Options.pm7
-rw-r--r--modules/ProjectCreator.pm4
-rw-r--r--modules/WorkspaceCreator.pm7
-rw-r--r--modules/WorkspaceHelper.pm12
-rw-r--r--templates/automake.mpd4
13 files changed, 201 insertions, 115 deletions
diff --git a/ChangeLog b/ChangeLog
index 0c7bb8ab..425e1bc7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,51 @@
+Thu Aug 11 06:42:33 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * README:
+
+ Updated the Defaulting Behavior section.
+
+ * USAGE:
+ * modules/Options.pm:
+
+ Fixed poorly worded portions of the usage.
+
+ * clone_build_tree.pl:
+
+ Added an option to link build related files (Makefile, .dsw,
+ .etc).
+
+ * combine_dsw.pl:
+
+ Fixed a spelling error.
+
+ * modules/AutomakeWorkspaceCreator.pm:
+
+ Added calls for modifying the library path with the
+ WorkspaceHelper.
+
+ * modules/Creator.pm:
+
+ Fixed a bug where using * in the 'after' setting wouldn't always
+ be expanded.
+
+ * modules/Driver.pm:
+
+ The minimum version of perl needs to be 5.6 since
+ File::Spec::canonpath is used in Options.pm.
+
+ * modules/ProjectCreator.pm:
+ * modules/WorkspaceCreator.pm:
+
+ Only call fill_type_name if the name has a * in it.
+
+ * modules/WorkspaceHelper.pm:
+
+ Added the hooks for modifying the library path.
+
+ * templates/automake.mpd:
+
+ Cosmetic change for spacing.
+
Mon Jul 18 10:26:15 2005 Chad Elliott <elliott_c@ociweb.com>
* modules/ProjectCreator.pm:
diff --git a/README b/README
index 0607da2c..4418938c 100644
--- a/README
+++ b/README
@@ -3,25 +3,23 @@ Designed by Justin Michel (michel_j@ociweb.com) and Chad Elliott.
Implemented by Chad Elliott (elliott_c@ociweb.com).
A single tool (MPC) can be used to generate tool specific input (i.e.
-Makefile, dsp, vcproj, etc). The generator takes platform and
-building tool generic files (mpc files) as input which describe basic
-information needed to generate a "project" file for various build
-tools. These tools include Make, NMake, Visual C++ 6, Visual C++ 7,
-etc.
-
-One of the many unique and useful features of the Makefile, Project
-and Workspace Creator is that the project definition files can employ
-the idea of inheritance. This feature allows a user to set up a basic
-base project (mpb file) that can contain information that is
-applicable to all sub-projects. Things such as include paths, library
-paths and inter-project dependencies could be described in this base
-project and any project that inherits from it would contain this
-information as well.
-
-Another set of files, known as template input files (mpd files),
-provides the generator with the necessary information to fill platform
-and build tool specific information for dynamic and static library and
-binary executable projects.
+Makefile, dsp, vcproj, etc). The generator takes platform and building
+tool generic files (mpc files) as input which describe basic information
+needed to generate a "project" file for various build tools. These tools
+include Make, NMake, Visual C++ 6, Visual C++ 7, etc.
+
+One of the many unique and useful features of the Makefile, Project and
+Workspace Creator is that the project definition files can employ the idea
+of inheritance. This feature allows a user to set up a basic base project
+(mpb file) that can contain information that is applicable to all
+sub-projects. Things such as include paths, library paths and inter-project
+dependencies could be described in this base project and any project that
+inherits from it would contain this information as well.
+
+Another set of files, known as template input files (mpd files), provides
+the generator with the necessary information to fill platform and build tool
+specific information for dynamic and static library and binary executable
+projects.
Together, the generic input files and the template input files are applied
toward a platform and build specific template (mpd file) to create the final
@@ -709,17 +707,18 @@ Defaulting Behavior
all of the files in the directory will be added to the corresponding list
by extension
-3) If custom files (ex. idl files) exist in the directory and
- the custom files components (ex. IDL_Files) are left defaulted (i.e. not
- listed) or the custom files components are specified and none of the
- custom generated files are listed in the corresponding lists
+3) If the custom type is automatic and custom files (ex. idl files) exist in
+ the directory and the custom files components (ex. IDL_Files) are left
+ defaulted (i.e. not listed) or the custom files components are specified
+ and none of the custom generated files are listed in the corresponding
+ lists
the custom files are added to the custom files component list if they
weren't specified and all of the (would be) generated files will be added
to the front of the corresponding lists (source, inline and header lists)
-4) If files are listed in the Source_Files list and
- a corresponding header or inline file exists
+4) If files are listed in the Source_Files list and a corresponding header or
+ inline file exists
the corresponding file will be added to the corresponding list (if it
isn't already there)
@@ -731,8 +730,9 @@ Defaulting Behavior
6) If exename is specified then the project target is considered an
executable. If neither exename, sharedname or staticname are used and
- any of the source files listed contains a "main", then the project target
- is considered an executable, otherwise it is considered a library.
+ any of the source files listed contains a language dependent "main", then
+ the project target is considered an executable, otherwise it is considered
+ a library.
7) If pch_header is not specified and a header file matches *_pch.h
diff --git a/USAGE b/USAGE
index 20cfefbe..5f679bcd 100644
--- a/USAGE
+++ b/USAGE
@@ -60,14 +60,13 @@ Usage: mwc.pl [-global <file>] [-include <directory>] [-recurse]
are still process, but no top level file is created.
-recurse Recurse from the current directory and generate from
all found input files.
- -relative Any $() variable in an mpc that is matched to NAME
+ -relative Any $() variable in an mpc file that is matched to NAME
is replaced by VAR only if VAR can be made into a
relative path based on the current working directory.
-static Specifies that only static projects will be generated.
- By default, only dynamic projects will be generated.
+ By default, only dynamic projects are generated.
-ti Specifies the template input file (with no extension)
- for the specific type as shown above
- (ex. -ti dll_exe:vc8exe)
+ for the specific type (ex. -ti dll_exe:vc8exe).
-template Specifies the template name (with no extension).
-type Specifies the type of project file to generate. This
option can be used multiple times to generate multiple
@@ -179,6 +178,7 @@ specified by this option overwrite values from features files.
Example:
mwc.pl -features "qos=1,ssl=0" ace.mwc
+
Running only the Project Generator
----------------------------------
@@ -187,6 +187,7 @@ Generator except that it only generates projects. If an input file (.mpc
file) is not provided, the project creator will attempt to create a default
project in the directory from which the script was started.
+
Environment Variables
---------------------
diff --git a/clone_build_tree.pl b/clone_build_tree.pl
index fc6b7e98..032c0a89 100755
--- a/clone_build_tree.pl
+++ b/clone_build_tree.pl
@@ -34,6 +34,7 @@ use File::Basename;
my($exclude) = undef;
my($verbose) = 0;
+my($lbuildf) = 0;
my(@foundFiles) = ();
my($version) = '$Id$';
$version =~ s/.*\s+(\d+[\.\d]+)\s+.*/$1/;
@@ -72,38 +73,40 @@ sub findCallback {
! /^.*~\z/s &&
! /^\.\z/s &&
! /^\.#.*\z/s &&
+ ! /^.*\.ncb\z/s &&
+ ! /^.*\.opt\z/s &&
+ ! /^.*\.bak\z/s &&
+ ! /^.*\.ilk\z/s &&
+ ! /^.*\.pdb\z/s &&
! /^.*\.log\z/s
);
if ($matches) {
- $matches = (! /^.*\.dsp\z/s &&
- ! /^.*\.dsw\z/s &&
- ! /^.*\.vcproj\z/s &&
- ! /^.*\.sln\z/s &&
- ! /^Makefile.*\z/s &&
- ! /^GNUmakefile.*\z/s &&
- ! /^.*\.am\z/s &&
- ! /^\.depend\..*\z/s &&
- ! /^.*\.vcn\z/s &&
- ! /^.*\.vcp\z/s &&
- ! /^.*\.vcw\z/s &&
- ! /^.*\.vpj\z/s &&
- ! /^.*\.vpw\z/s &&
- ! /^.*\.cbx\z/s &&
- ! /^.*\.bpgr\z/s &&
- ! /^.*\.bmak\z/s &&
- ! /^.*\.bmake\z/s &&
- ! /^.*\.mak\z/s &&
- ! /^.*\.nmake\z/s &&
- ! /^.*\.bld\z/s &&
- ! /^.*\.icc\z/s &&
- ! /^.*\.icp\z/s &&
- ! /^.*\.ncb\z/s &&
- ! /^.*\.opt\z/s &&
- ! /^.*\.bak\z/s &&
- ! /^.*\.ilk\z/s &&
- ! /^.*\.pdb\z/s
- );
+ if (!$lbuildf) {
+ $matches = (! /^.*\.dsp\z/s &&
+ ! /^.*\.dsw\z/s &&
+ ! /^.*\.vcproj\z/s &&
+ ! /^.*\.sln\z/s &&
+ ! /^Makefile.*\z/s &&
+ ! /^GNUmakefile.*\z/s &&
+ ! /^.*\.am\z/s &&
+ ! /^\.depend\..*\z/s &&
+ ! /^.*\.vcn\z/s &&
+ ! /^.*\.vcp\z/s &&
+ ! /^.*\.vcw\z/s &&
+ ! /^.*\.vpj\z/s &&
+ ! /^.*\.vpw\z/s &&
+ ! /^.*\.cbx\z/s &&
+ ! /^.*\.bpgr\z/s &&
+ ! /^.*\.bmak\z/s &&
+ ! /^.*\.bmake\z/s &&
+ ! /^.*\.mak\z/s &&
+ ! /^.*\.nmake\z/s &&
+ ! /^.*\.bld\z/s &&
+ ! /^.*\.icc\z/s &&
+ ! /^.*\.icp\z/s
+ );
+ }
if ($matches) {
## Remove the beginning dot slash as we save the file
@@ -411,7 +414,7 @@ sub usageAndExit {
"Create a tree identical in layout to the current directory\n",
"with the use of ", ($hasSymlink ? "symbolic links or " : ''),
"hard links.\n\n",
- "Usage: $base [-b <builddir>] [-d <dmode>] ",
+ "Usage: $base [-b <builddir>] [-d <dmode>] [-f] ",
($hasSymlink ? "[-a] [-l] " : ''),
"[-v]\n",
$spc, "[build names...]\n\n",
@@ -421,6 +424,7 @@ sub usageAndExit {
"-b Set the build directory. It defaults to the ",
"<current directory>/build.\n",
"-d Set the directory permissions mode.\n",
+ "-f Link build files (Makefile, .dsw, .sln, .etc).\n",
"-v Enable verbose mode.\n";
exit(0);
@@ -469,6 +473,9 @@ for(my $i = 0; $i <= $#ARGV; ++$i) {
usageAndExit('-d requires an argument');
}
}
+ elsif ($ARGV[$i] eq '-f') {
+ $lbuildf = 1;
+ }
elsif ($ARGV[$i] eq '-l') {
$hardlink = 1;
}
diff --git a/combine_dsw.pl b/combine_dsw.pl
index 0c01af22..a2c78e9a 100755
--- a/combine_dsw.pl
+++ b/combine_dsw.pl
@@ -38,7 +38,7 @@ sub usageAndExit {
" [-u] <output file> <input files...>\n\n",
"-u Each input file will be removed after successful ",
"combination\n\n",
- "Combined multiple dsw's into a single dsw. You can use ",
+ "Combine multiple dsw's into a single dsw. You can use ",
"MPC to generate\n",
"dynamic projects and then generate static projects using ",
"the -static,\n",
@@ -59,7 +59,7 @@ my(@input) = ();
for(my $i = 0; $i <= $#ARGV; $i++) {
my($arg) = $ARGV[$i];
if ($arg =~ /^-/) {
- if ($arg eq "-u") {
+ if ($arg eq '-u') {
$unlink = 1;
}
else {
diff --git a/modules/AutomakeWorkspaceCreator.pm b/modules/AutomakeWorkspaceCreator.pm
index c3915340..5755f7f6 100644
--- a/modules/AutomakeWorkspaceCreator.pm
+++ b/modules/AutomakeWorkspaceCreator.pm
@@ -365,12 +365,18 @@ sub write_comps {
my @libs = /\s+(lib(\w+).la)/gm;
my $libcount = @libs / 2;
for(my $i = 0; $i < $libcount; ++$i) {
- my $libfile = (@libs)[$i*2];
- my $libname = (@libs)[$i*2+1];
+ my $libfile = $libs[$i * 2];
+ my $libname = $libs[$i * 2 + 1];
my $reldir = $$liblocs{$libname};
if ($reldir) {
if ("$start/$reldir" ne $here) {
- s/$libfile/\$(top_builddir)\/$reldir\/$libfile/;
+ my($mod) = $wsHelper->modify_libpath($_, $reldir, $libfile);
+ if (defined $mod) {
+ $_ = $mod;
+ }
+ else {
+ s/$libfile/\$(top_builddir)\/$reldir\/$libfile/;
+ }
}
}
else {
@@ -406,6 +412,7 @@ sub write_comps {
print $fh $crlf,
'ACLOCAL = @ACLOCAL@', $crlf,
'ACLOCAL_AMFLAGS = -I m4', $crlf,
+ 'AUTOMAKE_OPTIONS = foreign', $crlf,
$crlf;
}
diff --git a/modules/Creator.pm b/modules/Creator.pm
index 8b99d0c5..874f6b39 100644
--- a/modules/Creator.pm
+++ b/modules/Creator.pm
@@ -664,44 +664,51 @@ sub process_assignment_sub {
sub fill_type_name {
- my($self) = shift;
- my($name) = shift;
- my($def) = shift;
-
- if ($name =~ /\*/) {
- my($pre) = $def . '_';
- my($mid) = '_' . $def . '_';
- my($post) = '_' . $def;
-
- ## Replace the beginning and end first then the middle
- $name =~ s/^\*/$pre/;
- $name =~ s/\*$/$post/;
- $name =~ s/\*/$mid/g;
-
- ## Remove any trailing underscore or any underscore that is followed
- ## by a space. This value could be a space separated list.
- $name =~ s/_$//;
- $name =~ s/_\s/ /g;
- $name =~ s/\s_/ /g;
-
- ## If any one word is capitalized then capitalize each word
- if ($name =~ /[A-Z][0-9a-z_]+/) {
- ## Do the first word
- if ($name =~ /^([a-z])([^_]+)/) {
- my($first) = uc($1);
- my($rest) = $2;
- $name =~ s/^[a-z][^_]+/$first$rest/;
- }
- ## Do subsequent words
- while($name =~ /(_[a-z])([^_]+)/) {
- my($first) = uc($1);
- my($rest) = $2;
- $name =~ s/_[a-z][^_]+/$first$rest/;
+ my($self) = shift;
+ my($names) = shift;
+ my($def) = shift;
+ my($array) = ($names =~ /\s/ ? $self->create_array($names) : [$names]);
+
+ $names = '';
+ foreach my $name (@$array) {
+ if ($name =~ /\*/) {
+ my($pre) = $def . '_';
+ my($mid) = '_' . $def . '_';
+ my($post) = '_' . $def;
+
+ ## Replace the beginning and end first then the middle
+ $name =~ s/^\*/$pre/;
+ $name =~ s/\*$/$post/;
+ $name =~ s/\*/$mid/g;
+
+ ## Remove any trailing underscore or any underscore that is followed
+ ## by a space. This value could be a space separated list.
+ $name =~ s/_$//;
+ $name =~ s/_\s/ /g;
+ $name =~ s/\s_/ /g;
+
+ ## If any one word is capitalized then capitalize each word
+ if ($name =~ /[A-Z][0-9a-z_]+/) {
+ ## Do the first word
+ if ($name =~ /^([a-z])([^_]+)/) {
+ my($first) = uc($1);
+ my($rest) = $2;
+ $name =~ s/^[a-z][^_]+/$first$rest/;
+ }
+ ## Do subsequent words
+ while($name =~ /(_[a-z])([^_]+)/) {
+ my($first) = uc($1);
+ my($rest) = $2;
+ $name =~ s/_[a-z][^_]+/$first$rest/;
+ }
}
}
+
+ $names .= $name . ' ';
}
+ $names =~ s/\s+$//;
- return $name;
+ return $names;
}
diff --git a/modules/Driver.pm b/modules/Driver.pm
index 4fd05275..47b89bef 100644
--- a/modules/Driver.pm
+++ b/modules/Driver.pm
@@ -27,7 +27,7 @@ use vars qw(@ISA);
my($index) = 0;
my(@progress) = ('|', '/', '-', '\\');
my($cmdenv) = 'MPC_COMMANDLINE';
-my($minperl) = 5.005;
+my($minperl) = 5.006;
# ************************************************************
# Subroutine Section
@@ -125,6 +125,12 @@ sub run {
my($self) = shift;
my(@args) = @_;
+ ## If the minimum version of perl is not met, then it is an error
+ if ($] < $minperl) {
+ $self->error("Perl version $minperl is required.");
+ return 1;
+ }
+
## Dynamically load in each perl module and set up
## the type tags and project creators
my($creators) = $self->{'creators'};
@@ -151,12 +157,6 @@ sub run {
return 0;
}
- ## If the minimum version of perl is not met, then it is an error
- if ($] < $minperl) {
- $self->error("Perl version $minperl is required.");
- return 1;
- }
-
## Set up a hash that we can use to keep track of what
## has been 'required'
my(%loaded) = ();
diff --git a/modules/Options.pm b/modules/Options.pm
index e3af6c90..b70f5de8 100644
--- a/modules/Options.pm
+++ b/modules/Options.pm
@@ -115,14 +115,13 @@ sub printUsage {
" are still process, but no top level file is created.\n" .
" -recurse Recurse from the current directory and generate from\n" .
" all found input files.\n" .
-" -relative Any \$() variable in an mpc that is matched to NAME\n" .
+" -relative Any \$() variable in an mpc file that is matched to NAME\n" .
" is replaced by VAR only if VAR can be made into a\n" .
" relative path based on the current working directory.\n" .
" -static Specifies that only static projects will be generated.\n" .
-" By default, only dynamic projects will be generated.\n" .
+" By default, only dynamic projects are generated.\n" .
" -ti Specifies the template input file (with no extension)\n" .
-" for the specific type as shown above\n" .
-" (ex. -ti dll_exe:vc8exe)\n" .
+" for the specific type (ex. -ti dll_exe:vc8exe).\n" .
" -template Specifies the template name (with no extension).\n" .
" -type Specifies the type of project file to generate. This\n" .
" option can be used multiple times to generate multiple\n" .
diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm
index ddcb7606..99a1bfd9 100644
--- a/modules/ProjectCreator.pm
+++ b/modules/ProjectCreator.pm
@@ -649,9 +649,11 @@ sub parse_line {
$name = $self->transform_file_name($name);
## Replace any *'s with the default name
- $name = $self->fill_type_name(
+ if ($name =~ /\*/) {
+ $name = $self->fill_type_name(
$name,
$self->get_default_project_name());
+ }
$self->set_project_name($name);
}
diff --git a/modules/WorkspaceCreator.pm b/modules/WorkspaceCreator.pm
index 193d8020..394a79fa 100644
--- a/modules/WorkspaceCreator.pm
+++ b/modules/WorkspaceCreator.pm
@@ -215,8 +215,11 @@ sub parse_line {
$name =~ s/\s*\)$//;
## Replace any *'s with the default name
- my($def) = $self->get_default_workspace_name();
- $name = $self->fill_type_name($name, $def);
+ if ($name =~ /\*/) {
+ $name = $self->fill_type_name(
+ $name,
+ $self->get_default_workspace_name());
+ }
$self->{'workspace_name'} = $name;
}
diff --git a/modules/WorkspaceHelper.pm b/modules/WorkspaceHelper.pm
index 416df1bd..451af292 100644
--- a/modules/WorkspaceHelper.pm
+++ b/modules/WorkspaceHelper.pm
@@ -67,7 +67,19 @@ sub modify_value {
}
+sub modify_libpath {
+ #my($self) = shift;
+ #my($str) = shift;
+ #my($reldir) = shift;
+ #my($libname) = shift;
+ return undef;
+}
+
+
sub write_settings {
+ #my($self) = shift;
+ #my($fh) = shift;
+ #my(@locals) = @_;
return 1, undef;
}
diff --git a/templates/automake.mpd b/templates/automake.mpd
index cd124f59..2a272d56 100644
--- a/templates/automake.mpd
+++ b/templates/automake.mpd
@@ -144,14 +144,14 @@ lib<%if(sharedname)%><%normalize(sharedname)%><%else%><%normalize(staticname)%><
<%if(libs || pure_libs || lit_libs)%>
<%normalize(exename)%>_LDADD = \
- <%foreach(libs)%> lib<%lib%>.la<%endfor%><%foreach(lit_libs)%> -l<%lit_lib%><%endfor%><%foreach(pure_libs)%> <%pure_lib%><%endfor%>
+ <%foreach(libs)%> lib<%lib%>.la<%endfor%><%foreach(lit_libs)%> -l<%lit_lib%><%endfor%><%foreach(pure_libs)%> <%pure_lib%><%endfor%>
<%endif%>
<%else%>
<%if(install_this_target)%>
<%if(libs || pure_libs || lit_libs)%>
lib<%if(sharedname)%><%normalize(sharedname)%><%else%><%normalize(staticname)%><%endif%>_la_LIBADD = \
- <%foreach(libs)%> lib<%lib%>.la<%endfor%><%foreach(lit_libs)%> -l<%lit_lib%><%endfor%><%foreach(pure_libs)%> <%pure_lib%><%endfor%>
+ <%foreach(libs)%> lib<%lib%>.la<%endfor%><%foreach(lit_libs)%> -l<%lit_lib%><%endfor%><%foreach(pure_libs)%> <%pure_lib%><%endfor%>
<%endif%>
<%endif%>
<%endif%>