summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2005-08-22 12:12:14 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2005-08-22 12:12:14 +0000
commitdcf754577e959d909494623795034be40e2b5e9f (patch)
tree3c65b2c86e0b17fedac95ccc293a217f41c0797f
parent7efefc7676565a575ce72fd46e7c7f807e2fa346 (diff)
downloadMPC-dcf754577e959d909494623795034be40e2b5e9f.tar.gz
ChangeLogTag: Mon Aug 22 07:11:37 2005 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--ChangeLog12
-rwxr-xr-xprj_install.pl86
-rw-r--r--templates/make.mpd6
-rw-r--r--templates/makedll.mpt24
4 files changed, 117 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index f0edc82a..4541dd9b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Mon Aug 22 07:11:37 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * prj_install.pl:
+
+ Added options to override the installation location for a
+ particular tag.
+
+ * templates/make.mpd:
+ * templates/makedll.mpt:
+
+ Added support for the GHS Integrity OS.
+
Fri Aug 12 12:30:19 2005 Chad Elliott <elliott_c@ociweb.com>
* README:
diff --git a/prj_install.pl b/prj_install.pl
index 82bc01dc..9c8f86d2 100755
--- a/prj_install.pl
+++ b/prj_install.pl
@@ -36,6 +36,11 @@ my(%special) = ('exe_output' => 1,
'lib_output' => 1,
);
+my(%actual) = ();
+my(%base) = ();
+my(%override) = ();
+my($keepgoing) = 0;
+
# ******************************************************************
# Subroutine Section
# ******************************************************************
@@ -46,7 +51,10 @@ sub copyFiles {
my($verbose) = shift;
foreach my $file (@$files) {
- my($fulldir) = $insdir . '/' . dirname($file);
+ my($dest) = $insdir . '/' .
+ (defined $actual{$file} ?
+ "$actual{$file}/" . basename($file) : $file);
+ my($fulldir) = dirname($dest);
if (! -d $fulldir) {
my($tmp) = '';
foreach my $part (split(/[\/\\]/, $fulldir)) {
@@ -55,13 +63,15 @@ sub copyFiles {
}
}
- if (! -e "$insdir/$file" || (-M $file) < (-M "$insdir/$file")) {
+ if (! -e $dest || (-M $file) < (-M $dest)) {
if ($verbose) {
- print "Copying to $insdir/$file\n";
+ print "Copying to $dest\n";
}
- if (!copy($file, "$insdir/$file")) {
- print STDERR "ERROR: Unable to copy $file to $insdir/$file\n";
- return 0;
+ if (!copy($file, $dest)) {
+ print STDERR "ERROR: Unable to copy $file to $dest\n";
+ if (!$keepgoing) {
+ return 0;
+ }
}
}
else {
@@ -122,6 +132,18 @@ sub determineSpecialName {
}
+sub replaceVariables {
+ my($line) = shift;
+ while($line =~ /(\$\(([^)]+)\))/) {
+ my($whole) = $1;
+ my($name) = $2;
+ my($val) = (defined $ENV{$name} ? $ENV{$name} : '');
+ $line =~ s/\$\([^)]+\)/$val/;
+ }
+ return $line;
+}
+
+
sub loadInsFiles {
my($files) = shift;
my($tags) = shift;
@@ -159,12 +181,25 @@ sub loadInsFiles {
}
}
elsif (defined $current) {
+ $line = replaceVariables($line);
+ my($start) = $#copy + 1;
if (defined $special{$current}) {
push(@copy, determineSpecialName($current, $base, $line));
}
else {
push(@copy, "$base$line");
}
+ if (defined $override{$current}) {
+ for(my $i = $start; $i <= $#copy; ++$i) {
+ $actual{$copy[$i]} = $override{$current};
+ }
+ }
+ elsif (defined $base{$current}) {
+ for(my $i = $start; $i <= $#copy; ++$i) {
+ $actual{$copy[$i]} = $base{$current} . '/' .
+ dirname($copy[$i]);
+ }
+ }
}
}
}
@@ -208,11 +243,14 @@ sub usageAndExit {
my($base) = basename($0);
my($spc) = ' ' x (length($base) + 8);
print STDERR "$base v$version\n",
- "Usage: $base [-a tag1[,tagN]] [-s tag1[,tagN]] [-v]\n",
- $spc, "[install directory] [$insext files or directories]\n\n",
+ "Usage: $base [-a tag1[,tagN]] [-b tag=dir] [-o tag=dir]\n",
+ $spc, "[-s tag1[,tagN]] [-v] [install directory]\n",
+ $spc, "[$insext files or directories]\n\n",
"Install files matching the tag specifications found ",
"in $insext files.\n\n",
"-a Adds to the default set of tags that get copied.\n",
+ "-b Install tag into dir underneath the install directory.\n",
+ "-o Install tag into dir.\n",
"-s Sets the tags that get copied.\n",
"-v Enables verbose mode.\n",
"\n",
@@ -251,6 +289,37 @@ for(my $i = 0; $i <= $#ARGV; ++$i) {
usageAndExit('-a requires a parameter.');
}
}
+ elsif ($arg eq '-b') {
+ ++$i;
+ if (defined $ARGV[$i]) {
+ if ($ARGV[$i] =~ /([^=]+)=(.*)/) {
+ $base{$1} = $2;
+ }
+ else {
+ usageAndExit("Invalid parameter to -b: $ARGV[$i]");
+ }
+ }
+ else {
+ usageAndExit('-b requires a parameter.');
+ }
+ }
+ elsif ($arg eq '-k') {
+ $keepgoing = 1;
+ }
+ elsif ($arg eq '-o') {
+ ++$i;
+ if (defined $ARGV[$i]) {
+ if ($ARGV[$i] =~ /([^=]+)=(.*)/) {
+ $override{$1} = $2;
+ }
+ else {
+ usageAndExit("Invalid parameter to -o: $ARGV[$i]");
+ }
+ }
+ else {
+ usageAndExit('-o requires a parameter.');
+ }
+ }
elsif ($arg eq '-s') {
++$i;
if (defined $ARGV[$i]) {
@@ -259,7 +328,6 @@ for(my $i = 0; $i <= $#ARGV; ++$i) {
$tags{$tag} = 1;
}
}
-
else {
usageAndExit('-s requires a parameter.');
}
diff --git a/templates/make.mpd b/templates/make.mpd
index 14b12d22..2bebf0c9 100644
--- a/templates/make.mpd
+++ b/templates/make.mpd
@@ -26,13 +26,15 @@ CPPFLAGS = $(PICFLAGS) $(GENFLAGS)<%if(compile_flags)%> <%compile_flags%><%
OBJEXT = <%obj_ext%>
OUTPUT_OPTION = <%output_option(-o \"$@\")%>
COMPILE.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) <%compile_option("-c")%>
+<%foreach(platforms)%>
<%if(build64bit && arflags64)%>
-ARFLAGS = <%arflags64%>
+ARFLAGS = <%if(extraarflags)%><%extraarflags%> <%endif%><%arflags64%>
<%else%>
<%if(arflags)%>
-ARFLAGS = <%arflags%>
+ARFLAGS = <%if(extraarflags)%><%extraarflags%> <%endif%><%arflags%>
<%endif%>
<%endif%>
+<%endfor%>
<%if(tempinc)%>
TEMPINCDIR = <%tempinc%><%slash%><%project_name%>
<%endif%>
diff --git a/templates/makedll.mpt b/templates/makedll.mpt
index d93a85ce..58e9921c 100644
--- a/templates/makedll.mpt
+++ b/templates/makedll.mpt
@@ -138,6 +138,14 @@ NCC {
platforms = tandem
}
+ghsppc {
+ cxx = cxppc
+ ar = cxppc
+ arflags = -archive -o
+ compilerflags = --one_instantiation_per_object --exceptions
+ platforms = integrity
+}
+
// ***********************************************************************
// Platform Section
// ***********************************************************************
@@ -236,4 +244,20 @@ tandem {
extracppflags = -D_REENTRANT
}
+// For Integrity, the following should be set as environment variables, on
+// the make command line or within a verbatim section in your mpc file.
+//
+// GHSROOT The full path to your Green Hills installation.
+// RTOSROOT The full path to your BSP installation (probably $GHSROOT).
+// BSP The BSP name (ex. sim800).
+// TARGET_BSP The full path to your target BSP.
+// TARGET_LD The full path to your target ld file.
+//
+integrity {
+ dll_ext =
+ ldlibs = -lshm_client -lnet -livfssca -lposixsca
+ extraarflags = -bspname=$(RTOSROOT)/target/$(BSP).bld
+ extracppflags = -integrate -dynamic -bspname=$(RTOSROOT)/target/$(BSP).bld -os_dir $(GHSROOT) -non_shared -Uvector -bspfile=$(TARGET_BSP) $(TARGET_LD)
+}
+
conditional_include "user_makedll"