summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Cleeland <chris.cleeland@gmail.com>2010-06-28 20:44:06 +0000
committerChris Cleeland <chris.cleeland@gmail.com>2010-06-28 20:44:06 +0000
commit76f0ccefb8b3a390cc32a861ab22da4e722bda50 (patch)
treeadaeb32da9f19a7bc766a9d10a2d4e48970d714c
parente0a671d84f8f017fb06b23fe584f97007ae5aaf4 (diff)
downloadMPC-76f0ccefb8b3a390cc32a861ab22da4e722bda50.tar.gz
Commit of EXPERIMENTAL release for CDT6 project type generator.
-rw-r--r--ChangeLog36
-rw-r--r--config/global.mpb7
-rwxr-xr-xdevtools/document_template.pl85
-rw-r--r--docs/html/CDT6.html228
-rw-r--r--docs/templates/cdt6cproject.txt52
-rw-r--r--docs/templates/cdt6project.txt4
-rw-r--r--modules/CDT6ProjectCreator.pm115
-rw-r--r--modules/CDT6WorkspaceCreator.pm143
-rw-r--r--modules/ProjectCreator.pm1
-rw-r--r--modules/TemplateParser.pm207
-rw-r--r--modules/WorkspaceCreator.pm2
-rw-r--r--templates/cdt6cproject.mpd267
-rw-r--r--templates/cdt6dll.mpt6
-rw-r--r--templates/cdt6exe.mpt6
-rw-r--r--templates/cdt6lib.mpt6
-rw-r--r--templates/cdt6platforms.mpt170
-rw-r--r--templates/cdt6project.mpd146
17 files changed, 1419 insertions, 62 deletions
diff --git a/ChangeLog b/ChangeLog
index e86b5c99..7bef97b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,37 @@
+Mon Jun 28 20:16:54 UTC 2010 Chris Cleeland <cleeland@ociweb.com>
+
+ * modules/CDT6ProjectCreator.pm:
+ * modules/CDT6WorkspaceCreator.pm:
+ * templates/cdt6platforms.mpt:
+ * templates/cdt6cproject.mpd:
+ * templates/cdt6dll.mpt:
+ * templates/cdt6lib.mpt:
+ * templates/cdt6exe.mpt:
+ * templates/cdt6project.mpd:
+
+ Merged in initial EXPERIMENTAL release of CDT6 project
+ type generation from the "eclipse" branch.
+
+ * docs/html/CDT6.html:
+ * docs/templates/cdt6project.txt:
+ * docs/templates/cdt6cproject.txt:
+
+ Draft documentation on the project type.
+
+ * config/global.mpb:
+
+ Modification to allow specification of threads.
+
+ * devtools/document_template.pl:
+
+ Modified to allow use for generating a stubbed out template
+ variable document.
+
+ * modules/TemplateParser.pm:
+
+ Added functions create_aux_file/end_aux_file, translate_vars,
+ and convert_slashes.
+
Mon Jun 28 18:01:08 UTC 2010 James H. Hill <hillj at cs dot iupui dot edu>
* modules/WorkspaceCreator.pm:
@@ -86,6 +120,6 @@ Tue Jun 8 16:06:10 UTC 2010 Adam Mitz <mitza@ociweb.com>
Local Variables:
mode: change-log
-add-log-time-format: (lambda () (progn (setq tz (getenv TZ)) (set-time-zone-rule UTC) (setq time (format-time-string %a %b %e %H:%M:%S %Z %Y (current-time))) (set-time-zone-rule tz) time))
+add-log-time-format: (lambda () (progn (setq tz (getenv "TZ")) (set-time-zone-rule "UTC") (setq time (format-time-string "%a %b %e %H:%M:%S %Z %Y" (current-time))) (set-time-zone-rule tz) time))
indent-tabs-mode: nil
End:
diff --git a/config/global.mpb b/config/global.mpb
index a4254553..b1fc54c3 100644
--- a/config/global.mpb
+++ b/config/global.mpb
@@ -9,4 +9,11 @@ project {
specific(!automake) {
libpaths = .
}
+
+}
+
+feature(threads) {
+ specific(cdt6) {
+ use_threads = 1
+ }
}
diff --git a/devtools/document_template.pl b/devtools/document_template.pl
index 6536c539..6ec57d98 100755
--- a/devtools/document_template.pl
+++ b/devtools/document_template.pl
@@ -80,11 +80,13 @@ sub setup_keywords {
}
}
-
sub display_template {
- my($fh, $cp, $input, $tkeys) = @_;
+ my($fh, $common_cp, $template_cp, $input, $tkeys, $oformat) = @_;
+
+ my $html = ($oformat eq 'html') ? 1 : 0;
- print $fh '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">', "\n",
+ if ($html) {
+ print $fh '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">', "\n",
"<head>\n",
" <title>$input</title>\n",
" <style type=\"text/css\">\n",
@@ -104,13 +106,33 @@ sub display_template {
" <th>Default Value</th>\n",
" <th>Description</th>\n",
" </tr>\n";
+ }
+ else {
+ print $fh "//\n// Document template variables for templates $input.\n// Please try to keep this alphabetically sorted.\n//\n";
+ }
+
foreach my $key (sort keys %$tkeys) {
- my $desc = $cp->get_value($key) || '&nbsp;';
+ # For text output, we only want to dump out the variables that are only
+ # specific to the template being documented and not the common variables.
+ # So, we check to see if the key has a value in the common config and, if
+ # it does, skip. We can't check to see if it has a value in the template
+ # config because this script may be the thing that's creating the stub
+ # for that template.
+ next if (!$html && $common_cp->get_value($key));
+
+ my $desc = '';
+ if ($html) {
+ $desc = $template_cp->get_value($key) || $common_cp->get_value($key) || '&nbsp;';
+ }
+ else {
+ $desc = $common_cp->get_value($key) || '<none>';
+ }
+
my $def;
if (defined $$tkeys{$key}) {
foreach my $ikey (sort keys %{$$tkeys{$key}}) {
if (defined $def) {
- $def .= ' <b>or</b> ';
+ $def .= $html ? ' <b>or</b> ' : ' OR ';
}
else {
$def = '';
@@ -120,29 +142,41 @@ sub display_template {
}
## Convert < and > to html friendly codes
- $desc =~ s/</&lt;/g;
- $desc =~ s/>/&gt;/g;
+ if ($html) {
+ $desc =~ s/</&lt;/g;
+ $desc =~ s/>/&gt;/g;
+ }
- print $fh " <tr>\n",
+ if ($html) {
+ print $fh " <tr>\n",
" <td>$key</td>\n",
" <td>", (defined $def ? $def : '&nbsp'), "</td>\n",
" <td>$desc</td>\n",
" </tr>\n";
+ }
+ else {
+ print $fh "$key = $desc\n";
+ }
}
- print $fh " </table>\n",
- "</body>\n";
+ print $fh " </table>\n</body>\n" if ($html);
}
sub usageAndExit {
- print "document_template.pl v$version\n",
- "Usage: ", basename($0), " <template> [<html output> [language]]\n\n",
- "html output - This defaults to the name of the template file ",
- "with the .mpd\n extenion replaced with .html.\n",
- "language - This defaults to the language for which the ",
- "template is designed.\n It can be any of the valid ",
- "language settings for MPC:\n ",
- join(' ', sort(Creator::validLanguages())), "\n";
+ my $b = basename($0);
+ my $langs = join(' ', sort(Creator::validLanguages()));
+ print <<'EOF';
+document_template.pl v$version
+Usage: $b <template> [<outputfile> [language]]
+
+outputfile - This defaults to the name of the template file with the .mpd
+ extension replaced with '.html' If <outputfile> ends in '.txt',
+ the output is in text format similar to what is found in
+ .../docs/templates.
+language - This defaults to the language for which the template is designed.
+ It can be any of the valid language settings for MPC:
+ $langs
+EOF
exit(0);
}
@@ -155,6 +189,7 @@ my $fh = new FileHandle();
my $input = $ARGV[0];
my $output = $ARGV[1];
my $language = $ARGV[2];
+my $oformat = 'html'; # dump out html by default
usageAndExit() if (!defined $input || $input =~ /^-/);
@@ -163,6 +198,9 @@ if (!defined $output) {
$output =~ s/\.mpd$//;
$output .= '.html';
}
+elsif ($output =~ /\.txt$/) {
+ $oformat = 'txt';
+}
if (open($fh, $input)) {
if (!defined $language) {
@@ -351,21 +389,22 @@ if (open($fh, $input)) {
}
close($fh);
- my $cp = new ConfigParser();
- $cp->read_file("$basePath/docs/templates/common$doc_ext");
+ my $common_cp = new ConfigParser();
+ my $template_cp = new ConfigParser();
+ $common_cp->read_file("$basePath/docs/templates/common$doc_ext");
my $doc = $input;
$doc =~ s/\.[^\.]+$/$doc_ext/;
$doc =~ s/templates/docs\/templates/;
if (-r $doc) {
- $cp->read_file($doc);
+ $template_cp->read_file($doc);
}
else {
- $cp->read_file("$basePath/docs/templates/" . basename($doc));
+ $template_cp->read_file("$basePath/docs/templates/" . basename($doc));
}
if (open($fh, ">$output")) {
- display_template($fh, $cp, $input, \%template_keys);
+ display_template($fh, $common_cp, $template_cp, $input, \%template_keys, $oformat);
close($fh);
}
else {
diff --git a/docs/html/CDT6.html b/docs/html/CDT6.html
new file mode 100644
index 00000000..adf53cda
--- /dev/null
+++ b/docs/html/CDT6.html
@@ -0,0 +1,228 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <meta name="id" content=
+ "$Id$">
+ <link rel="STYLESHEET" href="MakeProjectCreator.css" charset="ISO-8859-1"
+ type="text/css">
+
+ <title>MPC: CDT6 Project Type</title>
+</head>
+
+<body>
+<div>
+ <h1 class="Head1">CDT6 Project Type documentation</h1>
+
+ <div>
+ <h3 class="Head2">Background/Abstract</h3>
+ <li class="body">The <em>CDT6 Project Type</em> generates project files utilizable
+ by Eclipse's CDT plugin, version 6. This is the version
+ generally available/compatible with the Eclipse "Galileo" release.
+ The project type generates eclipse projects from generic mpc
+ files. These Eclipse/CDT projects can then be imported into a user's
+ workspace and built using CDT's internal builder.</li>
+
+ <li class="body">MPC's CDT6 Project Type currently supports Linux
+ and Windows as both host and target platforms.</li>
+ </div>
+
+ <div>
+ <h3 class="Head2">Pre-requisites</h3>
+ <ul>
+ <li class="body">The following software items are required and
+ in the execution path (as well as any of their respective dependencies):
+ <dl>
+ <dt>Eclipse Galileo</dt>
+ <dd>Standard download from <a href="http://www.eclipse.org/downloads">http://www.eclipse.org/downloads</a>.</dd>
+ <dt>CDT 6.0</dt>
+ <dd>This comes packaged together with Eclipse Galileo in the
+ <a
+ href="http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/heliosr">Eclipse
+ IDE for C/C++ Development</a>.</dd>
+ <dt>Eclipse-compatible toolchain</dt>
+ <dd>On linux platforms, this should just be the standard
+ installation of the GNU toolchain for that linux distribution. On
+ Windows, Eclipse uses the <a href="http://www.mingw.org">MinGW</a>
+ toolchain, available for download. Suggested tool set is <a
+ href="http://sourceforge.net/downloads/mingw/Automated%20MinGW%20Installer/MinGW%205.1.6/MinGW-5.1.6.exe/">Automated
+ MinGW Installer</a>.</dd>
+ <dt>a compatible <tt>make</tt> tool</dt>
+ <dd>This does not need to be a full-featured GNU make, but it
+ must be in the PATH as an executable named <em>make</em>. On
+ Linux, the standard GNU make suffices. On Windows, <a
+ href="http://gnuwin32.sourceforge.net/packages/make.htm">the
+ <em>make</em> package from GNUWin32</a> is a good choice.</dd>
+ </dl>
+
+ <li class="body">The default value of 256Mb for Eclipse's Java
+ VM heap size is insufficient for building projects the size of
+ ACE/TAO/CIAO. A minimum of 768Mb or more is suggested. This can be
+ done on the command line launch of eclipse, or in the
+ <code>eclipse.ini</code> file.</li>
+
+ </ul>
+ </div>
+
+ <div>
+ <h3 class="Head2">Usage</h3>
+ For every <code>project <var>myprojname</var> { }</code> in mpc files, the CDT6 project type
+ generates a corresponding "eclipse project" directory of the form
+ <samp>cdt_<var>myprojname</var></samp>. The CDT6 Project Type
+ uses Eclipse's <em>linked resource</em> feature to work around
+ Eclipse's usual requirement that source files reside inside the Eclipse project
+ directory. However, the linked resource feature also comes with
+ restrictions; see <a href="#fullpath">the note</a> for details.
+
+ <h4>Generic workflow</h4>
+ Presuming .mpc files already exist:
+ <ol>
+ <li>Generate projects using <samp>-type cdt6</samp>.</li>
+ <li>Import projects into an Eclipse workspace.</li>
+ </ol>
+
+ <h4>Workflow for building ACE/TAO</h4>
+ <ol>
+ <li>Check out a copy of ACE/TAO.</li>
+
+ <li>Configure ACE/TAO for your target(s) by setting up
+ <samp>config.h</samp>.
+ </li>
+
+ <li>Set up environment variables (<var>ACE_ROOT</var>,
+ <var>TAO_ROOT</var>, etc.), <var>PATH</var>,
+ <var>LD_LIBRARY_PATH</var> (or similar), etc.
+ </li>
+
+ <li>Verify settings in <samp>global.features</samp> and, if changes
+ are necessary, make appropriate changes in
+ <samp>default.features</samp>.
+ </li>
+
+ <li>Generate projects using <samp>-type cdt6</samp> insuring the
+ use of <samp>mwc.pl</samp> from within ACE, e.g.,
+ <blockquote><pre>
+$ cd $TAO_ROOT
+$ mwc.pl -type cdt6 TAO_ACE.mwc
+</pre></blockquote>
+ <samp>mwc.pl</samp> will churn for awhile.
+ </li>
+
+ <li><em>Suggestion:</em> Verify that <strong>Project->Build
+ Automatically</strong> is unchecked (has no checkmark to its
+ immediate left). If this is left on, then the build will start as
+ soon as the import in the next step begins, and it will build everything.</li>
+
+ <li>From within Eclipse (preferably an otherwise-empty workspace) select
+ <strong>File->Import...</strong> and perform the following actions:
+ <ol type="a">
+ <li>Choose <strong>General->Existing Projects Into
+ Workspace</strong> and click <strong>Next</strong></li>
+ <li>In "Select Root Directory:" text field, enter the full path
+ to the directory <em>above</em> ACE, TAO, etc. (you can also use
+ the "Browse" feature to select the directory from the GUI). For
+ example, if you checked everything out into
+ <samp>/home/joedeveloper/acetao</samp> and ACE and TAO are in a
+ peer layout under that directory, you would enter
+ <samp>/home/joedeveloper/acetao</samp> in the text field.
+ </li>
+ <li>Eclipse will scan all the subdirectories looking for existing
+ projects; this can take a few minutes for something as large as
+ TAO or CIAO. <strong>NOTE:</strong> If you have previously run
+ MPC to generate CDT projects with one workspace
+ (<samp>.mwc</samp> file) and then ran it later with a different
+ workspace without removing the projects from the first
+ generation, Eclipse will still find those projects for import.
+ See <a href="#remove_projects">the note on removing generated
+ projects</a> for information on how to do that.</li>
+
+ <li><strong>Be sure that the checkbox next to <em>Copy projects
+ into workspace</em> is <em>UN</em>checked.</strong> Copying projects into
+ the workspace unnecessarily duplicates files, plus we have found
+ that Eclipse can get confused with file paths sometimes (though
+ sometimes it will work).</li>
+
+ <li>Feel free to use <em>Working Sets</em> or not. You may also
+ choose to import a subset of the discovered projects by
+ manipulating them in the list, however, experience suggests that
+ the list is ignorant of dependency interactions between projects,
+ so you must manage that manually (<em>i.e.</em>, you could import
+ a project, but not projects upon which the first depends, and
+ that first project would then fail to build).</li>
+
+ <li>Click <strong>Finish</strong> to proceed with the import.</li>
+ </ol>
+ Eclipse will now start populating the <em>Projects</em> pane with
+ projects. If you didn't uncheck <strong>Build
+ Automatically</strong>, then builds will start. Regardless, the
+ C++ indexer will run in the background across the source of all projects.</li>
+
+ <h4>Building A Project</h4>
+ To build a project or set of projects, select the project (or
+ projects) in the <em>Project</em> pane, then select
+ <strong>Project->Build Project</strong>. Eclipse will evaluate
+ <em>ALL</em> dependencies automatically, though not necessarily
+ quickly.
+ <p>
+ <em>Hint:</em> a good choice to get all of ACE/TAO built is to
+ choose the <em>Naming Service</em> project.
+ </div>
+
+ <div>
+ <h3 class="Head2">Notes</h3>
+ <ol>
+ <li>
+ There is no generated workspace. Eclipse's concept of workspace is
+ very different from MPC's, and there is no way to generate a
+ workspace. Eclipse's workspace concept doesn't permit sharing
+ among machines or developers or even checking a workspace into
+ version control.
+ </li>
+
+ <li>The Eclipse "workspace" and MPC project + source must not be in the
+ same directory hierarchy. For example, if you chose to have
+ Eclipse store its workspace in
+ <samp>/home/joedeveloper/workspace</samp>, you may not put your
+ MPC project+source under that directory. However, putting the
+ MPC project+source under <samp>/home/joedeveloper/acetao</samp>
+ or similar, <em>i.e.</em>, as a <em>peer</em> to the workspace
+ directory, is fine.
+ </li>
+
+ <li><a name="fullpath"></a>CDT6 uses Eclipse's <em>linked
+ resource</em> feature to work around the usual requirement that
+ all source code reside in Eclipse project directories. These
+ act similar to Unix symbolic links. While convenient so that a
+ developer is not required to conform to Eclipse's directory
+ layout, it comes at a price: the target of the link must be
+ specified as a full path. The consequence of this restriction is
+ that, once the CDT6 projects get generated, the source should
+ not move in the filesystem.</li>
+
+ <li><a name="remove_projects"></a>MPC's CDT Project Generator
+ creates directories named <samp>cdt_*</samp> for projects, similar
+ to how the GNUACE generator generates makefiles of the form
+ <samp>GNUmakefile.*</samp>. To remove all CDT projects from a
+ directory hierarchy, on Linux you can use a command such as:
+<pre>
+ $ find . -name 'cdt_*' -print | xargs rm -rf
+</pre>
+ </li>
+
+ <li>Perfect hash generation using the IDL compiler is not
+ currently working because the IDL compiler cannot find the
+ <samp>gperf</samp> executable. This may be a <code>PATH</code>
+ issue, "installation" issue, or an mpc file dependency issue. The
+ IDL compiler works but does not generate perfect hash lookups.</li>
+ </ol>
+ </div>
+
+</div>
+
+
+<hr>
+<address></address>
+<!-- hhmts start --> Last modified: Sun Jun 27 21:00:32 CDT 2010 <!-- hhmts end -->
+</body> </html>
diff --git a/docs/templates/cdt6cproject.txt b/docs/templates/cdt6cproject.txt
new file mode 100644
index 00000000..80e448fd
--- /dev/null
+++ b/docs/templates/cdt6cproject.txt
@@ -0,0 +1,52 @@
+//
+// Document template variables for templates templates/cdt6cproject.mpd.
+// Please try to keep this alphabetically sorted.
+//
+binary_parsers = List of parsers eclipse uses on binaries for the platform.
+build64bit = Indicator for 64-bit build.
+build_artefact_type = CDT tag indicating whether we're building a shared lib, executable, etc.
+c_compiler_option_superclass = CDT tag for "superclass" for C compiler options.
+c_linker_dynamiclib_superclass = CDT tag for "superclass" for C linker dynamic lib options.
+c_linker_tool_superclass_root = CDT tag for "superclass" for C linker.
+ccflags = (Optional) List of additional flags that should be passed to the C compiler.
+common_defines = Specifies macros that are common to all target types.
+configuration_parent_root = Root of CDT tag used for <configuration> element.
+cpp_compiler_option_superclass = CDT tag for "superclass" for C++ compiler options
+cpp_linker_dynamiclib_superclass = CDT tag for "superclass" for C++ linker dynamic lib options.
+cpp_linker_tool_input_superclass = CDT tag for "superclass" for C++ linker <inputType> element.
+cpp_linker_tool_superclass_root = Root of CDT tag for "superclass" for C++ linker.
+cpu_defines = Macros specific to a particular CPU platform.
+cxxflags = (Optional) List of additional flags that should be passed to the C++ compiler.
+debugging_level = Textual name of debugging level (defined by CDT) used during compilation.
+defines = Macros specific to a particular configuration.
+dll_ext_nodot = Same as dll_ext but with no preceding period/dot.
+envvar_post = Host platform-specific string to be appended to an environment variable in a script/batch file.
+envvar_pre = Host platform-specific string to be prepended to an environment variable in a script/batch file.
+error_parsers = List of parsers eclipse uses on error output for the platform.
+exe_ext_nodot = Same as exe_ext but with no preceding period/dot.
+lib_ext_nodot = Same as lib_ext but with no preceding period/dot.
+libenv = Name of platform environment variable that holds the library path.
+linker_option_superclass = CDT tag for "superclass" for generic linker.
+linkflags64 = Linker flags to be used during a 64-bit build.
+makefile_tmpfile = Name of a temporary file that can be used by a generated makefile.
+mkdir_pre = Host platform-specific test that must precede a mkdir command.
+optimization_level = Textual name of optimization level (defined by CDT) used during compilation.
+outputtype_superclass = CDT tag for "superclass" for the type of output file being produced by a build step.
+pathsep = Host platform-specific separator used between elements of the PATH environment variables.
+platform_defines = Macros specific to a particular platform.
+platform_libs = Libraries specific to a particular platform.
+platform_specializer = Target platform-specific keyword used in some CDT tags (see cdt6platforms.mpt).
+project_element_type_id = Target platform-specific CDT tag used in the <project> element.
+project_type = Target platform-specific string indicating project type.
+project_type_name = Target platform-specific string indicating name associated with project_type.
+quote_echo = Host platform-specific character used to quote arguments to echo in a script/batch file.
+script_hdr = Host platform-specific preamble placed in a script/batch file.
+script_tmpfile = Name of a temporary file that can be used by a generated script.
+setenv = Host platform-specific command used to set an environment variable in a script/batch file.
+shell = Host platform-specific command to invoke a shell on a file.
+targetplatform_superclass = CDT tag for "superclass" for the <targetPlatform> element.
+threadflags = Target platform-specific flags required when building with threading enabled.
+tool_name_prefix = String used in CDT GUI prefixing the names of tools in the toolchain.
+toolchain_internal_builder_root = Root of CDT tag for <toolChain> element's nonInternalBuilderId attribute.
+toolchain_superclass_root = Root of CDT tag for "superclass" of <toolChain> element.
+use_threads = Flag automatically set when feature(threads) is on.
diff --git a/docs/templates/cdt6project.txt b/docs/templates/cdt6project.txt
new file mode 100644
index 00000000..8f3f3912
--- /dev/null
+++ b/docs/templates/cdt6project.txt
@@ -0,0 +1,4 @@
+//
+// Document template variables for templates templates/cdt6project.mpd.
+// Please try to keep this alphabetically sorted.
+//
diff --git a/modules/CDT6ProjectCreator.pm b/modules/CDT6ProjectCreator.pm
new file mode 100644
index 00000000..e321ff94
--- /dev/null
+++ b/modules/CDT6ProjectCreator.pm
@@ -0,0 +1,115 @@
+package CDT6ProjectCreator;
+
+# ************************************************************
+# Description : Eclipse CDT 6 generator
+# Author : Chris Cleeland, Object Computing, Inc.
+# Create Date : 23-Apr-2010
+# ************************************************************
+
+# ************************************************************
+# Pragmas
+# ************************************************************
+
+use strict;
+
+use ProjectCreator;
+
+use vars qw(@ISA);
+@ISA = qw(ProjectCreator);
+
+# ************************************************************
+# Data Section
+# ************************************************************
+
+my %templates = ('cdt6project' => '.project',
+ 'cdt6cproject' => '.cproject' );
+
+my @tkeys = sort keys %templates;
+
+# ************************************************************
+# Subroutine Section
+# ************************************************************
+
+sub crlf {
+ #my $self = shift;
+ return "\n";
+}
+
+sub project_file_name {
+ my($self, $name, $template) = @_;
+
+ ## Fill in the name and template if they weren't provided
+ $name = $self->project_name() if (!defined $name);
+ $template = 'cdt6' if (!defined $template || !defined $templates{$template});
+
+ if ($self->{'make_coexistence'}) {
+ return $self->get_modified_project_file_name("cdt_$name",
+ '/' . $templates{$template});
+ }
+ else {
+ return $templates{$template};
+ }
+}
+
+sub fill_value {
+ my($self, $name) = @_;
+
+ if ($name eq 'platforms') {
+ if ($^O eq 'darwin') {
+ return 'macosx';
+ }
+ elsif ($^O eq 'MSWin32') {
+ return 'win32';
+ }
+ else {
+ return $^O; # cygwin, solaris, linux match what we expect
+ }
+ }
+
+ return undef;
+}
+
+sub get_template {
+ #my $self = shift;
+ return @tkeys;
+}
+
+sub dependency_is_filename {
+ #my $self = shift;
+ return 0;
+}
+
+sub requires_forward_slashes {
+ return 1;
+}
+
+sub file_visible {
+ ## We only want the project file visible to the workspace creator.
+ ## There can only be one and this is it.
+ #my($self, $template) = @_;
+ return $_[1] eq 'cdt6project';
+}
+
+sub get_dll_exe_template_input_file {
+ #my $self = shift;
+ return 'cdt6exe';
+}
+
+sub get_dll_template_input_file {
+ #my $self = shift;
+ #print "in get_dll_template_input_file\n";
+ return 'cdt6dll';
+}
+
+sub get_lib_template_input_file {
+ #my $self = shift;
+ #print "in get_lib_template_input_file\n";
+ return 'cdt6lib';
+}
+
+sub use_win_compatibility_commands {
+ return (defined $ENV{'MPC_CDT_HOST_WIN32'})
+ ? $ENV{'MPC_CDT_HOST_WIN32'} : ($^O eq 'MSWin32' || $^O eq 'cygwin');
+}
+
+1;
diff --git a/modules/CDT6WorkspaceCreator.pm b/modules/CDT6WorkspaceCreator.pm
new file mode 100644
index 00000000..9980757a
--- /dev/null
+++ b/modules/CDT6WorkspaceCreator.pm
@@ -0,0 +1,143 @@
+package CDT6WorkspaceCreator;
+
+# ************************************************************
+# Description : Eclipse CDT 6 generator
+# Author : Chris Cleeland, Object Computing, Inc.
+# Create Date : 23-Apr-2010
+# ************************************************************
+
+# ************************************************************
+# Pragmas
+# ************************************************************
+
+use strict;
+
+use CDT6ProjectCreator;
+use WorkspaceCreator;
+
+use vars qw(@ISA);
+@ISA = qw(WorkspaceCreator);
+
+# ************************************************************
+# Subroutine Section
+# ************************************************************
+
+sub requires_make_coexistence {
+ #my $self = shift;
+ return 1;
+}
+
+sub supports_make_coexistence {
+ #my $self = shift;
+ return 1;
+}
+
+sub workspace_file_name {
+ my $self = shift;
+ my $wsn = $self->get_workspace_name();
+ return $self->get_modified_workspace_name("cdt_workspace_$wsn", '.txt');
+}
+
+sub pre_workspace {
+ my($self, $fh) = @_;
+ my $crlf = $self->crlf();
+
+ ## Optionally print the workspace comment
+ $self->print_workspace_comment($fh,
+ '#----------------------------------------------------------------------------', $crlf,
+ '# Eclipse CDT 6 generator', $crlf,
+ '#', $crlf,
+ '# This file was generated by MPC. Any changes made directly to', $crlf,
+ '# this file will be lost the next time it is generated.', $crlf,
+ '# Listed below are the Eclipse projects created for this MPC workspace.', $crlf,
+ '# These should be imported into an existing Eclipse workspace.', $crlf,
+ '# Each project is listed on a line consisting of the project name and the full', $crlf,
+ '# path to its .project file (space-separated).', $crlf,
+ '# The projects are listed in dependency order.', $crlf,
+ '#', $crlf,
+ '# MPC Command:', $crlf,
+ "# $0 @ARGV", $crlf,
+ '#----------------------------------------------------------------------------', $crlf);
+}
+
+sub write_comps {
+ my($self, $fh, $creator) = @_;
+ my $info = $self->get_project_info();
+ my $crlf = $self->crlf();
+ $self->{'seen_deps'} = {};
+
+ foreach my $project ($self->sort_dependencies($self->get_projects(), 0)) {
+ print $fh "$$info{$project}->[0] ",
+ Cwd::abs_path($self->mpc_dirname($project)), '/.project', $crlf;
+ $self->add_dependencies($creator, $project);
+ }
+}
+
+sub add_dependencies {
+ my($self, $creator, $proj) = @_;
+ my $outdir = $self->mpc_dirname($proj);
+
+ my $pre = ' <project>';
+ my $post = '</project>';
+ my $outfile = $outdir . '/.project';
+
+ my $fh = new FileHandle();
+ if (open($fh, $outfile)) {
+ ## Get the dependencies and store them based on the directory of
+ ## the project file. We will check them later.
+ my $deps = $self->get_validated_ordering($proj);
+ my $key = $self->mpc_basename($self->mpc_dirname($proj));
+ $self->{'seen_deps'}->{$key} = {};
+ foreach my $dep (@$deps) {
+ $self->{'seen_deps'}->{$key}->{$dep} = 1;
+ }
+
+ my @read = ();
+ my $cwd = $self->getcwd();
+ while(<$fh>) {
+ ## This is a comment found in cdt6project.mpd.
+ if (/MPC\s+ADD\s+DEPENDENCIES/) {
+ my $crlf = $self->crlf();
+ my %seen = ();
+ my @lines;
+ foreach my $dep (reverse @$deps) {
+ ## If we've seen this dependency, we don't need to add it
+ ## again. The build tool will handle it correctly.
+ if (!$seen{$dep}) {
+ my $relative = $self->get_relative_dep_file($creator,
+ "$cwd/$proj", $dep);
+ ## Since we're looking at the dependencies in reverse order
+ ## now, we need to unshift them into another array to keep
+ ## the correct order.
+ unshift(@lines, "$pre$dep$post$crlf") if (defined $relative);
+
+ ## We've now seen this dependency and all of the
+ ## projects upon which this one depends.
+ $seen{$dep} = 1;
+ foreach my $key (keys %{$self->{'seen_deps'}->{$dep}}) {
+ $seen{$key} = 1;
+ }
+ }
+ }
+
+ ## Add the dependency lines to the project file
+ push(@read, @lines);
+ }
+ else {
+ push(@read, $_);
+ }
+ }
+ close($fh);
+
+ ## We will always rewrite the project file (with or without dependencies)
+ if (open($fh, ">$outfile")) {
+ foreach my $line (@read) {
+ print $fh $line;
+ }
+ close($fh);
+ }
+ }
+}
+
+
+1;
diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm
index d454d3b8..229462e7 100644
--- a/modules/ProjectCreator.pm
+++ b/modules/ProjectCreator.pm
@@ -3037,7 +3037,6 @@ sub correct_generated_files {
}
}
-
sub generate_default_components {
my($self, $files, $passed) = @_;
my $genext = $self->{'generated_exts'};
diff --git a/modules/TemplateParser.pm b/modules/TemplateParser.pm
index 22dd49d5..cfdf4b50 100644
--- a/modules/TemplateParser.pm
+++ b/modules/TemplateParser.pm
@@ -11,6 +11,7 @@ package TemplateParser;
# ************************************************************
use strict;
+use File::Path;
use Parser;
use WinVersionTranslator;
@@ -29,6 +30,8 @@ use vars qw(@ISA);
# 1 means there is a perform_ method available (used by foreach and nested)
# 2 means there is a doif_ method available (used by if)
# 3 means that parameters to perform_ should not be evaluated
+# 4 means there is a post_ method available (called after the results of
+# calling perform_ for a nested function are written to the output)
#
# Perl Function Parameter Type Return Type
# get_ string string or array
@@ -72,6 +75,10 @@ my %keywords = ('if' => 0,
'scope' => 0,
'full_path' => 3,
'extensions' => 0xa,
+ 'create_aux_file' => 0x12,
+ 'end_aux_file' => 0,
+ 'translate_vars' => 2 | 1,
+ 'convert_slashes' => 2,
);
my %target_type_vars = ('type_is_static' => 1,
@@ -112,6 +119,7 @@ sub new {
$self->{'override_target_type'} = undef;
$self->{'keyname_used'} = {};
$self->{'scopes'} = {};
+ $self->{'aux_file'} = undef;
$self->{'foreach'} = {};
$self->{'foreach'}->{'count'} = -1;
@@ -214,9 +222,13 @@ sub append_current {
}
}
-
- if ($_[0]->{'foreach'}->{'count'} >= 0) {
- $_[0]->{'foreach'}->{'text'}->[$_[0]->{'foreach'}->{'count'}] .= $value;
+ my $foreach_count = $_[0]->{'foreach'}->{'count'};
+ if ($_[0]->{'aux_file'}
+ && $foreach_count == $_[0]->{'aux_file'}->{'foreach_baseline'}) {
+ $_[0]->{'aux_file'}->{'text'} .= $value;
+ }
+ elsif ($foreach_count >= 0) {
+ $_[0]->{'foreach'}->{'text'}->[$foreach_count] .= $value;
}
elsif ($_[0]->{'eval'}) {
$_[0]->{'eval_str'} .= $value;
@@ -231,13 +243,10 @@ sub split_parameters {
my($self, $str) = @_;
my @params;
- while($str =~ /^(\w+\([^\)]+\))\s*,\s*(.*)/) {
- push(@params, $1);
- $str = $2;
- }
- while($str =~ /^([^,]+)\s*,\s*(.*)/) {
+ while ($str =~ /^(\w+\([^\)]+\))(.*)/ || $str =~ /^([^,]+)(.*)/) {
push(@params, $1);
$str = $2;
+ $str =~ s/^\s*,\s*//;
}
## Return the parameters (which includes whatever is left in the
@@ -1485,43 +1494,61 @@ sub handle_extensions {
sub evaluate_nested_functions {
- my($self, $name, $val) = @_;
+ my($self, $funcname, $args) = @_;
+ my @params = $self->split_parameters($args);
+ my @results;
+ foreach my $param (@params) {
+ my @cmds;
+ my $val = $param;
- ## Get the value based on the string
- my @cmds = ($name);
- while ($val =~ /(\w+)\((.+)\)/) {
- push(@cmds, $1);
- $val = $2;
- }
+ while ($val =~ /(\w+)\((.+)\)/) {
+ push(@cmds, $1);
+ $val = $2;
+ }
- ## Start out calling get_xxx on the string
- my $type = 0x01;
- my $prefix = 'get_';
+ if (scalar @cmds == 0) {
+ push @results, $val;
+ next;
+ }
- foreach my $cmd (reverse @cmds) {
- if (defined $keywords{$cmd} && ($keywords{$cmd} & $type) != 0) {
- my $func = "$prefix$cmd";
- if ($type == 0x01) {
- $val = $self->$func($val);
- $val = [ $val ] if (!UNIVERSAL::isa($val, 'ARRAY'));
+ my $type = 0x01;
+ my $prefix = 'get_';
+ foreach my $cmd (reverse @cmds) {
+ if (defined $keywords{$cmd} && ($keywords{$cmd} & $type) != 0) {
+ my $func = "$prefix$cmd";
+ if ($type == 0x01) {
+ $val = $self->$func($val);
+ $val = [ $val ] if (!UNIVERSAL::isa($val, 'ARRAY'));
+ ## Now that we have a value, we need to switch over
+ ## to calling perform_xxx
+ $type = 0x02;
+ $prefix = 'perform_';
+ }
+ else {
+ my @array = $self->$func($val);
+ $val = \@array;
+ }
}
else {
- my @array = $self->$func($val);
- $val = \@array;
+ $self->warning("Unable to use $cmd in nested " .
+ "functions (no $prefix method).");
}
-
- ## Now that we have a value, we need to switch over
- ## to calling perform_xxx
- $type = 0x02;
- $prefix = 'perform_';
}
- else {
- $self->warning("Unable to use $cmd in nested " .
- "functions (no $prefix method).");
+ push @results, "@$val";
+ }
+
+ if (defined $keywords{$funcname} && ($keywords{$funcname} & 0x02)) {
+ my $func = 'perform_' . $funcname;
+ my @array = $self->$func(\@results);
+ $self->append_current("@array");
+ if ($keywords{$funcname} & 0x10) {
+ $func = 'post_' . $funcname;
+ $self->$func();
}
}
- if (defined $val && UNIVERSAL::isa($val, 'ARRAY')) {
- $self->append_current("@$val");
+ else {
+ $self->warning("Unable to use $funcname in nested " .
+ "functions (no perform_ method).");
}
}
@@ -1693,6 +1720,114 @@ sub handle_transdir {
}
+sub handle_create_aux_file {
+ my $self = shift;
+ my @fname = $self->perform_create_aux_file([$self->split_parameters(shift)]);
+ $self->append_current($fname[0]);
+ $self->post_create_aux_file();
+}
+
+
+sub post_create_aux_file {
+ my $self = shift;
+ $self->{'aux_file'} = $self->{'aux_temp'};
+ $self->{'aux_temp'} = undef;
+}
+
+
+sub perform_create_aux_file {
+ my $self = shift;
+ my $argsref = shift;
+
+ if (defined $self->{'aux_file'}) {
+ die "Can't nest create_aux_file commands.";
+ }
+
+ my $fname = '';
+ foreach my $arg (@$argsref) {
+ my $val = $self->get_value($arg);
+ $fname .= defined $val ?
+ (UNIVERSAL::isa($val, 'ARRAY') ? join('_', @$val) : $val) : $arg;
+ }
+
+ my $dir = $self->mpc_dirname($self->{'prjc'}->get_outdir() . '/' .
+ $self->{'prjc'}->{'assign'}->{'project_file'});
+ $dir .= '/' . $self->mpc_dirname($fname) if ($fname =~ /[\/\\]/);
+
+ $self->{'aux_temp'} = {'dir' => $dir,
+ 'filename' => $self->mpc_basename($fname),
+ 'foreach_baseline' => $self->{'foreach'}->{'count'}};
+ return $fname;
+}
+
+
+sub handle_end_aux_file {
+ my $self = shift;
+ if (!defined $self->{'aux_file'}) {
+ return 'end_aux_file seen before create_aux_file';
+ }
+ else {
+ my $af = $self->{'aux_file'};
+ mkpath($af->{'dir'}, 0, 0777) if ($af->{'dir'} ne '.');
+ my $fh = new FileHandle('> ' . $af->{'dir'} . '/' . $af->{'filename'});
+ if (!defined $fh) {
+ die "Couldn't open: " . $af->{'dir'} . '/' . $af->{'filename'};
+ }
+ print $fh $af->{'text'};
+ close $fh;
+ $self->{'aux_file'} = undef;
+ }
+}
+
+
+sub handle_translate_vars {
+ my $self = shift;
+ my $arg = shift;
+ my @params = $self->split_parameters($arg);
+ $self->append_current($self->perform_translate_vars([@params]));
+}
+
+sub get_translate_vars {
+ my ($self, $str) = @_;
+ my @params = $self->split_parameters($str);
+ return $self->perform_translate_vars([@params]);
+}
+
+sub perform_translate_vars {
+ my $self = shift;
+ my $arg = shift;
+ my $val = $self->get_value($arg->[0]);
+ $val = $arg->[0] unless defined $val;
+ my $os = (defined $arg->[1] && $arg->[1] ne '')
+ ? $arg->[1] : $self->{'prjc'}->{'command_subs'}->{'os'};
+ my ($pre, $post) = ($os eq 'win32') ? ('%', '%') : ('${', '}');
+ $val =~ s[\$\(([^)]+)\)(\S*)][my ($var, $rest) = ($1, $2);
+ $rest =~ s!/!\\!g if $os eq 'win32';
+ "$pre$var$post$rest"]ge;
+ return $val;
+}
+
+
+sub handle_convert_slashes {
+ my $self = shift;
+ my $arg = shift;
+ my @params = $self->split_parameters($arg);
+ $self->append_current($self->perform_convert_slashes([@params]));
+}
+
+
+sub perform_convert_slashes {
+ my $self = shift;
+ my $arg = shift;
+ my $val = $self->get_value($arg->[0]);
+ $val = $arg->[0] unless defined $val;
+ my $os = (defined $arg->[1] && $arg->[1] ne '')
+ ? $arg->[1] : $self->{'prjc'}->{'command_subs'}->{'os'};
+ $val =~ s!/!\\!g if $os eq 'win32';
+ return $val;
+}
+
+
sub prepare_parameters {
my($self, $prefix) = @_;
my $input = $self->get_value($prefix . '->input_file');
diff --git a/modules/WorkspaceCreator.pm b/modules/WorkspaceCreator.pm
index ac29ff51..1c0ba1d8 100644
--- a/modules/WorkspaceCreator.pm
+++ b/modules/WorkspaceCreator.pm
@@ -1563,7 +1563,7 @@ sub sort_within_group {
my $movepjs = [];
## Put the projects in the order specified
- ## by the project dpendencies.
+ ## by the project dependencies.
for(my $i = $start; $i <= $end; ++$i) {
## If our moved project equals our previously moved project then
## we count this as a possible circular dependency.
diff --git a/templates/cdt6cproject.mpd b/templates/cdt6cproject.mpd
new file mode 100644
index 00000000..abc1fad6
--- /dev/null
+++ b/templates/cdt6cproject.mpd
@@ -0,0 +1,267 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?fileVersion 4.0.0?>
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+ <storageModule moduleId="org.eclipse.cdt.core.settings">
+<%foreach(platforms)%>
+<%foreach(host_platform)%><%comment(there won't be more than one host_platform, but a foreach is used in order to access scoped assignments from the mpt)%>
+<%foreach(configurations)%>
+ <cconfiguration id="mpc.generated.config.<%platform%>.<%configuration%>">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="mpc.generated.config.<%platform%>.<%configuration%>" moduleId="org.eclipse.cdt.core.settings" name="<%platform%>-<%configuration%>">
+<externalSettings/><%comment(looks like for libraries there are externalsettings)%>
+<extensions>
+<%foreach(binary_parsers)%>
+<extension id="<%binary_parser%>" point="org.eclipse.cdt.core.BinaryParser"/>
+<%endfor%>
+<%foreach(error_parsers)%>
+<extension id="<%error_parser%>" point="org.eclipse.cdt.core.ErrorParser"/>
+<%endfor%>
+</extensions>
+</storageModule>
+
+<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+<configuration
+ <%if(exename && exe_ext_nodot)%>artifactExtension="<%exe_ext_nodot%>"<%endif%>
+ <%if(type_is_dynamic && dll_ext_nodot)%>artifactExtension="<%dll_ext_nodot%>"<%endif%>
+ <%if(type_is_static && lib_ext_nodot)%>artifactExtension="<%lib_ext_nodot%>"<%endif%>
+ artifactName="<%if(exename)%><%exename%><%else%><%if(type_is_dynamic)%><%sharedname%><%else%><%if(type_is_static)%><%staticname%><%endif%><%endif%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%endif%>"
+ description=""
+ id="mpc.generated.config.<%platform%>.<%configuration%>"
+ name="<%platform%>-<%configuration%>"
+ <%if(custom_only)%>
+ parent="org.eclipse.cdt.build.core.emptycfg" buildProperties=""
+ <%else%>
+ buildArtefactType="<%build_artefact_type%>"
+ buildProperties="org.eclipse.cdt.build.core.buildArtefactType=<%build_artefact_type%>,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.<%configuration%>"
+ cleanCommand="<%delete("rm -rf")%>"
+ parent="<%configuration_parent_root%>.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>"
+ prebuildStep="<%eval(prebuild)%>"
+ <%endif%><%comment(!custom_only)%>
+ postbuildStep="<%shell%> ..<%slash%><%create_aux_file(postbuild_, platform, _, configuration, script_ext)%><%script_hdr%>
+<%if(!custom_only)%>
+<%if(type_is_dynamic)%><%cp%> <%lib_prefix%><%sharedname%><%lib_modifier%><%dll_ext%> <%if(dllout)%><%if(!starts_with(dllout, [/\\\$]))%>..<%slash%>..<%slash%><%endif%><%convert_slashes(translate_vars(dllout))%><%else%><%if(libout)%><%if(!starts_with(libout, [/\\\$]))%>..<%slash%>..<%slash%><%endif%><%convert_slashes(translate_vars(libout))%><%else%>..<%slash%>..<%endif%><%endif%><%else%>
+<%if(type_is_static)%><%cp%> <%lib_prefix%><%staticname%><%lib_modifier%><%lib_ext%> <%if(libout)%><%if(!starts_with(libout, [/\\\$]))%>..<%slash%>..<%endif%><%convert_slashes(translate_vars(libout))%><%else%>..<%slash%>..<%endif%><%else%>
+<%if(exename)%><%cp%> <%exename%><%exe_ext%> <%if(exeout)%><%if(!starts_with(exeout, [/\\\$]))%>..<%slash%>..<%endif%><%convert_slashes(translate_vars(exeout))%><%else%>..<%slash%>..<%endif%><%endif%>
+<%endif%><%endif%>
+<%endif%>
+<%if(postbuild)%><%eval(postbuild)%><%endif%>
+<%end_aux_file%>"
+>
+<folderInfo id="mpc.generated.config.<%platform%>.<%configuration%>" <%comment(same id as configuration element id)%> name="/" resourcePath="">
+<toolChain
+ id="mpc.generated.toolchain.<%platform%>.<%configuration%>"
+ name="<%platform%> Default"
+<%comment(nonInternalBuildId not in native generation on win32)%>
+ nonInternalBuilderId="<%toolchain_internal_builder_root%>.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>"
+ superClass="<%toolchain_superclass_root%>.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>"
+>
+<targetPlatform
+ id="mpc.generated.target.platform.<%platform%>.<%project_type%>.<%configuration%>"
+ name="<%configuration%> Platform"
+ superClass="<%targetplatform_superclass%>.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>"/>
+<builder
+ id="org.eclipse.cdt.internal.builder.<%project_name%>"
+ autoBuildTarget="all"<%comment(these targets don't appear in native generation on win32)%>
+ cleanBuildTarget="clean"
+ incrementalBuildTarget="all"
+ keepEnvironmentInBuildfile="false"
+ <%if(custom_only)%>
+ superClass="org.eclipse.cdt.build.core.settings.default.builder"
+ name="Gnu Make Builder.<%platform%>.<%configuration%>"
+ buildPath="${workspace_loc:/<%project_name%>}/.."
+ arguments="-f <%project_name%>.mk"
+ <%else%>
+ buildPath="${workspace_loc:/<%project_name%>/<%configuration%>}"<%comment(buildpath may need to include platform as well in the case of cross-compiles)%>
+ managedBuildOn="true" name="CDT Internal Builder"
+ superClass="org.eclipse.cdt.build.core.internal.builder"
+ <%endif%>
+/>
+<%if(custom_only)%>
+<tool id="org.eclipse.cdt.build.core.settings.holder.libs.<%platform%>.<%configuration%>" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs" />
+<%else%>
+<tool id="<%c_linker_tool_superclass_root%>.<%project_type%>.<%configuration%>.1311461244" name="<%tool_name_prefix%> C Linker" superClass="<%c_linker_tool_superclass_root%>.<%project_type%>.<%configuration%>">
+<%if(type_is_dynamic)%>
+<option defaultValue="true" id="<%c_linker_dynamiclib_superclass%>.1" name="Shared/Dynamic" superClass="<%c_linker_dynamiclib_superclass%>" valueType="boolean"/>
+<%endif%>
+</tool>
+<tool id="<%cpp_linker_tool_superclass_root%>.<%project_type%>.<%configuration%>.335515345" name="<%tool_name_prefix%> C++ Linker" superClass="<%cpp_linker_tool_superclass_root%>.<%project_type%>.<%configuration%>">
+<option id="mpc.generated.link.libpaths.1" superClass="<%linker_option_superclass%>.paths" valueType="libPaths">
+<%foreach(libpaths)%>
+<listOptionValue builtIn="false" value="<%if(!starts_with(libpath, [/\\\$]))%>../../<%endif%><%translate_vars(libpath, 1)%>"/>
+<%endfor%>
+</option>
+<option id="mpc.generated.link.option.libs.1" name="Libraries (-l)" superClass="<%linker_option_superclass%>.libs" valueType="libs">
+<%foreach(libs lit_libs pure_libs platform_libs)%>
+<listOptionValue builtIn="false" value="<%lib%>"/>
+<%endfor%>
+</option>
+<option id="mpc.generated.linkflags.1" superClass="<%linker_option_superclass%>.flags" value="<%if(use_threads)%> <%threadflags%><%endif%><%if(linkflags)%> <%linkflags%><%endif%><%if(build64bit && linkflags64)%> <%linkflags64%><%endif%>" valueType="string"/>
+<%if(type_is_dynamic)%>
+<option defaultValue="true" id="<%cpp_linker_dynamiclib_superclass%>.1" name="Shared/Dynamic" superClass="<%cpp_linker_dynamiclib_superclass%>" valueType="boolean"/>
+<%endif%>
+<inputType id="cdt.managedbuild.tool.<%if(platform_specializer)%><%platform_specializer%>.<%endif%>cpp.linker.input.415890365" superClass="<%cpp_linker_tool_input_superclass%>">
+<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+<additionalInput kind="additionalinput" paths="$(LIBS)"/>
+</inputType>
+<%if(!exename)%>
+<outputType id="mpc.generated.cpp.linker.output.so.1" outputPrefix="<%lib_prefix%>" superClass="<%outputtype_superclass%>"/>
+<%endif%>
+</tool>
+<tool id="cdt.managedbuild.tool.gnu.assembler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.897965604" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>">
+<inputType id="cdt.managedbuild.tool.gnu.assembler.input.706221217" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+</tool>
+<tool id="cdt.managedbuild.tool.gnu.archiver.<%if(platform_specializer)%><%platform_specializer%>.<%endif%>base.134329701" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.<%if(platform_specializer)%><%platform_specializer%>.<%endif%>base"/>
+<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.1373363011" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>">
+<option id="mpc.generated.cc.include.paths.1" superClass="<%cpp_compiler_option_superclass%>.include.paths" valueType="includePath">
+<%foreach(includes)%>
+<listOptionValue builtIn="false" value="<%if(!starts_with(include, [/\\\$]))%>../../<%endif%><%translate_vars(include, 1)%>"/>
+<%endfor%>
+</option>
+<option id="gnu.cpp.compiler.option.other.other.375481234" superClass="gnu.cpp.compiler.option.other.other" value="-c <%comment(here's where we can put in all the extra compiler flags)%><%cxxflags%><%if(use_threads)%> <%threadflags%><%endif%>" valueType="string"/>
+<option id="gnu.cpp.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.option.optimization.level.886842330" name="Optimization Level" superClass="gnu.cpp.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.option.optimization.level" value="gnu.cpp.compiler.optimization.level.<%optimization_level%>" valueType="enumerated"/>
+<option id="gnu.cpp.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.option.debugging.level.63360527" name="Debug Level" superClass="gnu.cpp.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.option.debugging.level" value="gnu.cpp.compiler.debugging.level.<%debugging_level%>" valueType="enumerated"/>
+<option id="gnu.cpp.compiler.option.preprocessor.def.1310953196" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
+<%foreach(defines common_defines cpu_defines platform_defines macros)%>
+<listOptionValue builtIn="false" value="<%define%>"/>
+<%endfor%>
+<%if(type_is_dynamic)%><%foreach(dynamicflags)%>
+<listOptionValue builtIn="false" value="<%dynamicflag%>"/>
+<%endfor%><%endif%>
+<%if(need_static_flags)%><%foreach(staticflags)%>
+<listOptionValue builtIn="false" value="<%staticflag%>"/>
+<%endfor%><%endif%>
+</option>
+<!--
+<option id="gnu.cpp.compiler.option.preprocessor.undef.1618336754" superClass="gnu.cpp.compiler.option.preprocessor.undef" valueType="undefDefinedSymbols">
+<listOptionValue builtIn="false" value="blah"/>
+</option>
+-->
+<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1095450641" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+</tool>
+<tool id="cdt.managedbuild.tool.gnu.c.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.1634417374" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>">
+<option id="mpc.generated.c.compiler.option.include.paths.1" superClass="<%c_compiler_option_superclass%>.include.paths" valueType="includePath">
+<%foreach(includes)%>
+<listOptionValue builtIn="false" value="<%if(!starts_with(include, [/\\\$]))%>../../<%endif%><%translate_vars(include, 1)%>"/>
+<%endfor%>
+</option>
+<option id="gnu.c.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.option.optimization.level.1822406061" name="Optimization Level" superClass="gnu.c.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.option.optimization.level" value="gnu.c.optimization.level.<%optimization_level%>" valueType="enumerated"/>
+<option id="gnu.c.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.option.debugging.level.1766929" name="Debug Level" superClass="gnu.c.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.option.debugging.level" value="gnu.c.debugging.level.<%debugging_level%>" valueType="enumerated"/>
+<option id="gnu.c.compiler.miscoptions.<%platform%>.<%configuration%>" superClass="gnu.c.compiler.option.misc.other" value="-c -fmessage-length=0 <%ccflags%>" valueType="string"/>
+<option id="gnu.c.compiler.option.preprocessor.def.<%platform%>.<%configuration%>" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
+<%foreach(defines common_defines cpu_defines platform_defines macros)%>
+<listOptionValue builtIn="false" value="<%define%>"/>
+<%endfor%>
+<%if(type_is_dynamic)%><%foreach(dynamicflags)%>
+<listOptionValue builtIn="false" value="<%dynamicflag%>"/>
+<%endfor%><%endif%>
+<%if(need_static_flags)%><%foreach(staticflags)%>
+<listOptionValue builtIn="false" value="<%staticflag%>"/>
+<%endfor%><%endif%>
+</option>
+<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1596535093" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+</tool>
+<%endif%><%comment(custom_only)%>
+</toolChain>
+</folderInfo>
+<%if(custom_only)%>
+<%create_aux_file(../, project_name, .mk)%>.PHONY: all clean
+all:
+
+clean:
+ <%rm%> <%if(starts_with(shell, cmd))%>$(subst /,\,$(GENERATED))<%else%>$(GENERATED)<%endif%><%if(starts_with(shell, cmd))%> 2>NUL<%endif%>
+
+SPACE := $(empty_variable) $(empty_variable)
+
+<%foreach(custom_types)%><%if(custom_type->libpath)%>
+<%libenv%> := $(<%libenv%>)<%pathsep%><%custom_type->libpath%>
+<%endif%><%foreach(custom_type->input_files)%><%if(custom_type->input_file->output_files)%>
+GENERATED +=<%foreach(custom_type->input_file->output_files)%> <%custom_type->input_file->output_file%><%endfor%>
+<%foreach(custom_type->input_file->output_files)%><%fornotfirst(" ")%><%if(flag_overrides(custom_type->input_file, gendir))%><%if(!compares(flag_overrides(custom_type->input_file, gendir),.))%><%flag_overrides(custom_type->input_file, gendir)%>/<%endif%><%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%endfor%>: <%custom_type->input_file%><%foreach(custom_type->input_file->dependencies)%> <%if(contains(custom_type->input_file->dependencie, [\s\$]))%>$(subst $(SPACE),\$(SPACE),<%custom_type->input_file->dependencie%>)<%else%><%custom_type->input_file->dependencie%><%endif%><%endfor%><%if(flag_overrides(custom_type->input_file, dependent))%><%foreach(dep, flag_overrides(custom_type->input_file, dependent))%> <%if(contains(dep, [\s\$]))%>$(subst $(SPACE),\$(SPACE),<%dep%>)<%else%><%dep%><%endif%><%if(!has_extension(dep))%><%exe%><%endif%><%endfor%><%else%><%foreach(custom_type->dependent)%> <%if(contains(custom_type->dependent, [\s\$]))%>$(subst $(SPACE),\$(SPACE),<%custom_type->dependent%>)<%else%><%custom_type->dependent%><%endif%><%if(!has_extension(custom_type->dependent))%><%exe%><%endif%><%endfor%><%endif%>
+<%if(flag_overrides(custom_type->input_file, gendir))%>
+<%if(!compares(flag_overrides(custom_type->input_file, gendir),.))%>
+ <%if(mkdir_pre)%><%mkdir_pre%> <%flag_overrides(custom_type->input_file, gendir)%> <%endif%><%mkdir%> <%flag_overrides(custom_type->input_file, gendir)%>
+<%endif%>
+<%endif%>
+ <%if(flag_overrides(custom_type->input_file, command))%><%flag_overrides(custom_type->input_file, command)%><%else%><%custom_type->command%><%endif%> <%if(flag_overrides(custom_type->input_file, commandflags))%><%flag_overrides(custom_type->input_file, commandflags)%><%else%><%custom_type->commandflags%><%endif%> <%if(custom_type->output_option)%><%custom_type->input_file%> <%custom_type->output_option%> $@<%else%><%custom_type->input_file%><%endif%>
+<%if(flag_overrides(custom_type->input_file, postcommand))%>
+ <%flag_overrides(custom_type->input_file, postcommand)%>
+<%else%>
+<%if(custom_type->postcommand)%>
+ <%custom_type->postcommand%>
+<%endif%>
+<%endif%>
+<%if(pch_header)%>
+<%if(custom_type->pch_postrule)%>
+<%foreach(custom_type->input_file->source_output_files)%>
+ @echo <%quote_echo%>#include "<%pch_header%>"<%quote_echo%> > <%makefile_tmpfile%> && <%cat%> "<%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%><%slash%><%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%>" >> <%makefile_tmpfile%> && <%mv%> <%makefile_tmpfile%> "<%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%><%slash%><%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%>"
+<%endfor%>
+<%endif%>
+<%endif%>
+<%endif%><%comment(has some output files)%><%endfor%><%comment(input_files)%><%endfor%><%comment(custom_types)%>
+all: $(GENERATED)
+<%end_aux_file%>
+<%else%><%comment(not custom_only)%>
+<%foreach(custom_types)%>
+<%foreach(custom_type->input_files)%>
+<%if(custom_type->input_file->output_files)%>
+<fileInfo id="mpc.generated.custfile.<%platform%>.<%configuration%>.<%custom_type%>.<%normalize(custom_type->input_file)%>"
+ name="<%custom_type->input_file%>"
+ rcbsApplicability="override"
+ resourcePath="<%custom_type->input_file%>"
+ toolsToInvoke="org.eclipse.cdt.managedbuilder.ui.rcbs.467489715">
+ <tool announcement="Invoking <%if(flag_overrides(custom_type->input_file, command))%><%translate_vars(flag_overrides(custom_type->input_file, command), 1)%><%else%><%translate_vars(custom_type->command, 1)%><%endif%> on <%custom_type->input_file%>"
+ command="<%shell%> ..<%slash%><%create_aux_file(platform, _, configuration, _, custom_type, _, normalize(custom_type->input_file), script_ext)%><%script_hdr%>
+<%comment(LIBPATH)%><%if(custom_type->libpath)%><%setenv%> <%libenv%>=<%envvar_pre%><%libenv%><%envvar_post%><%pathsep%><%translate_vars(custom_type->libpath)%>
+<%endif%>cd ..<%slash%>..
+<%comment(GENDIR)%><%if(flag_overrides(custom_type->input_file, gendir))%><%if(mkdir_pre)%><%mkdir_pre%> <%flag_overrides(custom_type->input_file, gendir)%> <%endif%><%mkdir%> <%flag_overrides(custom_type->input_file, gendir)%>
+<%endif%><%comment(COMMAND)%><%if(flag_overrides(custom_type->input_file, command))%><%translate_vars(flag_overrides(custom_type->input_file, command))%><%else%><%translate_vars(custom_type->command)%><%endif%> <%comment(COMMANDFLAGS)%><%if(flag_overrides(custom_type->input_file, commandflags))%><%translate_vars(flag_overrides(custom_type->input_file, commandflags))%><%else%><%if(custom_type->commandflags)%><%translate_vars(custom_type->commandflags)%><%endif%><%endif%> <%if(custom_type->output_option)%><%comment(with OUTPUT_OPTION)%>"<%custom_type->input_file%>" <%custom_type->output_option%><%foreach(custom_type->input_file->output_files)%> "<%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%><%slash%><%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%>"<%endfor%><%else%><%comment(without OUTPUT_OPTION)%>"<%custom_type->input_file%>"<%endif%><%comment(POSTCOMMAND)%><%if(flag_overrides(custom_type->input_file, postcommand))%> && <%flag_overrides(custom_type->input_file, postcommand)%><%else%><%if(custom_type->postcommand)%> && <%custom_type->postcommand%><%endif%><%endif%><%comment(PCH_POSTRULE)%><%if(pch_header)%><%if(custom_type->pch_postrule)%><%foreach(custom_type->input_file->source_output_files)%> && echo <%quote_echo%>#include "<%pch_header%>"<%quote_echo%> > <%script_tmpfile%> && <%cat%> "<%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%><%slash%><%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%>" >> <%script_tmpfile%> && <%mv%> <%script_tmpfile%> "<%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%><%slash%><%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%>"<%endfor%><%endif%><%endif%><%comment(LINK_SRCDIR_TO_OUTDIR)%><%if(custom_type->input_file->source_output_files)%> && cd cdt_<%project_name%><%slash%><%platform%>-<%configuration%><%endif%><%foreach(custom_type->input_file->output_files)%> && <%ln%> ..<%slash%>..<%slash%><%dirname(custom_type->input_file->output_file)%><%slash%><%basename(custom_type->input_file->output_file)%> .<%endfor%>
+<%end_aux_file%>"
+ customBuildStep="true"
+ id="mpc.generated.rcbs.<%platform%>.<%configuration%>.<%custom_type%>.<%normalize(custom_type->input_file)%>"
+ name="Resource Custom Build Step">
+ <inputType id="mpc.generated.rcbsinput.<%platform%>.<%configuration%>.<%custom_type%>.<%normalize(custom_type->input_file)%>"
+ name="Resource Custom Build Step Input Type">
+ <additionalInput kind="additionalinputdependency"
+<%comment(Need to apply translate_vars() on these three branches)%>
+<%if(flag_overrides(custom_type->input_file, dependent))%>
+ paths="<%foreach(dep, flag_overrides(custom_type->input_file, dependent))%><%translate_vars(dep, 1)%><%if(!has_extension(dep))%><%exe_ext%><%endif%><%fornotlast(";")%><%endfor%><%foreach(custom_type->input_file->dependencies)%>;<%translate_vars(custom_type->input_file->dependencie, 1)%><%endfor%>"/>
+<%else%>
+<%if(custom_type->dependent)%>
+ paths="<%foreach(custom_type->dependent)%><%translate_vars(custom_type->dependent, 1)%><%if(!has_extension(custom_type->dependent))%><%exe_ext%><%endif%><%fornotlast(";")%><%endfor%><%foreach(custom_type->input_file->dependencies)%>;<%translate_vars(custom_type->input_file->dependencie, 1)%><%endfor%>"/>
+<%else%>
+ paths="<%foreach(custom_type->input_file->dependencies)%><%translate_vars(custom_type->input_file->dependencie, 1)%><%fornotlast(";")%><%endfor%>"/>
+<%endif%>
+<%endif%>
+ </inputType>
+ <outputType
+ id="mpc.generated.rcbsoutput.<%platform%>.<%configuration%>.<%custom_type%>.<%normalize(custom_type->input_file)%>"
+ name="Resource Custom Build Step Output Type"
+ outputNames="<%foreach(custom_type->input_file->output_files)%><%if(flag_overrides(custom_type->input_file, gendir))%><%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%fornotlast(";")%><%endfor%>"/>
+ </tool>
+</fileInfo><%endif%><%comment(generates any output)%><%endfor%><%comment(input file)%><%endfor%><%comment(custom type)%>
+<sourceEntries>
+<%comment(we may need to change the source_output_files to just output_files below to align it with what's used above)%>
+<entry excluding="<%foreach(template_files)%><%template_file%>|<%endfor%><%foreach(custom_types)%><%foreach(custom_type->input_files)%><%foreach(custom_type->input_file->source_output_files)%><%custom_type->input_file->source_output_file%>|<%endfor%><%endfor%><%endfor%>" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+</sourceEntries>
+<%endif%><%comment(!custom_only)%>
+</configuration>
+</storageModule>
+<storageModule moduleId="scannerConfiguration">
+<!-- It's not clear what this section does, so it's not clear if it's necessary. In fact, experience suggests that CDT seems to fill in the blanks properly for the platform if it's empty. -->
+</storageModule>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+<%endfor%><%comment(configurations)%>
+<%endfor%><%comment(host_platform)%>
+<%endfor%><%comment(platforms)%>
+
+</storageModule>
+<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+<%foreach(platforms)%>
+<project
+ id="<%project_name%>.<%project_element_type_id%>.1"
+ name="<%project_type_name%>"
+ projectType="<%project_element_type_id%>.<%project_type%>"/>
+<%endfor%>
+</storageModule>
+</cproject>
+
diff --git a/templates/cdt6dll.mpt b/templates/cdt6dll.mpt
new file mode 100644
index 00000000..9ae5d283
--- /dev/null
+++ b/templates/cdt6dll.mpt
@@ -0,0 +1,6 @@
+conditional_include "cdt6platforms"
+
+configurations = debug release
+project_type_name = "Shared Library"
+project_type = so
+build_artefact_type = org.eclipse.cdt.build.core.buildArtefactType.sharedLib
diff --git a/templates/cdt6exe.mpt b/templates/cdt6exe.mpt
new file mode 100644
index 00000000..3d10fbfb
--- /dev/null
+++ b/templates/cdt6exe.mpt
@@ -0,0 +1,6 @@
+conditional_include "cdt6platforms"
+
+configurations = debug release
+project_type_name = Executable
+project_type = exe
+build_artefact_type = org.eclipse.cdt.build.core.buildArtefactType.exe
diff --git a/templates/cdt6lib.mpt b/templates/cdt6lib.mpt
new file mode 100644
index 00000000..ae226882
--- /dev/null
+++ b/templates/cdt6lib.mpt
@@ -0,0 +1,6 @@
+conditional_include "cdt6platforms"
+
+configurations = debug release
+project_type_name = "Static Library"
+project_type = lib
+build_artefact_type = org.eclipse.cdt.build.core.buildArtefactType.staticLib
diff --git a/templates/cdt6platforms.mpt b/templates/cdt6platforms.mpt
new file mode 100644
index 00000000..95fb5865
--- /dev/null
+++ b/templates/cdt6platforms.mpt
@@ -0,0 +1,170 @@
+// -*- MPC -*-
+//
+// Any of these platforms can be set using
+// -value_template platforms="blah blah blah"
+// when generating a CDT project/workspace combo. The default is to use the
+// platform that matches the host that's running MPC (see fill_value() in
+// CDT6ProjectCreator.pm).
+//
+
+//
+// Platforms
+//
+
+conditional_include "common"
+conditional_include "unixcommon" // We include this at the global b/c most
+ // platforms are unix-ish. windowscommon
+ // overrides these in the relevant scopes.
+
+// These will have platform_specializer appended if it's defined
+configuration_parent_root = cdt.managedbuild.config.gnu
+toolchain_superclass_root = cdt.managedbuild.toolchain.gnu
+toolchain_internal_builder_root = cdt.managedbuild.target.gnu.builder
+targetplatform_superclass = cdt.managedbuild.target.gnu.platform
+outputtype_superclass = cdt.managedbuild.tool.gnu.cpp.linker.so.debug.output
+
+// These are just defaults
+exe_ext_nodot =
+dll_ext_nodot = so
+lib_ext_nodot = a
+tool_name_prefix = GNU
+c_linker_tool_superclass_root = cdt.managedbuild.tool.gnu.c.linker // must have .so.debug appended
+cpp_linker_tool_superclass_root = cdt.managedbuild.tool.gnu.cpp.linker // must have .so.debug appended
+linker_option_superclass = gnu.cpp.link.option // must have .XXX appended
+cpp_compiler_option_superclass = gnu.cpp.compiler.option
+c_compiler_superclass = ???
+c_compiler_option_superclass = gnu.c.compiler.option
+project_element_type_id = cdt.managedbuild.target.gnu
+c_linker_dynamiclib_superclass = gnu.c.link.so.debug.option.shared
+cpp_linker_dynamiclib_superclass = gnu.cpp.link.so.debug.option.shared
+cpp_linker_tool_input_superclass = cdt.managedbuild.tool.gnu.cpp.linker.input
+
+linux {
+ binary_parsers = org.eclipse.cdt.core.ELF
+ error_parsers = org.eclipse.cdt.core.GASErrorParser org.eclipse.cdt.core.GLDErrorParser org.eclipse.cdt.core.GCCErrorParser
+ threadflags = -pthread
+ platform_libs += rt dl
+}
+
+// This scope serves as an example of a custom platform. On 64-bit linux,
+// you can compile a 32-bit binary by passing -m32 to gcc. Using this custom
+// platform, MPC can generate CDT projects that have "Build Configurations"
+// for both 64-bit and 32-bit. This would be enabled by running mwc.pl with
+// -value_template platforms="linux linux_m32"
+linux_m32 {
+ binary_parsers = org.eclipse.cdt.core.ELF
+ error_parsers = org.eclipse.cdt.core.GASErrorParser org.eclipse.cdt.core.GLDErrorParser org.eclipse.cdt.core.GCCErrorParser
+ ccflags += -m32
+ cxxflags += -m32
+ linkflags += -m32
+ threadflags = -pthread
+ platform_libs += rt dl
+}
+
+macosx {
+ dll_ext = .dylib
+ exe_ext_nodot =
+ dll_ext_nodot = dylib
+ lib_ext_nodot = a
+
+ binary_parsers = org.eclipse.cdt.core.MachO64
+ error_parsers = org.eclipse.cdt.core.GASErrorParser org.eclipse.cdt.core.GLDErrorParser org.eclipse.cdt.core.GCCErrorParser
+ host_platform = host_macosx
+ project_element_type_id = cdt.managedbuild.target.macosx
+ // platform_specializer gets added on to various things like configuration_parent_root, etc.
+ configuration_parent_root = cdt.managedbuild.config
+ platform_specializer = macosx
+ tool_name_prefix = "MacOS X"
+ linker_option_superclass = macosx.cpp.link.option
+ c_linker_dynamiclib_superclass = macosx.c.link.macosx.so.debug.option.shared
+ cpp_linker_dynamiclib_superclass = macosx.cpp.link.macosx.so.debug.option.shared
+ c_linker_tool_superclass_root = cdt.managedbuild.tool.macosx.c.linker.macosx // must have .so.debug appended
+ cpp_linker_tool_superclass_root = cdt.managedbuild.tool.macosx.cpp.linker.macosx // must have .so.debug appended
+cpp_linker_tool_input_superclass = cdt.managedbuild.tool.macosx.cpp.linker.input
+ outputtype_superclass = cdt.managedbuild.tool.macosx.cpp.linker.output.so
+}
+
+win32 {
+ conditional_include "windowscommon"
+
+ lib_prefix = lib // this is different from VC++ b/c we're using mingw
+
+ exe_ext_nodot = exe
+ dll_ext_nodot = dll
+ lib_ext_nodot = lib
+
+ platform_libs =
+ threadflags = -mthreads
+
+ binary_parsers = org.eclipse.cdt.core.PE
+ error_parsers = org.eclipse.cdt.core.GASErrorParser org.eclipse.cdt.core.GLDErrorParser org.eclipse.cdt.core.GCCErrorParser
+ host_platform = host_win32
+ project_element_type_id = cdt.managedbuild.target.gnu.mingw
+ platform_specializer = mingw
+ tool_name_prefix = MinGW
+ linker_option_superclass = gnu.cpp.link.option // must have .XXX appended
+ c_compiler_superclass = cdt.managedbuild.tool.gnu.c.compiler.mingw
+ c_linker_dynamiclib_superclass = gnu.c.link.mingw.so.debug.option.shared
+ cpp_linker_dynamiclib_superclass = gnu.cpp.link.mingw.so.debug.option.shared
+ c_linker_tool_superclass_root = cdt.managedbuild.tool.gnu.c.linker.mingw // must have .so.debug appended
+ cpp_linker_tool_superclass_root = cdt.managedbuild.tool.gnu.cpp.linker.mingw // must have .so.debug appended
+ cpp_linker_tool_input_superclass = cdt.managedbuild.tool.mingw.cpp.linker.input
+}
+
+cygwin {
+ binary_parsers = org.eclipse.cdt.core.PE
+ error_parsers = org.eclipse.cdt.core.GASErrorParser org.eclipse.cdt.core.GLDErrorParser org.eclipse.cdt.core.GCCErrorParser
+ host_platform = host_win32
+ platform_specializer = cygwin
+}
+
+solaris {
+ binary_parsers = org.eclipse.cdt.core.ELF
+ error_parsers = org.eclipse.cdt.core.GASErrorParser org.eclipse.cdt.core.GLDErrorParser org.eclipse.cdt.core.GCCErrorParser
+ platform_specializer = solaris
+}
+
+// default values for the host-specific variables, overridden below
+host_platform = linux
+libenv = LD_LIBRARY_PATH
+shell = sh
+script_ext = .sh
+script_hdr = #!/bin/sh
+script_tmpfile = temporary$$.src
+makefile_tmpfile = temporary$$$$.src
+setenv = export
+envvar_pre = $
+pathsep = :
+quote_echo = '
+ln = ln -sf
+
+host_macosx {
+ libenv = DYLD_LIBRARY_PATH
+}
+
+host_win32 {
+ libenv = PATH
+ shell = cmd /c
+ script_ext = .cmd
+ script_hdr = "@echo off & set TMPFILE=temporary%RANDOM%.src"
+ script_tmpfile = %TMPFILE%
+ makefile_tmpfile = temporary_mpc.src
+ setenv = set
+ envvar_pre = %
+ envvar_post = %
+ pathsep = ;
+ mkdir_pre = if not exist
+ ln = copy /y
+ quote_echo =
+}
+
+// Abstractions for different configurations
+release {
+ optimization_level = max
+ debugging_level = none
+}
+
+debug {
+ optimization_level = none
+ debugging_level = max
+} \ No newline at end of file
diff --git a/templates/cdt6project.mpd b/templates/cdt6project.mpd
new file mode 100644
index 00000000..f99d8b3d
--- /dev/null
+++ b/templates/cdt6project.mpd
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name><%project_name%></name>
+ <comment>Generated by MPC</comment>
+<%if(after)%>
+ <projects>
+ <!-- MPC ADD DEPENDENCIES -->
+ </projects>
+<%endif%>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>?name?</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.append_environment</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildArguments</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildCommand</key>
+ <value>make</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildLocation</key>
+ <value>${workspace_loc:/<%project_name%>/<%exeout%>}</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+ <value>clean</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.contents</key>
+ <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+ <value>false</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.stopOnError</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+ <value>true</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ </natures>
+ <linkedResources>
+<!-- source files -->
+<%foreach(source_files)%>
+ <link>
+ <name><%if(starts_with(source_file, \.\.))%><%basename(source_file)%><%else%><%source_file%><%endif%></name>
+ <type>1</type>
+ <location><%full_path(source_file)%></location>
+ </link>
+<%endfor%>
+<!-- header files -->
+<%foreach(header_files)%>
+ <link>
+ <name><%if(starts_with(header_file, \.\.))%><%basename(header_file)%><%else%><%header_file%><%endif%></name>
+ <type>1</type>
+ <location><%full_path(header_file)%></location>
+ </link>
+<%endfor%>
+<%if(pch_header)%>
+<!-- pch header -->
+ <link>
+ <name><%if(starts_with(pch_header, \.\.))%><%basename(pch_header)%><%else%><%pch_header%><%endif%></name>
+ <type>1</type>
+ <location><%full_path(pch_header)%></location>
+ </link>
+<%endif%>
+<!-- inline files -->
+<%foreach(inline_files)%>
+ <link>
+ <name><%if(starts_with(inline_file, \.\.))%><%basename(inline_file)%><%else%><%inline_file%><%endif%></name>
+ <type>1</type>
+ <location><%full_path(inline_file)%></location>
+ </link>
+<%endfor%>
+<!-- template files -->
+<%foreach(template_files)%>
+ <link>
+ <name><%if(starts_with(template_file, \.\.))%><%basename(template_file)%><%else%><%template_file%><%endif%></name>
+ <type>1</type>
+ <location><%full_path(template_file)%></location>
+ </link>
+<%endfor%>
+<!-- custom type files -->
+<%foreach(custom_types)%>
+<!-- begin files for <%custom_type%> -->
+<%foreach(custom_type->input_files)%>
+ <link>
+ <name><%if(starts_with(custom_type->input_file, \.\.))%><%basename(custom_type->input_file)%><%else%><%custom_type->input_file%><%endif%></name>
+ <type>1</type>
+ <location><%full_path(custom_type->input_file)%></location>
+ </link>
+<%endfor%>
+<!-- end files for <%custom_type%> -->
+<%endfor%>
+<%if(custom_only)%>
+ <link>
+ <name><%project_name%>.mk</name>
+ <type>1</type>
+ <location><%full_path(..)%>/<%project_name%>.mk</location>
+ </link>
+<%endif%>
+ </linkedResources>
+</projectDescription>