mirror of
https://github.com/t-crest/rtems.git
synced 2025-12-05 15:15:48 +00:00
2006-10-10 Ralf Corsepius <ralf.corsepius@rtems.org>
* ampolish3.im: Update.
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
2006-10-10 Ralf Corsepius <ralf.corsepius@rtems.org>
|
||||||
|
|
||||||
|
* ampolish3.im: Update.
|
||||||
|
|
||||||
2005-10-25 Ralf Corsepius <ralf.corsepius@rtems.org>
|
2005-10-25 Ralf Corsepius <ralf.corsepius@rtems.org>
|
||||||
|
|
||||||
* ampolish3.in: Sync with private bleeding-edge .
|
* ampolish3.in: Sync with private bleeding-edge .
|
||||||
|
|||||||
@@ -14,7 +14,8 @@
|
|||||||
sub replace($);
|
sub replace($);
|
||||||
sub print_dirstamp($$$);
|
sub print_dirstamp($$$);
|
||||||
|
|
||||||
# Predefined directory mappings
|
# Predefined directory mappings:
|
||||||
|
#
|
||||||
# final-installation directory => temp installation directory
|
# final-installation directory => temp installation directory
|
||||||
my %dirmap = (
|
my %dirmap = (
|
||||||
'$(includedir)' => '$(PROJECT_INCLUDE)',
|
'$(includedir)' => '$(PROJECT_INCLUDE)',
|
||||||
@@ -23,9 +24,25 @@ my %dirmap = (
|
|||||||
'$(project_includedir)' => '$(PROJECT_INCLUDE)'
|
'$(project_includedir)' => '$(PROJECT_INCLUDE)'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
# Conventions on automake primaries:
|
||||||
|
#
|
||||||
|
# *_HEADERS -> preinstall
|
||||||
|
# noinst*_HEADERS -> noinst
|
||||||
|
# noinst_*_LIBRARIES -> noinst
|
||||||
|
# project_*_LIBRARIES -> tmpinstall
|
||||||
|
# *_LIBRARIES -> ignore (no preinstallation)
|
||||||
|
# dist_project_*_DATA -> preinstall (bsp_specs,linkcmds)
|
||||||
|
# project_*_DATA -> tmpinstall (*.o, *.a)
|
||||||
|
# dist_*_DATA -> ignore (no preinstallation)
|
||||||
|
# *SCRIPTS -> ignore (no preinstallation)
|
||||||
|
# noinst_*_PROGRAMS -> noinst
|
||||||
|
# project_*_PROGRAMS -> tmpinstall
|
||||||
|
# *_PROGRAMS -> ignore (no preinstallation)
|
||||||
|
|
||||||
## 1st pass: read in file
|
## 1st pass: read in file
|
||||||
my @buffer1 = () ;
|
my @buffer1 = () ;
|
||||||
my %seen = ();
|
my %seen = ();
|
||||||
|
my %predefs = ();
|
||||||
|
|
||||||
{
|
{
|
||||||
my $mode = 0 ;
|
my $mode = 0 ;
|
||||||
@@ -55,7 +72,7 @@ my %seen = ();
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#foreach my $l ( @buffer1 ) { print STDERR "1<$l>"; }
|
#foreach my $l ( @buffer1 ) { print STDERR "1:<$l>"; }
|
||||||
|
|
||||||
# Filter out all Makefile code not relevant here
|
# Filter out all Makefile code not relevant here
|
||||||
my @buffer2 = ();
|
my @buffer2 = ();
|
||||||
@@ -67,135 +84,124 @@ foreach my $l ( @buffer1 ) {
|
|||||||
push @buffer2, "$l";
|
push @buffer2, "$l";
|
||||||
$dirmap{"\$\($1\)"} = replace($2);
|
$dirmap{"\$\($1\)"} = replace($2);
|
||||||
} elsif ( $l =~ /^\s*noinst_(.*)\s*[\+]?\=(.*)$/o )
|
} elsif ( $l =~ /^\s*noinst_(.*)\s*[\+]?\=(.*)$/o )
|
||||||
{ #ignore: noinst_* are not relevant here.
|
|
||||||
} elsif ( $l =~ /^\s*(nodist_|dist_|)(project_|)(include|lib)_(HEADERS|LIBRARIES)\s*\=(.*)/o )
|
|
||||||
{
|
{
|
||||||
push @buffer2, "$3dir = \$($3dir)\n";
|
#ignore: noinst_* are not relevant here.
|
||||||
push @buffer2, "$l";
|
} elsif ( $l =~ /^\s*(nodist_|dist_|)(project_|)([a-zA-Z0-9_]+)_(HEADERS|LIBRARIES|DATA|SCRIPTS|PROGRAMS)\s*([\+]?\=)\s*(.*)/o )
|
||||||
} elsif ( $l =~ /^\s*(nodist_|dist_|)(project_|)([a-zA-Z0-9_]+)_(HEADERS)\s*[\+]?\=(.*)/o )
|
|
||||||
{
|
{
|
||||||
push @buffer2, "$l";
|
if ( ( "$5" eq '=' ) ) {
|
||||||
} elsif ( $l =~ /^\s*(nodist_|dist_|)(project_[a-zA-Z0-9_]+)_(DATA|SCRIPTS|LIBRARIES|PROGRAMS)\s*[\+]?\=(.*)/o )
|
my $v = $dirmap{"\$\($3dir\)"};
|
||||||
{
|
if ( $v =~ /\$\(PROJECT_[^\)]+\)$/ )
|
||||||
push @buffer2, "$l";
|
{
|
||||||
|
$predefs{"$v"} = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach my $f ( split(' ',$6) ) {
|
||||||
|
push @buffer2, "$1$2$3_$4 +=$f\n";
|
||||||
|
}
|
||||||
} elsif ( $l =~ /^\s*(if|else|endif)\s*.*$/o )
|
} elsif ( $l =~ /^\s*(if|else|endif)\s*.*$/o )
|
||||||
{ # conditionals
|
{ # conditionals
|
||||||
push @buffer2, "$l";
|
push @buffer2, "$l";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# foreach my $l ( @buffer2 ) { print STDERR "$l"; }
|
if ( $predefs{"\$(PROJECT_INCLUDE)"} ){
|
||||||
|
unshift @buffer2, "includedir = \$(includedir)\n";
|
||||||
|
}
|
||||||
|
if ( $predefs{"\$(PROJECT_LIB)"} ){
|
||||||
|
unshift @buffer2, "libdir = \$(libdir)\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
# foreach my $l ( @buffer2 ) { print STDERR "2:<$l>"; }
|
||||||
|
|
||||||
my @buffer3 = ();
|
my @buffer3 = ();
|
||||||
|
|
||||||
foreach my $l ( @buffer2 ) {
|
foreach my $l ( @buffer2 ) {
|
||||||
if ( $l =~ /^\s*([a-zA-Z0-9_]*dir)\s*\=\s*(.*)\s*$/o )
|
if ( $l =~ /^\s*([a-zA-Z0-9_]*dir)\s*\=\s*(.*)\s*$/o )
|
||||||
{ # dirs
|
{ # dirs
|
||||||
my $v = $dirmap{"\$\($1\)"};
|
my $v = $dirmap{"\$\($1\)"};
|
||||||
print_dirstamp(\@buffer3,$v,"PREINSTALL_DIRS");
|
print_dirstamp(\@buffer3,$v,"PREINSTALL_DIRS");
|
||||||
$seen{"PREINSTALL_DIRS"} = 1;
|
$seen{"PREINSTALL_DIRS"} = 1;
|
||||||
} elsif ( $l =~ /^\s*(nodist_|)([a-zA-Z0-9_]*)_HEADERS\s*[\+]?\=(.*)$/o )
|
} elsif ( $l =~ /^\s*(nodist_|dist_|)(project_|)([a-zA-Z0-9_]+)_HEADERS\s*\+\=(.*)/o )
|
||||||
{
|
{ # preinstall
|
||||||
my $v = $dirmap{"\$\($2dir\)"};
|
my $v = $dirmap{"\$\($3dir\)"};
|
||||||
my @instfiles = split(' ',$3);
|
my $f = $4;
|
||||||
foreach my $f ( @instfiles )
|
my $x ; my $i = rindex($f,'/');
|
||||||
{
|
if ($i < 0) { $x="$f";
|
||||||
my $x ;
|
} else { $x = substr($f,$i+1);
|
||||||
my $i = rindex($f,'/');
|
}
|
||||||
if ($i < 0) {
|
push @buffer3,
|
||||||
$x="$f";
|
|
||||||
} else {
|
|
||||||
$x = substr($f,$i+1);
|
|
||||||
}
|
|
||||||
push @buffer3,
|
|
||||||
"$v/$x: $f $v/\$(dirstamp)\n",
|
"$v/$x: $f $v/\$(dirstamp)\n",
|
||||||
"\t\$(INSTALL_DATA) \$< $v/$x\n",
|
"\t\$(INSTALL_DATA) \$< $v/$x\n",
|
||||||
"PREINSTALL_FILES += $v/$x\n\n";
|
"PREINSTALL_FILES += $v/$x\n\n";
|
||||||
$seen{"PREINSTALL_FILES"} = 1;
|
$seen{"PREINSTALL_FILES"} = 1;
|
||||||
}
|
} elsif ( $l =~ /^\s*(nodist_|dist_|)(project_)([a-zA-Z0-9_]+)_LIBRARIES\s*\+\=(.*)/o )
|
||||||
} elsif ( $l =~ /^\s*(nodist_|)([a-zA-Z0-9_]*)_SCRIPTS\s*[\+]?\=(.*)$/o )
|
{ # tmpinstall
|
||||||
{
|
my $v = $dirmap{"\$\($3dir\)"};
|
||||||
my $v = $dirmap{"\$\($2dir\)"};
|
my $f = $4;
|
||||||
my @instfiles = split(' ',$3);
|
my $x ; my $i = rindex($f,'/');
|
||||||
foreach my $f ( @instfiles )
|
if ($i < 0) { $x="$f";
|
||||||
{
|
} else { $x = substr($f,$i+1);
|
||||||
my $x ;
|
}
|
||||||
my $i = rindex($f,'/');
|
push @buffer3,
|
||||||
if ($i < 0) {
|
|
||||||
$x="$f";
|
|
||||||
} else {
|
|
||||||
$x = substr($f,$i+1);
|
|
||||||
}
|
|
||||||
push @buffer3,
|
|
||||||
"$v/$x: $f $v/\$(dirstamp)\n",
|
"$v/$x: $f $v/\$(dirstamp)\n",
|
||||||
"\t\$(INSTALL_SCRIPT) \$< $v/$x\n",
|
"\t\$(INSTALL_DATA) \$< $v/$x\n",
|
||||||
|
"TMPINSTALL_FILES += $v/$x\n\n";
|
||||||
|
$seen{"TMPINSTALL_FILES"} = 1;
|
||||||
|
} elsif ( $l =~ /^\s*(nodist_|dist_|)([a-zA-Z0-9_]+)_LIBRARIES\s*\+\=(.*)/o )
|
||||||
|
{ # ignore
|
||||||
|
} elsif ( $l =~ /^\s*(dist_)(project_)([a-zA-Z0-9_]+)_DATA\s*\+\=(.*)/o )
|
||||||
|
{ # preinstall
|
||||||
|
my $v = $dirmap{"\$\($3dir\)"};
|
||||||
|
my $f = $4;
|
||||||
|
my $x ; my $i = rindex($f,'/');
|
||||||
|
if ($i < 0) { $x="$f";
|
||||||
|
} else { $x = substr($f,$i+1);
|
||||||
|
}
|
||||||
|
push @buffer3,
|
||||||
|
"$v/$x: $f $v/\$(dirstamp)\n",
|
||||||
|
"\t\$(INSTALL_DATA) \$< $v/$x\n",
|
||||||
"PREINSTALL_FILES += $v/$x\n\n";
|
"PREINSTALL_FILES += $v/$x\n\n";
|
||||||
$seen{"PREINSTALL_FILES"} = 1;
|
$seen{"PREINSTALL_FILES"} = 1;
|
||||||
}
|
} elsif ( $l =~ /^\s*(nodist_|)(project_)([a-zA-Z0-9_]+)_DATA\s*\+\=(.*)/o )
|
||||||
} elsif ( $l =~ /^\s*(nodist_|)([a-zA-Z0-9_]*)_PROGRAMS\s*[\+]?\=(.*)$/o )
|
{ # tmpinstall
|
||||||
{
|
my $v = $dirmap{"\$\($3dir\)"};
|
||||||
my $v = $dirmap{"\$\($2dir\)"};
|
my $f = $4;
|
||||||
my @instfiles = split(' ',$3);
|
my $x ; my $i = rindex($f,'/');
|
||||||
foreach my $f ( @instfiles )
|
if ($i < 0) { $x="$f";
|
||||||
{
|
} else { $x = substr($f,$i+1);
|
||||||
my $x ;
|
}
|
||||||
my $i = rindex($f,'/');
|
push @buffer3,
|
||||||
if ($i < 0) {
|
"$v/$x: $f $v/\$(dirstamp)\n",
|
||||||
$x="$f";
|
"\t\$(INSTALL_DATA) \$< $v/$x\n",
|
||||||
} else {
|
"TMPINSTALL_FILES += $v/$x\n\n";
|
||||||
$x = substr($f,$i+1);
|
$seen{"TMPINSTALL_FILES"} = 1;
|
||||||
}
|
} elsif ( $l =~ /^\s*(dist_|)([a-zA-Z0-9_]+)_DATA\s*\+\=(.*)/o )
|
||||||
push @buffer3,
|
{ # ignore
|
||||||
|
} elsif ( $l =~ /^\s*(nodist_|dist_|)([a-zA-Z0-9_]+)_SCRIPTS\s*\+\=(.*)/o )
|
||||||
|
{ # ignore
|
||||||
|
} elsif ( $l =~ /^\s*(nodist_|dist_|)(project_)([a-zA-Z0-9_]+)_PROGRAMS\s*\+\=(.*)/o )
|
||||||
|
{ # tmpinstall
|
||||||
|
my $v = $dirmap{"\$\($3dir\)"};
|
||||||
|
|
||||||
|
my $f = $4;
|
||||||
|
my $x ; my $i = rindex($f,'/');
|
||||||
|
if ($i < 0) { $x="$f";
|
||||||
|
} else { $x = substr($f,$i+1);
|
||||||
|
}
|
||||||
|
push @buffer3,
|
||||||
"$v/$x: $f $v/\$(dirstamp)\n",
|
"$v/$x: $f $v/\$(dirstamp)\n",
|
||||||
"\t\$(INSTALL_PROGRAM) \$< $v/$x\n",
|
"\t\$(INSTALL_PROGRAM) \$< $v/$x\n",
|
||||||
"TMPINSTALL_FILES += $v/$x\n\n";
|
"TMPINSTALL_FILES += $v/$x\n\n";
|
||||||
$seen{"TMPINSTALL_FILES"} = 1;
|
$seen{"TMPINSTALL_FILES"} = 1;
|
||||||
}
|
} elsif ( $l =~ /^\s*(nodist_|dist_|)([a-zA-Z0-9_]+)_PROGRAMS\s*\+\=(.*)/o )
|
||||||
} elsif ( $l =~ /^\s*(nodist_|)([a-zA-Z0-9_]*)_LIBRARIES\s*[\+]?\=(.*)$/o )
|
{ # ignore
|
||||||
{
|
|
||||||
my $v = $dirmap{"\$\($2dir\)"};
|
|
||||||
my @instfiles = split(' ',$3);
|
|
||||||
foreach my $f ( @instfiles )
|
|
||||||
{
|
|
||||||
my $x ;
|
|
||||||
my $i = rindex($f,'/');
|
|
||||||
if ($i < 0) {
|
|
||||||
$x="$f";
|
|
||||||
} else {
|
|
||||||
$x = substr($f,$i+1);
|
|
||||||
}
|
|
||||||
push @buffer3,
|
|
||||||
"$v/$x: $f $v/\$(dirstamp)\n",
|
|
||||||
"\t\$(INSTALL_DATA) \$< $v/$x\n",
|
|
||||||
"TMPINSTALL_FILES += $v/$x\n\n";
|
|
||||||
$seen{"TMPINSTALL_FILES"} = 1;
|
|
||||||
}
|
|
||||||
} elsif ( $l =~ /^\s*(nodist_|)([a-zA-Z0-9_]*)_DATA\s*[\+]?\=(.*)$/o )
|
|
||||||
{
|
|
||||||
my $v = $dirmap{"\$\($2dir\)"};
|
|
||||||
my @instfiles = split(' ',$3);
|
|
||||||
foreach my $f ( @instfiles )
|
|
||||||
{
|
|
||||||
my $x ;
|
|
||||||
my $i = rindex($f,'/');
|
|
||||||
if ($i < 0) {
|
|
||||||
$x="$f";
|
|
||||||
} else {
|
|
||||||
$x = substr($f,$i+1);
|
|
||||||
}
|
|
||||||
push @buffer3,
|
|
||||||
"$v/$x: $f $v/\$(dirstamp)\n",
|
|
||||||
"\t\$(INSTALL_DATA) \$< $v/$x\n",
|
|
||||||
"TMPINSTALL_FILES += $v/$x\n\n";
|
|
||||||
$seen{"TMPINSTALL_FILES"} = 1;
|
|
||||||
}
|
|
||||||
} elsif ( $l =~ /^\s*(if|else|endif)\s*.*$/o )
|
} elsif ( $l =~ /^\s*(if|else|endif)\s*.*$/o )
|
||||||
{ # conditionals
|
{ # conditionals
|
||||||
push @buffer3, "$l";
|
push @buffer3, "$l";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# foreach my $l ( @buffer3 ) { print STDERR "$l"; }
|
# foreach my $l ( @buffer3 ) { print STDERR "3:<$l>"; }
|
||||||
|
|
||||||
my $output;
|
my $output;
|
||||||
$output .= "## Automatically generated by ampolish3 - Do not edit\n\n";
|
$output .= "## Automatically generated by ampolish3 - Do not edit\n\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user