Only generate common defines when we have those
[MPC.git] / modules / UVISWorkspaceCreator.pm
blobe6c5d105cef344408c83c4f0ea4553fd9eb14537
1 package UVISWorkspaceCreator;
3 # ************************************************************
4 # Description : The Keil uVision Workspace Creator
5 # Author : Chad Elliott
6 # Create Date : 11/1/2016
7 # ************************************************************
9 # ************************************************************
10 # Pragmas
11 # ************************************************************
13 use strict;
15 use UVISProjectCreator;
16 use WinWorkspaceBase;
17 use WorkspaceCreator;
19 use vars qw(@ISA);
20 @ISA = qw(WinWorkspaceBase WorkspaceCreator);
22 # ************************************************************
23 # Subroutine Section
24 # ************************************************************
27 sub compare_output {
28 #my $self = shift;
29 return 1;
33 sub workspace_file_extension {
34 #my $self = shift;
35 return '.uvmpw';
39 sub pre_workspace {
40 my($self, $fh) = @_;
41 my $crlf = $self->crlf();
43 print $fh "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>$crlf",
44 "<ProjectWorkspace xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"project_mpw.xsd\">$crlf$crlf",
45 " <SchemaVersion>1.0</SchemaVersion>$crlf$crlf",
46 " <Header>### uVision Project, (C) Keil Software</Header>$crlf$crlf";
50 sub write_comps {
51 my($self, $fh) = @_;
52 my $crlf = $self->crlf();
54 print $fh ' <WorkspaceName>', $self->get_workspace_name(), ' - ',
55 $self->create_command_line_string($0, @ARGV),
56 '</WorkspaceName>', $crlf, $crlf;
57 foreach my $project ($self->sort_dependencies($self->get_projects(), 0)) {
58 print $fh " <project>$crlf",
59 " <PathAndName>", $self->slash_to_backslash($project),
60 "</PathAndName>$crlf",
61 " </project>$crlf$crlf";
66 sub post_workspace {
67 my($self, $fh) = @_;
68 print $fh '</ProjectWorkspace>' . $self->crlf();