Skip to content

Commit 9842d6f

Browse files
committed
Cleanup and use environment variable
1 parent 120547c commit 9842d6f

File tree

3 files changed

+2
-27
lines changed

3 files changed

+2
-27
lines changed

modules/GHSProjectCreator.pm

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ sub project_file_extension {
8686

8787

8888
sub get_template {
89-
return @tkeys;
89+
return $ENV{MPC_GHS_GENERATE_CMD} ? @tkeys : $_[0]->{'pctype'};
9090
}
9191

9292

@@ -113,10 +113,6 @@ sub fill_value {
113113
$startre = $self->escape_regex_special($self->getstartdir());
114114
}
115115

116-
## NOTE(sonndinh): As of Green Hills MULTI IDE v8.1.4, the paths do not
117-
## need to be relative to the top directory. Hence, most of the reltop_
118-
## uses in the GHS template are removed.
119-
120116
## The Green Hills project format is strange and needs all paths
121117
## relative to the top directory, no matter where the source files
122118
## reside. The template uses reltop_ in front of the real project

modules/GHSWorkspaceCreator.pm

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,6 @@ sub pre_workspace {
7777
}
7878
}
7979

80-
# TODO(sonndinh):
81-
# Some other information is specific to ACE such as its root directory,
82-
# its compilation and linking requirements (C++ version, flags, etc).
83-
# These can be put in some form of input to MPC instead of hardcoded here.
84-
# We can use environment variables and command-line options:
85-
# --expand_vars, -use_env. Or can use the -relative command-line option.
86-
# The first option requires setting environment variables.
87-
# The second option requires passing parameters to the -relative option.
88-
8980
## Try to read the INTEGRITY installation directory and BSP name from environment.
9081
## Default values are the installation directory on Windows and the BSP name
9182
## for the simulator for PowerPC architecture.
@@ -200,27 +191,15 @@ sub mix_settings {
200191
$type = $integrity; # [INTEGRITY Application]
201192
}
202193
$mix .= "\t\t$type$crlf";
203-
#$mix .= "\t\t$type$crlf" .
204-
# "\t-object_dir=" . $self->mpc_dirname($project) .
205-
# '/.obj' . $crlf;
206194
}
207195
elsif (/^\s*(\[Shared Object\])\s*$/) {
208196
$mix .= "\t\t$1$crlf";
209-
#$mix .= "\t\t$1$crlf" .
210-
# "\t-pic$crlf" .
211-
# "\t-object_dir=" . $self->mpc_dirname($project) .
212-
# '/.shobj' . $crlf;
213197
}
214198
elsif ($integrity_project && /^(.*\.bsp)\s/) {
215199
push(@integ_bsps, $1);
216200
}
217201
else {
218202
if (/^\s*\-((\w)\w*)/) {
219-
## Save the required options into the mixed project string
220-
if (defined $directives{$2} || defined $directives{$1}) {
221-
#$mix .= $_;
222-
}
223-
224203
## If this is an integrity project, we need to find out
225204
## what the output file will be for the integrate file.
226205
if (defined $int_proj && /^\s*\-o\s+(.*)\s$/) {

templates/ghs.mpd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-non_shared
88
<%endif%>
99
<%else%>
10-
<%comment("sonndinh: When sharedname is defined and staticname is not set in the mpc file,")%>
10+
<%comment("When sharedname is defined and staticname is not set in the mpc file,")%>
1111
<%comment("the staticname takes the same value as sharedname. The opposite is also true.")%>
1212
<%comment("Because of that, we can't condition only on whether either of them is defined.")%>
1313
<%comment("This fixes that by including the template input variable need_staticflags.")%>

0 commit comments

Comments
 (0)