diff options
author | Adam Mitz <mitza-oci@users.noreply.github.com> | 2010-08-05 17:01:36 +0000 |
---|---|---|
committer | Adam Mitz <mitza-oci@users.noreply.github.com> | 2010-08-05 17:01:36 +0000 |
commit | 4ef1a5f5e86aac9aa76c3fc6f2cee1f22c4f2c8e (patch) | |
tree | 6cdef8df8eaf81b71ef34427a595999ea2a44357 | |
parent | d8025ca319f632f81f35614d14a1e73d909beddd (diff) | |
download | MPC-4ef1a5f5e86aac9aa76c3fc6f2cee1f22c4f2c8e.tar.gz |
ChangeLogTag: Thu Aug 5 17:00:23 UTC 2010 Adam Mitz <mitza@ociweb.com>
-rw-r--r-- | ChangeLog | 28 | ||||
-rw-r--r-- | docs/html/MakeProjectCreator.html | 13 | ||||
-rw-r--r-- | docs/html/WB30.html | 164 | ||||
-rw-r--r-- | docs/templates/wb26.txt | 14 | ||||
-rw-r--r-- | docs/templates/wb26wrmakefile.txt | 7 | ||||
-rw-r--r-- | docs/templates/wb26wrproject.txt | 53 | ||||
-rw-r--r-- | modules/CDT6WorkspaceCreator.pm | 5 | ||||
-rw-r--r-- | modules/TemplateParser.pm | 8 | ||||
-rw-r--r-- | modules/WB26WorkspaceCreator.pm | 32 | ||||
-rw-r--r-- | modules/WB30ProjectCreator.pm | 87 | ||||
-rw-r--r-- | modules/WB30WorkspaceCreator.pm | 41 | ||||
-rw-r--r-- | templates/wb26.mpd | 25 | ||||
-rw-r--r-- | templates/wb26dll.mpt | 21 | ||||
-rw-r--r-- | templates/wb26wrmakefile.mpd | 160 | ||||
-rw-r--r-- | templates/wb26wrproject.mpd | 145 | ||||
-rw-r--r-- | templates/wb30cproject.mpd | 29 | ||||
-rw-r--r-- | templates/wb30dll.mpt | 70 | ||||
-rw-r--r-- | templates/wb30exe.mpt | 4 |
18 files changed, 781 insertions, 125 deletions
@@ -1,3 +1,31 @@ +Thu Aug 5 17:00:23 UTC 2010 Adam Mitz <mitza@ociweb.com> + + * docs/html/MakeProjectCreator.html: + * docs/html/WB30.html: + * docs/templates/wb26.txt: + * docs/templates/wb26wrmakefile.txt: + * docs/templates/wb26wrproject.txt: + * modules/CDT6WorkspaceCreator.pm: + * modules/TemplateParser.pm: + * modules/WB26WorkspaceCreator.pm: + * modules/WB30ProjectCreator.pm: + * modules/WB30WorkspaceCreator.pm: + * templates/wb26.mpd: + * templates/wb26dll.mpt: + * templates/wb26wrmakefile.mpd: + * templates/wb26wrproject.mpd: + * templates/wb30cproject.mpd: + * templates/wb30dll.mpt: + * templates/wb30exe.mpt: + + Merged (reintegrated) the "wb30" branch, which adds -type wb30 + for Wind River Workbench 3.0. See WB30.html for details. + + This also effectively reverts the commit in + Fri Jul 9 21:16:23 UTC 2010 Adam Mitz <mitza@ociweb.com> + because that change was incorrect (-into shouldn't affect the + file's contents). + Thu Aug 5 03:49:19 UTC 2010 Chad Elliott <elliott_c@ociweb.com> * config/glib.mpb: diff --git a/docs/html/MakeProjectCreator.html b/docs/html/MakeProjectCreator.html index eecc8900..d157f5f2 100644 --- a/docs/html/MakeProjectCreator.html +++ b/docs/html/MakeProjectCreator.html @@ -5444,6 +5444,19 @@ <tr> <td rowspan="1" colspan="1"> <p class="Tbl-Body"><em class= + "TableCode">deref</em></p> + </td> + + <td rowspan="1" colspan="1"> + <p class="Tbl-Body">Dereference the variable passed as + a parameter, treating its value as another variable + name and returning that variable's value.</p> + </td> + </tr> + + <tr> + <td rowspan="1" colspan="1"> + <p class="Tbl-Body"><em class= "TableCode">dirname</em></p> </td> diff --git a/docs/html/WB30.html b/docs/html/WB30.html new file mode 100644 index 00000000..c9baf7e2 --- /dev/null +++ b/docs/html/WB30.html @@ -0,0 +1,164 @@ +<!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: WB30 Project Type</title> +</head> + +<body> +<div> + <h1 class="Head1">WB30 Project Type documentation</h1> + + <div> + <h3 class="Head2">Background/Abstract</h3> + <li class="body">The <em>WB30 Project Type</em> generates project files + utilizable by Wind River Workbench, version 3.0. Workbench is built + on the Eclipse platform and inherits many of its features. In this + document, "eclipse" is used at times to describe features common to + both eclipse itself and workbench. + The project type generates workbench projects from generic mpc + files. These workbench projects can then be imported into a user's + workspace and built using the workbench "managed flexible build".</li> + + <li class="body">MPC's WB30 Project Type currently supports Linux + and Windows as both host and target platforms. It can be extended to + support other platforms as well.</li> + </div> + + <div> + <h3 class="Head2">Usage</h3> + For every <code>project <var>myprojname</var> { }</code> in mpc files, the + WB30 project type + generates a corresponding "workbench project" directory of the form + <samp>wb_<var>myprojname</var></samp>. The WB30 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 wb30</samp>.</li> + <li>Import projects into a Workbench workspace. From within Workbench + (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 MPC workspace.</li> + <li>Workbench will scan all the subdirectories looking for existing + projects.</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 Workbench can get confused with file + paths sometimes (though sometimes it will work).</li> + <li>Click <strong>Finish</strong> to proceed with the import.</li> + </ol> + </ol> + + <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>. + +</div> + +<div> + <h3 class="Head2">Platforms and Buildspecs</h3> + The default platform for WB30 is called "Native" and corresponds to creating + a project in Workbench using File -> New -> Native Application Project. + Although this method doesn't have (in workbench) any direct support for + building shared libraries, MPC does generate projects that pass the correct + compiler and linker flags to create shared (dynamic) libraries. Selecting + static or shared libraries with WB30 works the same as with any other MPC + project type.<p/> + The alternative platform, "VxWorks" can be selected by passing the option + <code>-value_template platform=VxWorks</code> on the mwc.pl command line. + Currently the VxWorks support is inherited from the existing + <code>-type wb26</code> template, so it may need some more work before it is + production-ready. Note that the wb26 template supported only DKM projects for + VxWorks (Downloadable Kernel Modules).<p/> + Each platform includes a list of supported buildspecs, and a single default + buildspec. For the "Native" platform, the list of supported buildspecs is: + <ul> + <li>Linux_gnu_native_3.x_4.x</li> + <li>Windows_gnu_native_3.x_4.x</li> + </ul> + Users can select the list of buildspecs by passing the option + <code>-value_template buildspecs=<specs></code> on the mwc.pl command + line, where <specs> is replaced by the buildspec value or values. + Multiple values are separated by spaces (with the entire specs string + enclosed in quotes). Similarly, the default buildspec can be selected with + <code>-value_template default_buildspec=<spec></code>.<p/> + New buildspecs (or even platforms) can be added by either editing the file + <code>$MPC_ROOT/templates/wb30dll.mpt</code> (if the modification will be + submitted back to the public MPC repository), or creating a file named + <code>user_wb30dll.mpt</code> anywhere on the MPC -include search path. + Within either of these files, create a scope for the platform/buildspec and + use assignment statements within that scope to set the various template + variables. The existing buildspecs serve as the best examples.</p> +</div> + +<div> +</div> + <div> + <h3 class="Head2">Notes</h3> + <ol> + <li> + MPC doesn't directly generate Workbench workspaces, because they depend + on an unknown binary file format that it can't generate. Instead of + generating files that can be loaded as a Workbench workspace, MPC + generates two files representing the workspace: + <ol> + <li>wb30projects.lst</li> + <li>org.eclipse.core.resources.prefs</li> + </ol> + wb30projects.lst contains comment lines (starting with #) followed by + one line per project, listing the full path to the .project file.<br/> + org.eclipse.core.resources.prefs also begins with comment lines + (starting with #) follwed by the contents of one of the files from + Eclipse's workspace format, specifically: + <code>.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs</code> + Unfortunately, this file alone is not enough to actually constitute a + workspace because Eclipse uses other binary files in this .settings + directory. + </li> + + <li><a name="fullpath"></a>WB30 uses Eclipse's <em>linked resource</em> + feature to work around the usual requirement that + all source code reside in Workbench project directories. These + act similar to symbolic links. While convenient so that a + developer is not required to conform to Workbench'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 WB30 projects get generated, the source directory can + not move in the filesystem without re-generating the projects.</li> + + <li><a name="remove_projects"></a>MPC's WB30 Project Generator + creates directories named <samp>wb_*</samp> for projects. + To remove all WB30 projects from a + directory hierarchy, on Linux you can use a command such as: +<pre> + $ find . -name 'wb_*' -type d | xargs rm -rf +</pre> + </li> + + </ol> + </div> + +</div> + + +<hr> + +</body> </html> diff --git a/docs/templates/wb26.txt b/docs/templates/wb26.txt index fa029ae2..2f62ef23 100644 --- a/docs/templates/wb26.txt +++ b/docs/templates/wb26.txt @@ -1,12 +1,8 @@ -// Current as of 3/31/2008 -// This defines the role of all the template variables specific to the -// 'wb26wrproject' template. // +// Document template variables for templates templates/wb26.mpd. // Please try to keep this alphabetically sorted. // -common_defines = Specifies macros that are common to all target types. -defines = Macros that are specific to a particular configuration. -enable_subprojects = Enable the generation of subprojects -link_groups = A boolean template variable that determines if the GNU linker specific --start-group and --end-group options are used. -linkflags = Platform specific flags passed during the linking of dynamic libraries and executables. -standard_build = Specify that you want to use standard build instead of flexible build +additional_natures = Eclipse natures that should appear in the .project file +disable_subprojects = Disables generation of subprojects (.wrproject) and project references (.project) +project_prefix = Prefix for the project names and the MPC-created directory that contains .project, .wrproject, etc. +standard_build = Specify that you want to use standard build instead of flexible build (not tested with -type wb30) diff --git a/docs/templates/wb26wrmakefile.txt b/docs/templates/wb26wrmakefile.txt new file mode 100644 index 00000000..0d138fae --- /dev/null +++ b/docs/templates/wb26wrmakefile.txt @@ -0,0 +1,7 @@ +// +// Document template variables for templates templates/wb26wrmakefile.mpd. +// Please try to keep this alphabetically sorted. +// +buildspecs = List of possible build specifications +dll_prefix = Prefix for shared/dynamic libraries +platform_makefilevars = Platform-specific variables that should have \ to / translation done in the makefile diff --git a/docs/templates/wb26wrproject.txt b/docs/templates/wb26wrproject.txt new file mode 100644 index 00000000..bf1cef0a --- /dev/null +++ b/docs/templates/wb26wrproject.txt @@ -0,0 +1,53 @@ +// +// Document template variables for templates templates/wb26wrproject.mpd. +// Please try to keep this alphabetically sorted. +// +ar = Tool that creates archive libraries +ar_dbgflags = Flags passed to ar in debug mode only +ar_derivedsigs = File extension created by ar +ar_flags = Flags passed to ar regardless of debug mode +ar_nondbgflags = Flags passed to ar in non-debug mode +ass_dbgflags = Flags passed to the assembler in debug mode only +ass_derivedsigs = File extension created by the assembler +ass_flags = Flags passed to the assembler regardless of debug mode +ass_nondbgflags = Flags passed to the assembler in non-debug mode +c_dbgflags = C compiler flags for debug mode +c_derivedsigs = C compiler output file pattern +c_flags = C compiler flags regardless of debug mode +c_nondbgflags = C compiler flags for non-debug mode +cc = C compiler +clnk_derivedsigs = C linker output file pattern +common_defines = Specifies macros that are common to all target types +cxx = C++ compiler +cxx_dbgflags = C++ compiler flags for debug mode +cxx_derivedsigs = C++ compiler output file pattern +cxx_flags = C++ compiler flags regardless of debug mode +cxx_nondbgflags = C++ compiler flags for non-debug mode +cxxlnk_derivedsigs = C++ linker output file pattern +default_buildspec = Which buildspec from the buildspecs should be default +defines = Specifies macros that are common to all target types +dll_buildtool = Name of the tool to use to create shared/dynamic libraries (for example, C++-Linker or C-Linker) +dll_prefix = Prefix for shared/dynamic libraries +exe_buildtool = Name of the tool to use to create executables (for example, C++-Linker or C-Linker) +librarian_objects = Object file list to use as input to the archiver/librarian +link_groups = A boolean template variable that determines if the GNU linker specific --start-group and --end-group options are used for the VxWorks Partial Image Linker +linker_dbgflags = Linker flags for debug mode (VxWorks) +linker_flags = Linker flags regardless of debug mode (VxWorks) +linker_nondbgflags = Linker flags for non-debug mode (VxWorks) +munchflag = Flags for the VxWorks munch TCL script +nm = nm utility (VxWorks) +no_platform_in_wrproject = If enabled, the platform attribute of the wrxml/properties XML element in .wrproject is empty. +part_dbgflags = Debug flags for the VxWorks Partial Image Linker +part_derivedsigs = Outupt file patterns for the VxWorks Partial Image Linker +part_flags = Flags for the VxWorks Partial Image Linker +part_nondbgflags = Non-debug flags for the VxWorks Partial Image Linker +pic = Special flags needed to build objects that will become part of a shared library (-fPIC on Linux) +platform_asflags = Assembler flags common to the platform or buildspec +platform_ccflags = C compiler flags common to the platform or buildspec +platform_cxxflags = C++ compiler flags common to the platform or buildspec +platform_includes = Include directories common to the platform or buildspec +platform_name = Value of the platform_name attribute of the wrxml/properties XML element in .wrproject +project_type = Value of the project_type attribute of the wrxml/properties XML element in .wrproject +project_type_macro = Value of the PROJECT_TYPE macro in the GlobalMacro list +shflags = Flags passed to the linker to create a shared/dynamic libraries instead of an executable +wrprj_macros = List of Macros for the BLD::Info|Macros section of the .wrproject. Each element in this list will in turn be de-referenced (used as an MPC template variable name) to obtain its values. LIBPATH and LIBS has special treatment here to get -L and -l prepended. diff --git a/modules/CDT6WorkspaceCreator.pm b/modules/CDT6WorkspaceCreator.pm index 4c4e3bf7..b1d5339f 100644 --- a/modules/CDT6WorkspaceCreator.pm +++ b/modules/CDT6WorkspaceCreator.pm @@ -66,11 +66,10 @@ sub write_comps { my $crlf = $self->crlf(); $self->{'seen_deps'} = {}; - my $prefix = ($self->{'into'} ne '') ? $self->{'into'} . '/' : ''; foreach my $project ($self->sort_dependencies($self->get_projects(), 0)) { my($pname, $rawdeps, $guid, $language, $custom_only, $nocross, $managed, @cfgs) = @{$$info{$project}}; print $fh "$pname ", - Cwd::abs_path($prefix . $self->mpc_dirname($project)), '/.project', $crlf; + Cwd::abs_path($self->mpc_dirname($project)), '/.project', $crlf; $self->add_dependencies($creator, $project); } } @@ -78,6 +77,8 @@ sub write_comps { sub add_dependencies { my($self, $creator, $proj) = @_; my $outdir = $self->mpc_dirname($proj); + my $into = $self->get_outdir(); + $outdir = "$into/$outdir" if $into ne '.'; my $pre = ' <project>'; my $post = '</project>'; diff --git a/modules/TemplateParser.pm b/modules/TemplateParser.pm index b22190ff..9c1eb56f 100644 --- a/modules/TemplateParser.pm +++ b/modules/TemplateParser.pm @@ -81,6 +81,7 @@ my %keywords = ('if' => 0, 'translate_vars' => 2 | 1, 'convert_slashes' => 2, 'new_guid' => 0, + 'deref' => 0, 'set' => 0, ); @@ -1885,6 +1886,13 @@ sub handle_new_guid { } +sub handle_deref { + my($self, $name) = @_; + my $val = $self->get_value_with_default($self->get_value_with_default($name)); + $self->append_current($val); +} + + sub handle_set { my($self, $val) = @_; my @params = $self->split_parameters($val); diff --git a/modules/WB26WorkspaceCreator.pm b/modules/WB26WorkspaceCreator.pm index 92c04e58..4d7a2dc7 100644 --- a/modules/WB26WorkspaceCreator.pm +++ b/modules/WB26WorkspaceCreator.pm @@ -37,6 +37,14 @@ sub workspace_file_name { return 'org.eclipse.core.resources.prefs'; } +sub get_id_for_comment { + return '$Id$'; +} + +sub get_project_prefix { + return ''; +} + sub pre_workspace { my($self, $fh) = @_; my $crlf = $self->crlf(); @@ -46,14 +54,14 @@ sub pre_workspace { '#----------------------------------------------------------------------------', $crlf, '# WindRiver Workbench generator', $crlf, '#', $crlf, - '# $Id$', $crlf, + '# ', $self->get_id_for_comment(), $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, - '# This file should be placed in the .metadata\.plugins\org.eclipse.core.runtime\.settings directory', $crlf, + '# This file should be placed in the .metadata/.plugins/org.eclipse.core.runtime/.settings directory', $crlf, '#', $crlf, '# MPC Command:', $crlf, - "# $0 @ARGV", $crlf, + "# ", $self->create_command_line_string($0, @ARGV), $crlf, '#----------------------------------------------------------------------------', $crlf); ## Unchanging initial settings @@ -66,11 +74,12 @@ sub write_comps { my($self, $fh) = @_; my $pjs = $self->get_project_info(); my @list = $self->sort_dependencies($self->get_projects(), 0); + my $pre = $self->get_project_prefix(); ## Print out the target print $fh 'description.buildorder='; foreach my $project (@list) { - print $fh "$$pjs{$project}->[0]/"; + print $fh "$pre$$pjs{$project}->[0]/"; } print $fh $self->crlf(); } @@ -106,25 +115,26 @@ sub list_file_body { '#----------------------------------------------------------------------------', $crlf, '# WindRiver Workbench generator', $crlf, '#', $crlf, - '# $Id$', $crlf, + '# ', $self->get_id_for_comment() , $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, '# MPC Command:', $crlf, - "# $0 @ARGV", $crlf, + "# ", $self->create_command_line_string($0, @ARGV), $crlf, '#----------------------------------------------------------------------------', $crlf); ## Print out each target separately - my $prefix = ($self->{'into'} ne '') ? $self->{'into'} . '/' : ''; foreach my $project ($self->sort_dependencies($self->get_projects(), 0)) { - print $fh Cwd::abs_path($prefix . $self->mpc_dirname($project)), - '/.project', $crlf; + print $fh Cwd::abs_path($self->mpc_dirname($project)), '/.project', $crlf; } } sub add_dependencies { my($self, $creator, $proj) = @_; my $outdir = $self->mpc_dirname($proj); + my $into = $self->get_outdir(); + $outdir = "$into/$outdir" if $into ne '.'; + my $proj_pre = $self->get_project_prefix(); ## These values will be changed after the first time through the for ## loop below. @@ -164,7 +174,9 @@ sub add_dependencies { ## 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); + if (defined $relative) { + unshift(@lines, "$pre$proj_pre$dep$post$crlf"); + } ## We've now seen this dependency and all of the ## projects upon which this one depends. diff --git a/modules/WB30ProjectCreator.pm b/modules/WB30ProjectCreator.pm new file mode 100644 index 00000000..cfe2238b --- /dev/null +++ b/modules/WB30ProjectCreator.pm @@ -0,0 +1,87 @@ +package WB30ProjectCreator; + +# ************************************************************ +# Description : Wind River Workbench 3.0 generator +# Author : Adam Mitz (Object Computing, Inc.) +# Create Date : 07/21/2010 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; + +use WB26ProjectCreator; +use XMLProjectBase; + +use vars qw(@ISA); +@ISA = qw(XMLProjectBase WB26ProjectCreator); + +# ************************************************************ +# Data Section +# ************************************************************ + +my %templates = ('wb26' => '.project', + 'wb26wrproject' => '.wrproject', + 'wb26wrmakefile' => '.wrmakefile', + 'wb30cproject' => '.cproject'); + +my @tkeys = sort keys %templates; + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +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 = 'wb26' if (!defined $template || !defined $templates{$template}); + + if ($self->{'make_coexistence'}) { + return $self->get_modified_project_file_name("wb_$name", + '/' . $templates{$template}); + } + else { + return $templates{$template}; + } +} + +sub post_file_creation { + my($self, $file) = @_; + if ($file =~ /$templates{'wb26wrmakefile'}$/) { + open IN, $file or die "Can't open $file for post-processing input."; + my @lines; + while (<IN>) { + s/\\"/\\"/g; + s/"/"/g; + s/>/>/g; + s/</</g; + s/&/&/g; + push @lines, $_; + } + close IN; + open OUT, ">$file" or die "Can't open $file for post-processing output."; + print OUT @lines; + close OUT; + } +} + +sub get_template { + #my $self = shift; + return @tkeys; +} + +sub get_dll_exe_template_input_file { + #my $self = shift; + return 'wb30exe'; +} + +sub get_dll_template_input_file { + #my $self = shift; + return 'wb30dll'; +} + +1; diff --git a/modules/WB30WorkspaceCreator.pm b/modules/WB30WorkspaceCreator.pm new file mode 100644 index 00000000..00a4a449 --- /dev/null +++ b/modules/WB30WorkspaceCreator.pm @@ -0,0 +1,41 @@ +package WB30WorkspaceCreator; + +# ************************************************************ +# Description : Wind River Workbench 3.0 generator +# Author : Adam Mitz (Object Computing, Inc.) +# Create Date : 07/21/2010 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; + +use WB26WorkspaceCreator; +use WB30ProjectCreator; + +use vars qw(@ISA); +@ISA = qw(WB26WorkspaceCreator); + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub get_id_for_comment { + return '$Id$'; +} + +sub get_project_prefix { + return 'wb_'; +} + +sub get_additional_output { + ## Create the accompanying list file. It always goes in the same + ## directory as the first workspace output file. See + ## WorkspaceCreator.pm for a description of the array elements. + return [[undef, 'wb30projects.lst', \&WB26WorkspaceCreator::list_file_body]]; +} + + +1; diff --git a/templates/wb26.mpd b/templates/wb26.mpd index 7a3dd96c..46b15b89 100644 --- a/templates/wb26.mpd +++ b/templates/wb26.mpd @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <projectDescription> - <name><%project_name%></name> - <comment></comment> -<%if(after && enable_subprojects && exename)%> + <name><%project_prefix%><%project_name%></name> + <comment>Generated by MPC</comment> +<%if(after && !disable_subprojects)%> <projects> <!-- MPC ADD DEPENDENCIES --> </projects> @@ -17,6 +17,9 @@ <natures> <nature>com.windriver.ide.core.wrnature</nature> <nature>com.windriver.ide.core.wrcorenature</nature> +<%foreach(additional_natures)%> + <nature><%additional_nature%></nature> +<%endfor%> </natures> <%if(!standard_build && make_coexistence)%> <linkedResources> @@ -34,6 +37,13 @@ <location><%full_path(header_file)%></location> </link> <%endfor%> +<%if(pch_header)%> + <link> + <name><%pch_header%></name> + <type>1</type> + <location><%full_path(pch_header)%></location> + </link> +<%endif%> <%foreach(inline_files)%> <link> <name><%inline_file%></name> @@ -48,6 +58,15 @@ <location><%full_path(template_file)%></location> </link> <%endfor%> +<%foreach(custom_types)%> +<%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%> +<%endfor%> </linkedResources> <%endif%> </projectDescription> diff --git a/templates/wb26dll.mpt b/templates/wb26dll.mpt index d51bf4f2..a9b78dc7 100644 --- a/templates/wb26dll.mpt +++ b/templates/wb26dll.mpt @@ -15,8 +15,22 @@ part_derivedsigs = *.o ar_derivedsigs = .a platform = VxWorks -platform_name = vxworks-6.4 -project_type = DownloadableKernelModuleProject + +VxWorks { + platform_name = vxworks-6.4 + project_type = DownloadableKernelModuleProject + platform_includes = $(WIND_BASE)/target/h $(WIND_BASE)/target/h/wrn/coreip + platform_makefilevars = WIND_BASE WIND_USR + wrprj_macros = VX_CPU_FAMILY CPU TOOL_FAMILY TOOL TOOL_PATH CC_ARCH_SPEC + buildspecs = PPC604gnu PPC603gnu PENTIUM4gnu PPC85XXgnu + default_buildspec = PPC604gnu + platform_asflags = -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL + platform_cxxflags = -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL + platform_ccflags = -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL + librarian_objects = @$(PRJ_ROOT_DIR)/filelist.txt + exe_buildtool = Linker + project_type_macro = DKM +} linkflags = includedir = @@ -25,9 +39,6 @@ includedir = // Build Specs Section // *********************************************************************** -buildspecs = PPC604gnu PPC603gnu PENTIUM4gnu PPC85XXgnu -default_buildspec = PPC604gnu - PPC603gnu { cc_arch_spec = -mcpu=603 -mstrict-align -mno-implicit-fp -D_WRS_HARDWARE_FP -mlongcall cpu = PPC603 diff --git a/templates/wb26wrmakefile.mpd b/templates/wb26wrmakefile.mpd index 5660109c..039fd272 100644 --- a/templates/wb26wrmakefile.mpd +++ b/templates/wb26wrmakefile.mpd @@ -1,11 +1,12 @@ -# The file ".wrmakefile" is the template used by the Wind River Workbench to +<%foreach(platform)%><%comment(there can't be more than one active platform but using a foreach allows platform settings to be grouped in scopes in the mpt files)%># The file ".wrmakefile" is the template used by the Wind River Workbench to # generate the makefiles of this project. Add user-specific build targets and # make rules only(!) in this project's ".wrmakefile" file. These will then be # automatically dumped into the makefiles. WIND_HOME := $(subst \,/,$(WIND_HOME)) -WIND_BASE := $(subst \,/,$(WIND_BASE)) -WIND_USR := $(subst \,/,$(WIND_USR)) +<%foreach(platform_makefilevars)%> +<%platform_makefilevar%> := $(subst \,/,$(<%platform_makefilevar%>)) +<%endfor%> ACE_ROOT := $(subst \,/,$(ACE_ROOT)) TAO_ROOT := $(subst \,/,$(TAO_ROOT)) CIAO_ROOT := $(subst \,/,$(CIAO_ROOT)) @@ -16,30 +17,38 @@ ACE_LIBOUT := <%if(dllout)%><%dllout%><%else%><%libout%><%endif%> <%endif%> <%endif%> <%if(exename)%> -<%if(exeout)%> -ACE_EXEOUT := <%exeout%> -<%endif%> +ACE_EXEOUT := <%exeout(".")%> <%endif%> +ACE_EXE_EXT = <%foreach(buildspecs)%>$(if $(filter <%buildspec%>,$(BUILD_SPEC)),<%exe_ext%>)<%endfor%> <%if(exename)%> ACE_TARGET_PREFIX := ACE_TARGET_NAME := <%exename%> -ACE_TARGET_EXT := <%exe_ext%> -PROJECT_TARGET=$(filter %<%exe_ext%>,$(PROJECT_TARGETS)) +ACE_TARGET_EXT = $(ACE_EXE_EXT) +PROJECT_TARGET = $(if $(ACE_TARGET_EXT),$(filter %$(ACE_TARGET_EXT),$(PROJECT_TARGETS)),$(PROJECT_TARGETS)) <%else%> -<%if(sharedname || staticname)%> -ACE_TARGET_PREFIX := <%lib_prefix%> -ACE_TARGET_NAME := <%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%> -ACE_TARGET_EXT := <%lib_ext%> -PROJECT_TARGET=$(filter %<%lib_ext%>,$(PROJECT_TARGETS)) +<%if(sharedname && !compares(platform, VxWorks))%> +ACE_TARGET_DIR = $(ACE_TARGET_NAME)_$(BUILD_SPEC) +ACE_TARGET_PREFIX = <%foreach(buildspecs)%>$(if $(filter <%buildspec%>,$(BUILD_SPEC)),<%dll_prefix%>)<%endfor%> +ACE_TARGET_NAME := <%sharedname%> +ACE_TARGET_EXT = <%foreach(buildspecs)%>$(if $(filter <%buildspec%>,$(BUILD_SPEC)),<%dll_ext%>)<%endfor%> +PROJECT_TARGET = $(filter %$(ACE_TARGET_EXT),$(PROJECT_TARGETS)) +<%else%> +<%if(staticname || sharedname)%> +ACE_TARGET_PREFIX = <%foreach(buildspecs)%>$(if $(filter <%buildspec%>,$(BUILD_SPEC)),<%lib_prefix%>)<%endfor%> +ACE_TARGET_NAME := <%staticname%> +ACE_TARGET_EXT = <%foreach(buildspecs)%>$(if $(filter <%buildspec%>,$(BUILD_SPEC)),<%lib_ext%>)<%endfor%> +PROJECT_TARGET = $(filter %$(ACE_TARGET_EXT),$(PROJECT_TARGETS)) +<%endif%> <%endif%> <%endif%> +ACE_TARGET_DIR ?= $(ACE_TARGET_NAME) <%if(custom_only)%> -PROJECT_TARGET=CUSTOM_ONLY +PROJECT_TARGET = CUSTOM_ONLY <%endif%> -<%if(standard_build && exename)%> -DEPLIBS = $(foreach lib,<%foreach(libs)%> <%libname_prefix%><%lib%><%endfor%> <%lit_libs%>, $(foreach libpath,<%foreach(libpaths)%><%if(targetoutdir)%> <%libpath%>/<%targetoutdir%><%endif%> <%libpath%><%endfor%>, $(wildcard $(libpath)/lib$(lib).a))) +<%if(libs && libpaths && exename && need_staticflags)%> +DEPLIBS = $(foreach lib,<%foreach(libs)%> <%libname_prefix%><%lib%><%endfor%> <%lit_libs%>, $(foreach libpath,<%foreach(libpaths)%><%if(!standard_build)%> <%if(make_coexistence)%>../../<%else%>../<%endif%><%libpath%><%endif%> <%libpath%><%endfor%>, $(wildcard $(libpath)/lib$(lib).a))) <%endif%> <%if(standard_build)%> @@ -57,6 +66,10 @@ _clean :: <%if(standard_build && exename)%> $(OBJ_DIR)/<%exename%>_partialImage.o : $(OBJECTS) $(SUB_OBJECTS) $(DEPLIBS) +<%else%> +<%if(!standard_build && libs && libpaths && exename && need_staticflags)%> +$(ACE_TARGET_DIR)/$(MODE_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT): $(DEPLIBS) +<%endif%> <%endif%> <%if(!standard_build)%> @@ -74,7 +87,7 @@ main_all : check_objectdir external_build $(PROJECT_TARGETS) <%else%> main_all : external_build $(PROJECT_TARGETS) <%endif%> - @echo "make: built targets of `pwd`" + @echo "make: built targets of `pwd`" <%endif%> <%if(standard_build)%> @@ -97,6 +110,10 @@ external_build :: @echo "" # main entry point for pre processing prior to the build +<%if(prebuild)%> +pre_build :: + @<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%><%eval(prebuild)%> +<%endif%> <%if(standard_build)%> ACE_ALL_OBJECTS := $(SUB_OBJECTS) $(OBJECTS) ifneq ($(PROJECT_TARGET),) @@ -129,15 +146,63 @@ pre_build :: $(PRE_BUILD_STEP) done <%endif%> + +# function for generating the correct Custom type Prerequisite (input or dep) +# using a ../ or ../../ prefix unless it's already an absolute path +CUST_PRE = <%if(!standard_build)%>$(if $(patsubst $%,,$(1:/%=)),<%if(make_coexistence)%>../../<%else%>../<%endif%>)$(1)<%else%>$(1)<%endif%> + +# function for adding an exe_ext, if needed and the file exists +ADD_EXT = $(if $(ACE_EXE_EXT),$(if $(suffix $(1)),$(1),$(wildcard $(1) $(1)$(ACE_EXE_EXT))),$(1)) + +<%if(custom_types)%> +SPACE = $(should_be_unset) $(should_be_unset) +GENERATED_DIRTY =<%if(!standard_build)%> $(addprefix <%if(make_coexistence)%>../../<%else%>../<%endif%>,<%endif%><%foreach(custom_types)%><%foreach(custom_type->input_files)%><%if(custom_type->input_file->output_files)%><%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%><%endif%><%endfor%><%endfor%><%if(!standard_build)%>)<%endif%> +<%else%> +GENERATED_DIRTY = +<%endif%> + # entry point for generating sources prior to the build <%if(standard_build)%> ifneq ($(PROJECT_TARGET),) <%endif%> -generate_sources :: +generate_sources :: $(GENERATED_DIRTY) + <%foreach(custom_types)%> +<%if(custom_type->libpath)%> +LD_LIBRARY_PATH := $(LD_LIBRARY_PATH):<%custom_type->libpath%> +PATH := $(PATH):<%custom_type->libpath%> +<%endif%> + <%foreach(custom_type->input_files)%> <%if(custom_type->input_file->output_files)%> - <%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ;<%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%> <%custom_type->input_file%> <%if(custom_type->output_option)%><%custom_type->output_option%> $@<%endif%> +<%if(multiple(custom_type->input_file->output_files))%> +.NOTPARALLEL: +<%endif%> +<%if(!standard_build)%>$(addprefix <%if(make_coexistence)%>../../<%else%>../<%endif%>,<%endif%><%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%><%fornotlast(" ")%><%endfor%><%if(!standard_build)%>)<%endif%>: $(foreach pre,<%custom_type->input_file%><%if(custom_type->input_file->dependencies)%><%foreach(custom_type->input_file->dependencies)%><%if(contains(custom_type->input_file->dependencie, \$))%> $(subst $(SPACE),\$(SPACE),<%custom_type->input_file->dependencie%>)<%else%> <%scope(enter, escape, \\s)%><%custom_type->input_file->dependencie%><%scope(leave)%><%endif%><%endfor%><%endif%><%if(flag_overrides(custom_type->input_file, dependent))%><%foreach(dep, flag_overrides(custom_type->input_file, dependent))%><%if(contains(dep, \$))%> $(subst $(SPACE),\$(SPACE),<%dep%>)<%else%> <%scope(enter, escape, \\s)%><%dep%><%scope(leave)%><%endif%><%endfor%><%else%><%if(custom_type->dependent)%><%foreach(custom_type->dependent)%><%if(contains(custom_type->dependent, \$))%> $(subst $(SPACE),\$(SPACE),<%custom_type->dependent%>)<%else%> <%scope(enter, escape, \\s)%><%custom_type->dependent%><%scope(leave)%><%endif%><%endfor%><%endif%><%endif%>,$(call ADD_EXT,$(call CUST_PRE,$(pre)))) +<%if(flag_overrides(custom_type->input_file, gendir))%> +<%if(!compares(flag_overrides(custom_type->input_file, gendir),.))%> + @<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%>test -d "<%flag_overrides(custom_type->input_file, gendir)%>" || mkdir -p "<%flag_overrides(custom_type->input_file, gendir)%>" +<%endif%> +<%endif%> + $(TRACE_FLAG)<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%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%><%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%><%custom_type->input_file%><%endif%> +<%if(flag_overrides(custom_type->input_file, postcommand))%> +<%foreach(custom_type->input_file)%> + $(TRACE_FLAG)<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%><%flag_overrides(custom_type->input_file, postcommand)%> +<%endfor%> +<%else%> +<%if(custom_type->postcommand)%> +<%foreach(custom_type->input_file)%> + $(TRACE_FLAG)<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%><%custom_type->postcommand%> +<%endfor%> +<%endif%> +<%endif%> +<%if(pch_header)%> +<%if(custom_type->pch_postrule)%> +<%foreach(custom_type->input_file->source_output_files)%> + @<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%>echo '#include "<%pch_header%>"' > temp.$$$$ && 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%> >> temp.$$$$ && mv temp.$$$$ <%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%> <%endfor%> <%endfor%> @@ -148,7 +213,13 @@ generate_sources :: endif <%endif%> +DIR_PREFIX = <%if(make_coexistence)%><%dirname(project_file)%>/<%endif%>$(BUILD_SPEC) + # main entry point for post processing after the build +<%if(postbuild)%> +post_build :: + @<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%><%eval(postbuild)%> +<%endif%> post_build :: $(POST_BUILD_STEP) deploy_output @echo "" @@ -156,45 +227,24 @@ post_build :: $(POST_BUILD_STEP) deploy_output <%if(standard_build)%> ifneq ($(PROJECT_TARGET),) <%endif%> -deploy_output :: <%if(!standard_build)%> +deploy_output :: <%if(exename)%>$(call CUST_PRE,$(ACE_EXEOUT)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT))<%else%><%if(sharedname || staticname)%><%if(libout || dllout)%>$(call CUST_PRE,$(ACE_LIBOUT)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT))<%endif%><%endif%><%endif%> <%if(exename)%> -<%if(exeout)%> - if [ $(ACE_EXEOUT) != . ]; then\ - if [ ! -d $(ACE_EXEOUT) ]; then\ - mkdir -p $(ACE_EXEOUT);\ - fi;\ - if test -e $(ACE_EXEOUT)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT); then \ - if test $(ACE_TARGET_NAME)/$(MODE_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) -nt $(ACE_EXEOUT)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT); then \ - cp $(ACE_TARGET_NAME)/$(MODE_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) $(ACE_EXEOUT);\ - fi \ - else \ - cp $(ACE_TARGET_NAME)/$(MODE_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) $(ACE_EXEOUT);\ - fi\ - fi -<%endif%> +$(call CUST_PRE,$(ACE_EXEOUT)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT)): $(ACE_TARGET_DIR)/$(MODE_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) + $(TRACE_FLAG)<%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%>test -d $(ACE_EXEOUT) || mkdir -p $(ACE_EXEOUT); cp $(DIR_PREFIX)/$(ACE_TARGET_DIR)/$(MODE_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) $(ACE_EXEOUT) <%else%> <%if(sharedname || staticname)%> <%if(libout || dllout)%> - if [ $(ACE_LIBOUT) != . ]; then\ - if [ ! -d $(ACE_LIBOUT) ]; then\ - mkdir -p $(ACE_LIBOUT);\ - fi;\ - if test -e $(ACE_LIBOUT)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT); then \ - if test $(ACE_TARGET_NAME)/$(MODE_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) -nt $(ACE_LIBOUT)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT); then \ - cp $(ACE_TARGET_NAME)/$(MODE_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) $(ACE_LIBOUT);\ - fi \ - else \ - cp $(ACE_TARGET_NAME)/$(MODE_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) $(ACE_LIBOUT);\ - fi\ - fi +$(call CUST_PRE,$(ACE_LIBOUT)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT)): $(ACE_TARGET_DIR)/$(MODE_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) + $(TRACE_FLAG)<%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%>test -d $(ACE_LIBOUT) || mkdir -p $(ACE_LIBOUT); cp $(DIR_PREFIX)/$(ACE_TARGET_DIR)/$(MODE_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) $(ACE_LIBOUT) <%endif%> <%endif%> <%endif%> <%else%> +deploy_output :: <%if(exename)%> <%if(exeout)%> - if $(ACE_EXEOUT) != . ]; then\ + if [ $(ACE_EXEOUT) != . ]; then\ if [ ! -d $(ACE_EXEOUT) ]; then\ mkdir -p $(ACE_EXEOUT);\ fi;\ @@ -210,7 +260,7 @@ deploy_output :: <%else%> <%if(sharedname || staticname)%> <%if(libout || dllout)%> - if [ $(ACE_LIBOUT) != . ]; then\ + if [ $(ACE_LIBOUT) != . ]; then\ if [ ! -d $(ACE_LIBOUT) ]; then\ mkdir -p $(ACE_LIBOUT);\ fi;\ @@ -288,19 +338,22 @@ external_clean :: <%foreach(custom_types)%> <%foreach(custom_type->input_files)%> <%if(custom_type->input_file->output_files)%> - <%if(make_coexistence)%>cd ../.. ; <%endif%>rm -f <%foreach(custom_type->input_file->output_files)%> <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%endfor%> + $(TRACE_FLAG)<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%>rm -f <%foreach(custom_type->input_file->output_files)%> <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>/<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%endfor%> <%endif%> <%endfor%> <%endfor%> <%if(exename)%> -<%if(exeout)%> - rm -f <%exeout%>/$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) +<%if(exeout || !standard_build)%> + $(TRACE_FLAG)<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%>rm -f <%exeout(".")%>/$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) <%endif%> <%else%> <%if(sharedname || staticname)%> - rm -f <%if(dllout)%><%dllout%><%else%><%libout%><%endif%>/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) + $(TRACE_FLAG)<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%>rm -f <%if(dllout)%><%dllout%>/<%else%><%libout%>/<%endif%>$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) <%endif%> <%endif%> +<%if(postclean)%> + $(TRACE_FLAG)<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%><%eval(postclean)%> +<%endif%> @echo "" <%if(standard_build)%> else @@ -372,4 +425,5 @@ ifneq ($(PROJECT_TARGET),) $(OBJ_DIR)/<%lib_prefix%><%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%><%lib_ext%> : $(OBJECTS) $(SUB_OBJECTS) endif <%endif%> -<%endif%>
\ No newline at end of file +<%endif%> +<%endfor%> diff --git a/templates/wb26wrproject.mpd b/templates/wb26wrproject.mpd index 68df0382..8f67c56d 100644 --- a/templates/wb26wrproject.mpd +++ b/templates/wb26wrproject.mpd @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> -<wrxml> - <properties platform="<%platform%>" platform_name="<%platform_name%>" root="1" type="<%project_type%>"/> -<%if(after && enable_subprojects && exename)%> +<%foreach(platform)%><%comment(there can't be more than one active platform but using a foreach allows platform settings to be grouped in scopes in the mpt files)%><wrxml> + <properties platform="<%if(!no_platform_in_wrproject)%><%platform%><%endif%>" <%if(platform_name)%>platform_name="<%platform_name%>" <%endif%>root="1" type="<%project_type%>"/> +<%if(after && !disable_subprojects)%> <subprojects> <!-- MPC ADD DEPENDENCIES --> </subprojects> @@ -11,6 +11,7 @@ <listAttribute key="BLD::Info|GlobalMacros"> <stringAttribute value="PROJECT_TYPE"/> <stringAttribute value="DEFINES"/> +<%if(compares(platform, VxWorks))%> <%if(sharedname || staticname)%> <stringAttribute value="DO_STRIP"/> <stringAttribute value="SHAREDLIB_VERSION"/> @@ -19,9 +20,11 @@ <stringAttribute value="LIBPATH"/> <stringAttribute value="LIBS"/> <stringAttribute value="PARTIAL_LIBS"/> +<%endif%> </listAttribute> - <stringAttribute key="BLD::Info|GlobalMacro|DEFINES" value="<%foreach(defines common_defines macros staticflags)%>-D<%define%> <%endfor%>"/> - <stringAttribute key="BLD::Info|GlobalMacro|PROJECT_TYPE" value="DKM"/> + <stringAttribute key="BLD::Info|GlobalMacro|DEFINES" value="<%foreach(defines common_defines macros)%>-D<%define%> <%endfor%><%if(type_is_dynamic)%><%foreach(dynamicflags)%>-D<%dynamicflag%> <%endfor%><%endif%><%if(need_staticflags)%><%foreach(staticflags)%>-D<%staticflag%> <%endfor%><%endif%><%if(pch_header)%><%foreach(pch_defines)%>-D<%pch_define%> <%endfor%><%endif%>"/> + <stringAttribute key="BLD::Info|GlobalMacro|PROJECT_TYPE" value="<%if(project_type_macro)%><%project_type_macro%><%else%><%if(exename)%>APP<%endif%><%endif%>"/> +<%if(compares(platform, VxWorks))%> <stringAttribute key="BLD::Info|GlobalMacro|EXPAND_DBG" value="0"/> <stringAttribute key="BLD::Info|GlobalMacro|LIBPATH" value="<%foreach(libpaths)%><%fornotfirst(" ")%>-L<%libpath%><%endfor%>"/> <stringAttribute key="BLD::Info|GlobalMacro|PARTIAL_LIBS" value="<%foreach(libs)%><%fornotfirst(" ")%>-l<%lib%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%if(!standard_build)%><%lib_ext%><%endif%><%endfor%><%foreach(lit_libs)%> <%lit_lib%>.lib<%endfor%><%foreach(pure_libs)%> <%pure_lib%><%endfor%>"/> @@ -30,77 +33,104 @@ <stringAttribute key="BLD::Info|GlobalMacro|DO_STRIP" value="0"/> <stringAttribute key="BLD::Info|GlobalMacro|SHAREDLIB_VERSION" value=""/> <%endif%> +<%endif%> <%foreach(buildspecs)%> <listAttribute key="BLD::Info|Incl|<%buildspec%>"> - <stringAttribute value="-I$(WIND_BASE)/target/h"/> - <stringAttribute value="-I$(WIND_BASE)/target/h/wrn/coreip"/> -<%foreach(includes)%> - <stringAttribute value="-I<%include%>"/> +<%foreach(includes platform_includes)%> + <stringAttribute value="-I<%if(!standard_build && !starts_with(include, [/\\\$]))%><%if(make_coexistence)%>../<%endif%>../<%endif%><%include%>"/> <%endfor%> </listAttribute> <%endfor%> <listAttribute key="BLD::Info|Macros"> - <stringAttribute value="VX_CPU_FAMILY"/> - <stringAttribute value="CPU"/> - <stringAttribute value="TOOL_FAMILY"/> - <stringAttribute value="TOOL"/> - <stringAttribute value="TOOL_PATH"/> - <stringAttribute value="CC_ARCH_SPEC"/> +<%foreach(wrprj_macros)%> + <stringAttribute value="<%wrprj_macro%>"/> +<%endfor%> </listAttribute> <%foreach(buildspecs)%> - <stringAttribute key="BLD::Info|Macro|CC_ARCH_SPEC|value|<%buildspec%>" value="<%cc_arch_spec%>"/> - <stringAttribute key="BLD::Info|Macro|CPU|value|<%buildspec%>" value="<%cpu%>"/> - <stringAttribute key="BLD::Info|Macro|TOOL_FAMILY|value|<%buildspec%>" value="<%tool_family%>"/> - <stringAttribute key="BLD::Info|Macro|TOOL_PATH|value|<%buildspec%>" value=""/> - <stringAttribute key="BLD::Info|Macro|TOOL|value|<%buildspec%>" value="<%tool%>"/> - <stringAttribute key="BLD::Info|Macro|VX_CPU_FAMILY|value|<%buildspec%>" value="<%vx_cpu_family%>"/> +<%foreach(sort(wrprj_macros))%> +<%if(compares(wrprj_macro, LIBPATH))%> + <stringAttribute key="BLD::Info|Macro|LIBPATH|value|<%buildspec%>" value="<%foreach(libpaths)%><%fornotfirst(" ")%>-L<%if(!standard_build && !starts_with(libpath, [/\\\$]))%><%if(make_coexistence)%>../<%endif%>../<%endif%><%translate_vars(libpath, 1)%><%endfor%>"/> +<%else%> +<%if(compares(wrprj_macro, LIBS))%> + <stringAttribute key="BLD::Info|Macro|LIBS|value|<%buildspec%>" value="<%foreach(libs)%><%fornotfirst(" ")%>-l<%lib%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%endfor%><%foreach(lit_libs)%> <%lit_lib%>.lib<%endfor%><%foreach(pure_libs)%> <%pure_lib%><%endfor%>"/> +<%else%> + <stringAttribute key="BLD::Info|Macro|<%wrprj_macro%>|value|<%buildspec%>" value="<%deref(wrprj_macro)%>"/> +<%endif%> +<%endif%> +<%endfor%> <%endfor%> <listAttribute key="BLD::Info|Tools"> <stringAttribute value="C-Compiler"/> <stringAttribute value="C++-Compiler"/> +<%if(compares(platform, VxWorks))%> <%if(sharedname || staticname)%> <stringAttribute value="Linker"/> <stringAttribute value="Partial Image Linker"/> +<%endif%> +<%endif%> <stringAttribute value="Librarian"/> -<%else%> - <stringAttribute value="Linker"/> - <stringAttribute value="Partial Image Linker"/> - <stringAttribute value="Librarian"/> +<%if(!compares(platform, VxWorks))%> + <stringAttribute value="C-Linker"/> + <stringAttribute value="C++-Linker"/> <%endif%> <stringAttribute value="Assembler"/> </listAttribute> <%foreach(buildspecs)%> - <stringAttribute key="BLD::Info|Tool|Assembler|cmd|<%buildspec%>" value="echo "building $@";%assemblerprefix% $(TOOL_PATH)<%cxx%> %DebugModeFlags% %ToolFlags% $(ADDED_CFLAGS) %Includes% $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o %OutFile% -c %InFile%"/> + <stringAttribute key="BLD::Info|Tool|Assembler|cmd|<%buildspec%>" value="echo "building $@";%assemblerprefix% $(TOOL_PATH)<%cxx%> %DebugModeFlags% %ToolFlags% $(ADDED_CFLAGS) %Includes% $(ADDED_INCLUDES) <%platform_asflags%> $(DEFINES) -o %OutFile% -c %InFile%"/> <stringAttribute key="BLD::Info|Tool|Assembler|dbgFlags|<%buildspec%>" value="<%ass_dbgflags%>"/> <stringAttribute key="BLD::Info|Tool|Assembler|derivedSigs|<%buildspec%>" value="<%ass_derivedsigs%>"/> - <stringAttribute key="BLD::Info|Tool|Assembler|flags|<%buildspec%>" value="$(CC_ARCH_SPEC) <%ass_flags%>"/> + <stringAttribute key="BLD::Info|Tool|Assembler|flags|<%buildspec%>" value="$(CC_ARCH_SPEC) <%ass_flags%><%if(sharedname && pic)%> <%pic%><%endif%>"/> <stringAttribute key="BLD::Info|Tool|Assembler|nonDbgFlags|<%buildspec%>" value="<%ass_nondbgflags%>"/> <%endfor%> <booleanAttribute key="BLD::Info|Tool|Assembler|object" value="true"/> <booleanAttribute key="BLD::Info|Tool|Assembler|passAble" value="false"/> <stringAttribute key="BLD::Info|Tool|Assembler|sigs" value="*.s"/> <%foreach(buildspecs)%> - <stringAttribute key="BLD::Info|Tool|C++-Compiler|cmd|<%buildspec%>" value="echo "building $@";%cppcompilerprefix% $(TOOL_PATH)<%cxx%> %DebugModeFlags% %ToolFlags% $(ADDED_C++FLAGS) %Includes% $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o %OutFile% -c %InFile%"/> + <stringAttribute key="BLD::Info|Tool|C++-Compiler|cmd|<%buildspec%>" value="echo "building $@";%cppcompilerprefix% $(TOOL_PATH)<%cxx%> %DebugModeFlags% %ToolFlags% $(ADDED_C++FLAGS) %Includes% $(ADDED_INCLUDES) <%platform_cxxflags%> $(DEFINES) -o %OutFile% -c %InFile%"/> <stringAttribute key="BLD::Info|Tool|C++-Compiler|dbgFlags|<%buildspec%>" value="<%cxx_dbgflags%>"/> <stringAttribute key="BLD::Info|Tool|C++-Compiler|derivedSigs|<%buildspec%>" value="<%cxx_derivedsigs%>"/> - <stringAttribute key="BLD::Info|Tool|C++-Compiler|flags|<%buildspec%>" value="$(CC_ARCH_SPEC) <%cxx_flags%>"/> + <stringAttribute key="BLD::Info|Tool|C++-Compiler|flags|<%buildspec%>" value="$(CC_ARCH_SPEC) <%cxx_flags%><%if(sharedname && pic)%> <%pic%><%endif%>"/> <stringAttribute key="BLD::Info|Tool|C++-Compiler|nonDbgFlags|<%buildspec%>" value="<%cxx_nondbgflags%>"/> <%endfor%> <booleanAttribute key="BLD::Info|Tool|C++-Compiler|object" value="true"/> <booleanAttribute key="BLD::Info|Tool|C++-Compiler|passAble" value="false"/> <stringAttribute key="BLD::Info|Tool|C++-Compiler|sigs" value="<%foreach(ext, extensions(source_files))%>*.<%ext%><%fornotlast(";")%><%endfor%>"/> +<%if(!compares(platform, VxWorks))%> +<%foreach(buildspecs)%> + <stringAttribute key="BLD::Info|Tool|C++-Linker|cmd|<%buildspec%>" value="echo "building $@";%cpplinkerprefix% $(TOOL_PATH)<%cxx%> %DebugModeFlags% %ToolFlags% -o %OutFile% %Objects% $(ADDED_OBJECTS) %Libraries% $(LIBPATH) $(LIBS) $(ADDED_LIBPATH) $(ADDED_LIBS)"/> + <stringAttribute key="BLD::Info|Tool|C++-Linker|dbgFlags|<%buildspec%>" value=""/> + <stringAttribute key="BLD::Info|Tool|C++-Linker|derivedSigs|<%buildspec%>" value="<%if(sharedname)%>*<%dll_ext%><%else%><%cxxlnk_derivedsigs("*")%><%endif%>"/> + <stringAttribute key="BLD::Info|Tool|C++-Linker|flags|<%buildspec%>" value="<%if(sharedname && shflags)%><%shflags%><%endif%>"/> + <stringAttribute key="BLD::Info|Tool|C++-Linker|nonDbgFlags|<%buildspec%>" value=""/> +<%endfor%> + <booleanAttribute key="BLD::Info|Tool|C++-Linker|object" value="false"/> + <booleanAttribute key="BLD::Info|Tool|C++-Linker|passAble" value="false"/> + <stringAttribute key="BLD::Info|Tool|C++-Linker|sigs" value=""/> +<%endif%> <%foreach(buildspecs)%> - <stringAttribute key="BLD::Info|Tool|C-Compiler|cmd|<%buildspec%>" value="echo "building $@";%ccompilerprefix% $(TOOL_PATH)<%cxx%> %DebugModeFlags% %ToolFlags% $(ADDED_CFLAGS) %Includes% $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o %OutFile% -c %InFile%"/> + <stringAttribute key="BLD::Info|Tool|C-Compiler|cmd|<%buildspec%>" value="echo "building $@";%ccompilerprefix% $(TOOL_PATH)<%if(cc)%><%cc%><%else%><%cxx%><%endif%> %DebugModeFlags% %ToolFlags% $(ADDED_CFLAGS) %Includes% $(ADDED_INCLUDES) <%platform_ccflags%> $(DEFINES) -o %OutFile% -c %InFile%"/> <stringAttribute key="BLD::Info|Tool|C-Compiler|dbgFlags|<%buildspec%>" value="<%c_dbgflags%>"/> <stringAttribute key="BLD::Info|Tool|C-Compiler|derivedSigs|<%buildspec%>" value="<%c_derivedsigs%>"/> - <stringAttribute key="BLD::Info|Tool|C-Compiler|flags|<%buildspec%>" value="$(CC_ARCH_SPEC) <%c_flags%>"/> + <stringAttribute key="BLD::Info|Tool|C-Compiler|flags|<%buildspec%>" value="$(CC_ARCH_SPEC) <%c_flags%><%if(sharedname && pic)%> <%pic%><%endif%>"/> <stringAttribute key="BLD::Info|Tool|C-Compiler|nonDbgFlags|<%buildspec%>" value="<%c_nondbgflags%>"/> <%endfor%> <booleanAttribute key="BLD::Info|Tool|C-Compiler|object" value="true"/> <booleanAttribute key="BLD::Info|Tool|C-Compiler|passAble" value="false"/> <stringAttribute key="BLD::Info|Tool|C-Compiler|sigs" value="*.c"/> +<%if(!compares(platform, VxWorks))%> <%foreach(buildspecs)%> - <stringAttribute key="BLD::Info|Tool|Librarian|cmd|<%buildspec%>" value="echo "building $@";%archiverprefix% $(TOOL_PATH)<%ar%> %ToolFlags% %OutFile% @$(PRJ_ROOT_DIR)/filelist.txt $(ADDED_OBJECTS)"/> + <stringAttribute key="BLD::Info|Tool|C-Linker|cmd|<%buildspec%>" value="echo "building $@";%clinkerprefix% $(TOOL_PATH)<%if(cc)%><%cc%><%else%><%cxx%><%endif%> %DebugModeFlags% %ToolFlags% -o %OutFile% %Objects% $(ADDED_OBJECTS) %Libraries% $(LIBPATH) $(LIBS) $(ADDED_LIBPATH) $(ADDED_LIBS)"/> + <stringAttribute key="BLD::Info|Tool|C-Linker|dbgFlags|<%buildspec%>" value=""/> + <stringAttribute key="BLD::Info|Tool|C-Linker|derivedSigs|<%buildspec%>" value="<%if(sharedname)%>*<%dll_ext%><%else%><%clnk_derivedsigs("*")%><%endif%>"/> + <stringAttribute key="BLD::Info|Tool|C-Linker|flags|<%buildspec%>" value="<%if(sharedname && shflags)%><%shflags%><%endif%>"/> + <stringAttribute key="BLD::Info|Tool|C-Linker|nonDbgFlags|<%buildspec%>" value=""/> +<%endfor%> + <booleanAttribute key="BLD::Info|Tool|C-Linker|object" value="false"/> + <booleanAttribute key="BLD::Info|Tool|C-Linker|passAble" value="false"/> + <stringAttribute key="BLD::Info|Tool|C-Linker|sigs" value=""/> +<%endif%> +<%foreach(buildspecs)%> + <stringAttribute key="BLD::Info|Tool|Librarian|cmd|<%buildspec%>" value="echo "building $@";%archiverprefix% $(TOOL_PATH)<%ar%> %ToolFlags% %OutFile% <%librarian_objects%> $(ADDED_OBJECTS)"/> <stringAttribute key="BLD::Info|Tool|Librarian|dbgFlags|<%buildspec%>" value="<%ar_dbgflags%>"/> <stringAttribute key="BLD::Info|Tool|Librarian|derivedSigs|<%buildspec%>" value="*<%ar_derivedsigs%>"/> <stringAttribute key="BLD::Info|Tool|Librarian|flags|<%buildspec%>" value="<%ar_flags%>"/> @@ -109,6 +139,7 @@ <booleanAttribute key="BLD::Info|Tool|Librarian|object" value="false"/> <booleanAttribute key="BLD::Info|Tool|Librarian|passAble" value="true"/> <stringAttribute key="BLD::Info|Tool|Librarian|sigs" value=""/> +<%if(compares(platform, VxWorks))%> <%foreach(buildspecs)%> <stringAttribute key="BLD::Info|Tool|Linker|cmd|<%buildspec%>" value="echo "building $@";rm -f %OutFile%;<%nm%> %Objects% $(ADDED_OBJECTS) %Libraries% | tclsh $(WIND_BASE)/host/resource/hutils/tcl/munch.tcl -c <%munchflag%> > $(OBJ_DIR)/ctdt.c;%ccompilerprefix% $(TOOL_PATH)<%cxx%> %DebugModeFlags% $(CC_ARCH_SPEC) -fdollars-in-identifiers -Wall $(ADDED_CFLAGS) %Includes% $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o $(OBJ_DIR)/ctdt.o -c $(OBJ_DIR)/ctdt.c;%linkerprefix% $(TOOL_PATH)<%cxx%> -r -nostdlib -Wl,-X %ToolFlags% -o %OutFile% $(OBJ_DIR)/ctdt.o %Objects% $(ADDED_OBJECTS) %Libraries% $(LIBPATH) $(LIBS) $(ADDED_LIBPATH) $(ADDED_LIBS) && if [ "$(EXPAND_DBG)" = "1" ]; then plink "$@";fi"/> <stringAttribute key="BLD::Info|Tool|Linker|dbgFlags|<%buildspec%>" value="<%linker_dbgflags%>"/> @@ -129,6 +160,7 @@ <booleanAttribute key="BLD::Info|Tool|Partial Image Linker|object" value="false"/> <booleanAttribute key="BLD::Info|Tool|Partial Image Linker|passAble" value="true"/> <stringAttribute key="BLD::Info|Tool|Partial Image Linker|sigs" value=""/> +<%endif%> <stringAttribute key="BLD::Info|cmd" value="%makeprefix% make --no-print-directory"/> <stringAttribute key="BLD::Info|defaultSpec" value="<%default_buildspec%>"/> <%foreach(buildspecs)%> @@ -155,7 +187,7 @@ <booleanAttribute key="BLD::Tgt|Target|<%exename%>_partialImage|passed" value="true"/> <listAttribute key="BLD::Tgt|Target|<%exename%>_partialImage|refs"/> <%endif%> - <stringAttribute key="BLD::Tgt|Target|<%if(exename)%><%exename%><%else%><%if(staticname)%><%lib_prefix%><%staticname%><%else%><%lib_prefix%><%sharedname%><%endif%><%endif%>|ToolName" value="<%if(sharedname || staticname)%>Librarian"<%else%>Linker"<%endif%>/> + <stringAttribute key="BLD::Tgt|Target|<%if(exename)%><%exename%><%else%><%if(staticname)%><%lib_prefix%><%staticname%><%else%><%lib_prefix%><%sharedname%><%endif%><%endif%>|ToolName" value="<%if(sharedname || staticname)%>Librarian<%else%>Linker<%endif%>"/> <booleanAttribute key="BLD::Tgt|Target|<%if(exename)%><%exename%><%else%><%if(staticname)%><%lib_prefix%><%staticname%><%else%><%lib_prefix%><%sharedname%><%endif%><%endif%>|passed" value="false"/> <listAttribute key="BLD::Tgt|Target|<%if(exename)%><%exename%><%else%><%if(staticname)%><%lib_prefix%><%staticname%><%else%><%lib_prefix%><%sharedname%><%endif%><%endif%>|refs"<%if(!exename)%>/<%endif%>> <%if(exename)%> @@ -171,20 +203,43 @@ <%if(!standard_build)%> <buildtargets> <%if(exename)%> - <buildtarget buildtool="Linker" name="<%exename%>" passed="true" targetname="<%exename%>"> + <buildtarget buildtool="<%exe_buildtool%>" name="<%exename%>" passed="true" targetname="<%exename%>"> <%else%> -<%if(sharedname || staticname)%> - <buildtarget buildtool="Librarian" name="<%if(sharedname)%><%lib_prefix%><%sharedname%><%else%><%lib_prefix%><%staticname%><%endif%>" passed="true" targetname="<%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%>"> +<%if(sharedname && !compares(platform, VxWorks))%> +<%foreach(buildspecs)%> + <buildtarget buildtool="<%dll_buildtool%>" name="<%dll_prefix%><%sharedname%>" passed="true" targetname="<%sharedname%>_<%buildspec%>"> + <attributes> + <mapAttribute> + <listAttribute key="BuildSupportForBuildSpecs"> + <stringAttribute value="<%buildspec%>"/> + </listAttribute> + </mapAttribute> + </attributes> + <contents> +<%foreach(source_files)%> + <file name="/<%project_prefix%><%project_name%>/<%source_file%>"/> +<%endfor%> +<%foreach(source_dirs)%> + <folder name="/<%source_dir%>" recursive="false"/> +<%endfor%> + </contents> + </buildtarget> +<%endfor%> <%else%> - <buildtarget buildtool="Linker" name="<%exename%>" passed="true" targetname="<%exename%>"> +<%if(staticname || sharedname)%> + <buildtarget buildtool="Librarian" name="<%lib_prefix%><%staticname%>" passed="true" targetname="<%staticname%>"> +<%else%> + <buildtarget buildtool="CustomOnly" name="" passed="false" targetname=""> +<%endif%> <%endif%> <%endif%> +<%if(!sharedname || compares(platform, VxWorks))%> <contents> -<%if(exename)%> - <buildtargetreference name="/<%project_name%>/PartialImage"/> +<%if(exename && compares(platform, VxWorks))%> + <buildtargetreference name="/<%project_prefix%><%project_name%>/PartialImage"/> <%else%> <%foreach(source_files)%> - <file name="/<%project_name%>/<%source_file%>"/> + <file name="/<%project_prefix%><%project_name%>/<%source_file%>"/> <%endfor%> <%foreach(source_dirs)%> <folder name="/<%source_dir%>" recursive="false"/> @@ -192,7 +247,8 @@ <%endif%> </contents> </buildtarget> -<%if(exename)%> +<%endif%> +<%if(exename && compares(platform, VxWorks))%> <buildtarget buildtool="Partial Image Linker" name="PartialImage" passed="true" targetname="PartialImage"> <attributes> <mapAttribute> @@ -202,8 +258,11 @@ </mapAttribute> </attributes> <contents> +<%if(pch_source)%> + <file name="/<%project_prefix%><%project_name%>/<%pch_source%>"/> +<%endif%> <%foreach(source_files)%> - <file name="/<%project_name%>/<%source_file%>"/> + <file name="/<%project_prefix%><%project_name%>/<%source_file%>"/> <%endfor%> <%foreach(source_dirs)%> <folder name="/<%source_dir%>" recursive="false"/> @@ -214,4 +273,4 @@ </buildtargets> <%endif%> </wrxml> - +<%endfor%> diff --git a/templates/wb30cproject.mpd b/templates/wb30cproject.mpd new file mode 100644 index 00000000..0fe1499e --- /dev/null +++ b/templates/wb30cproject.mpd @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?fileVersion 4.0.0?> + +<cproject> +<storageModule moduleId="org.eclipse.cdt.core.settings"> +<cconfiguration id="org.eclipse.cdt.core.default.config.102838268"> +<storageModule buildSystemId="org.eclipse.cdt.core.defaultConfigDataProvider" id="org.eclipse.cdt.core.default.config.102838268" moduleId="org.eclipse.cdt.core.settings" name="Configuration"> +<externalSettings/> +<extensions> +<extension id="com.windriver.ide.core.WRScannerInfoProvider" point="org.eclipse.cdt.core.ScannerInfoProvider"/> +<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/> +<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/> +</extensions> +</storageModule> +<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> +<storageModule moduleId="org.eclipse.cdt.core.pathentry"> +<pathentry kind="src" path=""/> +<pathentry kind="out" path=""/> +<pathentry kind="con" path="com.windriver.ide.core.WR_CONTAINER"/> +<pathentry kind="con" path="com.windriver.ide.core.build.model.WR_USERDEFINED_CONTAINER"/> +</storageModule> +<storageModule moduleId="scannerConfiguration"/> +<storageModule moduleId="userdefinedContainer"> +<indexAllFiles value="false"/> +<initialized value="true"/> +</storageModule> +</cconfiguration> +</storageModule> +</cproject> diff --git a/templates/wb30dll.mpt b/templates/wb30dll.mpt new file mode 100644 index 00000000..8feb4b00 --- /dev/null +++ b/templates/wb30dll.mpt @@ -0,0 +1,70 @@ +conditional_include "wb26dll" + +additional_natures = org.eclipse.cdt.core.cnature org.eclipse.cdt.core.ccnature +project_prefix = wb_ + +platform = Native + +// platforms + +Native { + no_platform_in_wrproject = 1 + platform_name = + project_type = ApplicationProject + enable_subprojects = 1 + + exe_ext = + dll_ext = .so + dll_prefix = lib + ar = ar + ar_flags = crus + librarian_objects = %Objects% + exe_buildtool = C++-Linker + dll_buildtool = C++-Linker + + buildspecs = Linux_gnu_native_3.x_4.x Windows_gnu_native_3.x_4.x + default_buildspec = Linux_gnu_native_3.x_4.x + + wrprj_macros = TOOL_PATH LIBPATH LIBS ADAPT_DEPS +} + + +// buildspecs + +Linux_gnu_native_3.x_4.x { + cxx = g++ + cc = gcc + platform_asflags = -MD -MP + platform_cxxflags = -MD -MP + platform_ccflags = -MD -MP + ass_flags = -x assembler -fno-builtin -Wall + cxx_flags = -ansi -fno-builtin -Wall + c_flags = -ansi -fno-builtin -Wall + ass_dbgflags = -g + cxx_dbgflags = -g + c_dbgflags = -g + pic = -fPIC + shflags = -shared +} + +Windows_gnu_native_3.x_4.x { + exe_ext = .exe + cxxlnk_derivedsigs = *.exe + clnk_derivedsigs = *.exe + dll_prefix = + dll_ext = .dll + cxx = g++ + cc = gcc + platform_asflags = -MD -MP + platform_cxxflags = -MD -MP + platform_ccflags = -MD -MP + ass_flags = -x assembler -fno-builtin -Wall + cxx_flags = -fno-builtin -Wall //-ansi not supported with MinGW + c_flags = -fno-builtin -Wall //-ansi not supported with MinGW + ass_dbgflags = -g + cxx_dbgflags = -g + c_dbgflags = -g + shflags = -shared +} + +conditional_include "user_wb30dll" diff --git a/templates/wb30exe.mpt b/templates/wb30exe.mpt new file mode 100644 index 00000000..17dcaae5 --- /dev/null +++ b/templates/wb30exe.mpt @@ -0,0 +1,4 @@ +conditional_include "wb30dll" +conditional_include "user_wb30exe" + + |