From 599f423d5e764338f89ef7c49f6a4363d0b2e700 Mon Sep 17 00:00:00 2001 From: Chad Elliott Date: Thu, 18 Apr 2019 17:21:25 -0500 Subject: [PATCH] Thu Apr 18 22:18:20 UTC 2019 Chad Elliott * docs/README: * docs/USAGE: * docs/templates/iar.txt: * modules/IARProjectCreator.pm: * modules/IARWorkspaceCreator.pm: * templates/iar.mpd: * templates/iar.mpt: Added an initial, simplistic IAR workspace/project generator. There will be more changes to fully suport this IDE. --- ChangeLog | 13 + docs/README | 2 + docs/USAGE | 4 +- docs/templates/iar.txt | 17 + modules/IARProjectCreator.pm | 78 +++ modules/IARWorkspaceCreator.pm | 70 +++ templates/iar.mpd | 1097 ++++++++++++++++++++++++++++++++++++++++ templates/iar.mpt | 13 + 8 files changed, 1292 insertions(+), 2 deletions(-) create mode 100644 docs/templates/iar.txt create mode 100644 modules/IARProjectCreator.pm create mode 100644 modules/IARWorkspaceCreator.pm create mode 100644 templates/iar.mpd create mode 100644 templates/iar.mpt diff --git a/ChangeLog b/ChangeLog index ca9a25dd..bb5d540d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Thu Apr 18 22:18:20 UTC 2019 Chad Elliott + + * docs/README: + * docs/USAGE: + * docs/templates/iar.txt: + * modules/IARProjectCreator.pm: + * modules/IARWorkspaceCreator.pm: + * templates/iar.mpd: + * templates/iar.mpt: + + Added an initial, simplistic IAR workspace/project generator. + There will be more changes to fully suport this IDE. + Mon May 21 14:33:24 UTC 2018 Adam Mitz * templates/vc10.mpd: diff --git a/docs/README b/docs/README index 3c327eff..d52a77a8 100644 --- a/docs/README +++ b/docs/README @@ -345,8 +345,10 @@ specific This scope allows assignments that are specific to a cc | | | | X | em3 | | | X | X | ghs | | | | ? | + iar | | | | X | make | | X | | | nmake | | X | X | X | + uvis | | | | X | vc* | | | X | X | vs* | | | X | X | wix | | | | X | diff --git a/docs/USAGE b/docs/USAGE index 6f4e520e..c0c8dfa7 100644 --- a/docs/USAGE +++ b/docs/USAGE @@ -24,8 +24,8 @@ Usage: mwc.pl [-global ] [-include ] [-recurse] [-workers <#>] [-workers_dir | -workers_port <#>] [-language ] [-type ] [files] diff --git a/docs/templates/iar.txt b/docs/templates/iar.txt new file mode 100644 index 00000000..0224d83d --- /dev/null +++ b/docs/templates/iar.txt @@ -0,0 +1,17 @@ +// Current as of 8/18/2019 +// This defines the role of all the template variables specific to the +// 'iar' project type. +// +// Please try to keep this alphabetically sorted. +// +chip = This will be the chip version used by the UI. +debug = This will be 1 if in debug mode and 0 if in release mode. +dlib_config = The configuration header file for the DLib. +gendianmode = Corresponds to the Endian mode under General Options. +gendianmodebe = When General Options Endian mode is Big (1), BE32 is 0 and BE8 is 1. +generalenablemisra = Set this to 1 to enable MISRA in the General Options. +ilinkicffile = Set this to override the default ICF file. +ilinkprogramentrylabel = Use this to override the default program entry name. +oglastsavedbyproductversion = The version number of the product at the last saving time of the project. +ogproductversion = The version number of the product that created the project. +toolchain = The tool chain setting (e.g., ARM). diff --git a/modules/IARProjectCreator.pm b/modules/IARProjectCreator.pm new file mode 100644 index 00000000..aa16ee8f --- /dev/null +++ b/modules/IARProjectCreator.pm @@ -0,0 +1,78 @@ +package IARProjectCreator; + +# ************************************************************ +# Description : The IAR Embedded Workbench IDE Project Creator +# Author : Chad Elliott +# Create Date : 4/8/2019 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; + +use ProjectCreator; +use XMLProjectBase; +use WinProjectBase; + +use vars qw(@ISA); +@ISA = qw(XMLProjectBase WinProjectBase ProjectCreator); + +# ************************************************************ +# Data Section +# ************************************************************ + +my $tmpl = 'iar'; + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub compare_output { + #my $self = shift; + return 1; +} + +sub dependency_is_filename { + #my $self = shift; + return 0; +} + +sub project_file_extension { + return '.ewp'; +} + + +sub get_lib_exe_template_input_file { + return $tmpl; +} + + +sub get_lib_template_input_file { + return $tmpl; +} + + +sub get_dll_exe_template_input_file { + return $tmpl; +} + + +sub get_dll_template_input_file { + return $tmpl; +} + + +sub get_template { + return $tmpl . '.mpd'; +} + + +sub get_cmdsep_symbol { + #my $self = shift; + return '&'; +} + + +1; diff --git a/modules/IARWorkspaceCreator.pm b/modules/IARWorkspaceCreator.pm new file mode 100644 index 00000000..5f339c6b --- /dev/null +++ b/modules/IARWorkspaceCreator.pm @@ -0,0 +1,70 @@ +package IARWorkspaceCreator; + +# ************************************************************ +# Description : The IAR Embedded Workbench IDE Workspace Creator +# Author : Chad Elliott +# Create Date : 4/18/2019 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; + +use IARProjectCreator; +use WinWorkspaceBase; +use WorkspaceCreator; + +use vars qw(@ISA); +@ISA = qw(WinWorkspaceBase WorkspaceCreator); + +# ************************************************************ +# Subroutine Section +# ************************************************************ + + +sub compare_output { + #my $self = shift; + return 1; +} + + +sub workspace_file_extension { + #my $self = shift; + return '.eww'; +} + + +sub pre_workspace { + my($self, $fh) = @_; + my $crlf = $self->crlf(); + + print $fh "$crlf", + "$crlf"; +} + + +sub write_comps { + my($self, $fh) = @_; + my $crlf = $self->crlf(); + + print $fh ' ', $crlf; + foreach my $project ($self->sort_dependencies($self->get_projects(), 0)) { + print $fh " $crlf", + " \$WS_DIR\$\\", $self->slash_to_backslash($project), + "$crlf", + " $crlf"; + } +} + + +sub post_workspace { + my($self, $fh) = @_; + print $fh '' . $self->crlf(); +} + + +1; diff --git a/templates/iar.mpd b/templates/iar.mpd new file mode 100644 index 00000000..8972c197 --- /dev/null +++ b/templates/iar.mpd @@ -0,0 +1,1097 @@ + + + 3 +<%foreach(configurations)%> + + <%configuration%> + + <%toolchain%> + + <%debug%> + + General + 3 + + 31 + 1 + <%debug%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 35 + 1 + <%debug%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A<%toolchain%> + 2 + + 10 + 1 + <%debug%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + <%debug%> + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 22 + 1 + <%debug%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + <%debug%> + + + + + + + BILINK + 0 + + + + Coder + 0 + + + +<%endfor%> +<%if(documentation_files)%> + + Documentation Files +<%foreach(documentation_files)%> + + $PROJ_DIR$\<%documentation_file%> + +<%endfor%> + +<%endif%> +<%if(header_files)%> + + Header Files +<%foreach(header_files)%> + + $PROJ_DIR$\<%header_file%> + +<%endfor%> + +<%endif%> +<%if(inline_files)%> + + Inline Files +<%foreach(inline_files)%> + + $PROJ_DIR$\<%inline_file%> + +<%endfor%> + +<%endif%> + + Source Files +<%foreach(source_files)%> + + $PROJ_DIR$\<%source_file%> + +<%endfor%> + +<%if(template_files)%> + + Template Files +<%foreach(template_files)%> + + $PROJ_DIR$\<%template_file%> + +<%endfor%> + +<%endif%> + diff --git a/templates/iar.mpt b/templates/iar.mpt new file mode 100644 index 00000000..7c4d57de --- /dev/null +++ b/templates/iar.mpt @@ -0,0 +1,13 @@ +configurations = "int flash sramdata debug" "int flash sramdata release" +toolchain = ARM +chip = "MK70FN1M0xxx12 NXP MK70FN1M0xxx12" + +int flash sramdata debug { + debug = 1 + lib_modifier = sd +} + +int flash sramdata release { + debug = 0 + lib_modifier = s +} -- 2.11.4.GIT