Changeset 7dd22c32 in rtems for tools


Ignore:
Timestamp:
Jan 10, 2006, 5:51:03 PM (15 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
b46f6fb2
Parents:
445b9740
Message:

2006-10-10 Ralf Corsepius <ralf.corsepius@…>

  • ampolish3.im: Update.
Location:
tools/build
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tools/build/ChangeLog

    r445b9740 r7dd22c32  
     12006-10-10      Ralf Corsepius <ralf.corsepius@rtems.org>
     2
     3        * ampolish3.im: Update.
     4
    152005-10-25      Ralf Corsepius <ralf.corsepius@rtems.org>
    26
  • tools/build/ampolish3.in

    r445b9740 r7dd22c32  
    1515sub print_dirstamp($$$);
    1616
    17 # Predefined directory mappings
     17# Predefined directory mappings:
     18#
    1819# final-installation directory => temp installation directory
    1920my %dirmap = (
     
    2425  );
    2526
     27# Conventions on automake primaries:
     28#
     29# *_HEADERS -> preinstall
     30# noinst*_HEADERS -> noinst
     31# noinst_*_LIBRARIES -> noinst
     32# project_*_LIBRARIES -> tmpinstall
     33# *_LIBRARIES -> ignore (no preinstallation)
     34# dist_project_*_DATA -> preinstall (bsp_specs,linkcmds)
     35# project_*_DATA -> tmpinstall (*.o, *.a)
     36# dist_*_DATA -> ignore (no preinstallation)
     37# *SCRIPTS -> ignore (no preinstallation)
     38# noinst_*_PROGRAMS -> noinst
     39# project_*_PROGRAMS -> tmpinstall
     40# *_PROGRAMS -> ignore (no preinstallation)
     41
    2642## 1st pass: read in file
    2743my @buffer1 = () ;
    2844my %seen = ();
     45my %predefs = ();
    2946
    3047{
     
    5673}
    5774
    58 #foreach my $l ( @buffer1 ) { print STDERR "1<$l>"; }
     75#foreach my $l ( @buffer1 ) { print STDERR "1:<$l>"; }
    5976
    6077# Filter out all Makefile code not relevant here
     
    6885    $dirmap{"\$\($1\)"} = replace($2);
    6986  } elsif ( $l =~ /^\s*noinst_(.*)\s*[\+]?\=(.*)$/o )
    70   { #ignore: noinst_* are not relevant here.
    71   } elsif ( $l =~ /^\s*(nodist_|dist_|)(project_|)(include|lib)_(HEADERS|LIBRARIES)\s*\=(.*)/o )
     87  {
     88    #ignore: noinst_* are not relevant here.
     89  } elsif ( $l =~ /^\s*(nodist_|dist_|)(project_|)([a-zA-Z0-9_]+)_(HEADERS|LIBRARIES|DATA|SCRIPTS|PROGRAMS)\s*([\+]?\=)\s*(.*)/o )
    7290  {
    73     push @buffer2, "$3dir = \$($3dir)\n";
    74     push @buffer2, "$l";
    75   } elsif ( $l =~ /^\s*(nodist_|dist_|)(project_|)([a-zA-Z0-9_]+)_(HEADERS)\s*[\+]?\=(.*)/o )
    76   {
    77     push @buffer2, "$l";
    78   } elsif ( $l =~ /^\s*(nodist_|dist_|)(project_[a-zA-Z0-9_]+)_(DATA|SCRIPTS|LIBRARIES|PROGRAMS)\s*[\+]?\=(.*)/o )
    79   {
    80     push @buffer2, "$l";
     91    if ( ( "$5" eq '=' ) ) {
     92      my $v = $dirmap{"\$\($3dir\)"};
     93      if ( $v =~ /\$\(PROJECT_[^\)]+\)$/ )
     94      {
     95         $predefs{"$v"} = 1;
     96      }
     97    }
     98    foreach my $f ( split(' ',$6) ) {
     99      push @buffer2, "$1$2$3_$4 +=$f\n";
     100    }
    81101  } elsif ( $l =~ /^\s*(if|else|endif)\s*.*$/o )
    82102  { # conditionals
     
    85105}
    86106
    87 # foreach my $l ( @buffer2 ) { print STDERR "$l"; }
     107if ( $predefs{"\$(PROJECT_INCLUDE)"} ){
     108  unshift @buffer2, "includedir = \$(includedir)\n";
     109}
     110if ( $predefs{"\$(PROJECT_LIB)"} ){
     111  unshift @buffer2, "libdir = \$(libdir)\n";
     112}
     113
     114# foreach my $l ( @buffer2 ) { print STDERR "2:<$l>"; }
    88115
    89116my @buffer3 = ();
    90117
    91118foreach my $l ( @buffer2 ) {
    92   if ( $l =~ /^\s*([a-zA-Z0-9_]*dir)\s*\=\s*(.*)\s*$/o )
     119 if ( $l =~ /^\s*([a-zA-Z0-9_]*dir)\s*\=\s*(.*)\s*$/o )
    93120  { # dirs
    94121    my $v = $dirmap{"\$\($1\)"};
    95122    print_dirstamp(\@buffer3,$v,"PREINSTALL_DIRS");
    96123    $seen{"PREINSTALL_DIRS"} = 1;
    97   } elsif ( $l =~ /^\s*(nodist_|)([a-zA-Z0-9_]*)_HEADERS\s*[\+]?\=(.*)$/o )
    98   {
    99       my $v = $dirmap{"\$\($2dir\)"};
    100       my @instfiles = split(' ',$3);
    101       foreach my $f ( @instfiles )
    102       {
    103         my $x ;
    104         my $i = rindex($f,'/');
    105         if ($i < 0) {
    106           $x="$f";
    107         } else {
    108           $x = substr($f,$i+1);
    109         }
    110         push @buffer3,
     124  } elsif ( $l =~ /^\s*(nodist_|dist_|)(project_|)([a-zA-Z0-9_]+)_HEADERS\s*\+\=(.*)/o )
     125  { # preinstall
     126    my $v = $dirmap{"\$\($3dir\)"};
     127    my $f = $4;
     128    my $x ; my $i = rindex($f,'/');
     129    if ($i < 0) { $x="$f";
     130    } else { $x = substr($f,$i+1);
     131    }
     132    push @buffer3,
    111133          "$v/$x: $f $v/\$(dirstamp)\n",
    112134          "\t\$(INSTALL_DATA) \$< $v/$x\n",
    113135          "PREINSTALL_FILES += $v/$x\n\n";
    114         $seen{"PREINSTALL_FILES"} = 1;
    115       }
    116   } elsif ( $l =~ /^\s*(nodist_|)([a-zA-Z0-9_]*)_SCRIPTS\s*[\+]?\=(.*)$/o )
    117   {
    118       my $v = $dirmap{"\$\($2dir\)"};
    119       my @instfiles = split(' ',$3);
    120       foreach my $f ( @instfiles )
    121       {
    122         my $x ;
    123         my $i = rindex($f,'/');
    124         if ($i < 0) {
    125           $x="$f";
    126         } else {
    127           $x = substr($f,$i+1);
    128         }
    129         push @buffer3,
    130           "$v/$x: $f $v/\$(dirstamp)\n",
    131           "\t\$(INSTALL_SCRIPT) \$< $v/$x\n",
     136    $seen{"PREINSTALL_FILES"} = 1;
     137  } elsif ( $l =~ /^\s*(nodist_|dist_|)(project_)([a-zA-Z0-9_]+)_LIBRARIES\s*\+\=(.*)/o )
     138  { # tmpinstall
     139    my $v = $dirmap{"\$\($3dir\)"};
     140    my $f = $4;
     141    my $x ; my $i = rindex($f,'/');
     142    if ($i < 0) { $x="$f";
     143    } else { $x = substr($f,$i+1);
     144    }
     145    push @buffer3,
     146          "$v/$x: $f $v/\$(dirstamp)\n",
     147          "\t\$(INSTALL_DATA) \$< $v/$x\n",
     148          "TMPINSTALL_FILES += $v/$x\n\n";
     149    $seen{"TMPINSTALL_FILES"} = 1;
     150  } elsif ( $l =~ /^\s*(nodist_|dist_|)([a-zA-Z0-9_]+)_LIBRARIES\s*\+\=(.*)/o )
     151  { # ignore
     152  } elsif ( $l =~ /^\s*(dist_)(project_)([a-zA-Z0-9_]+)_DATA\s*\+\=(.*)/o )
     153  { # preinstall
     154    my $v = $dirmap{"\$\($3dir\)"};
     155    my $f = $4;
     156    my $x ; my $i = rindex($f,'/');
     157    if ($i < 0) { $x="$f";
     158    } else { $x = substr($f,$i+1);
     159    }
     160    push @buffer3,
     161          "$v/$x: $f $v/\$(dirstamp)\n",
     162          "\t\$(INSTALL_DATA) \$< $v/$x\n",
    132163          "PREINSTALL_FILES += $v/$x\n\n";
    133         $seen{"PREINSTALL_FILES"} = 1;
    134       }
    135   } elsif ( $l =~ /^\s*(nodist_|)([a-zA-Z0-9_]*)_PROGRAMS\s*[\+]?\=(.*)$/o )
    136   {
    137       my $v = $dirmap{"\$\($2dir\)"};
    138       my @instfiles = split(' ',$3);
    139       foreach my $f ( @instfiles )
    140       {
    141         my $x ;
    142         my $i = rindex($f,'/');
    143         if ($i < 0) {
    144           $x="$f";
    145         } else {
    146           $x = substr($f,$i+1);
    147         }
    148         push @buffer3,
     164    $seen{"PREINSTALL_FILES"} = 1;
     165  } elsif ( $l =~ /^\s*(nodist_|)(project_)([a-zA-Z0-9_]+)_DATA\s*\+\=(.*)/o )
     166  { # tmpinstall
     167    my $v = $dirmap{"\$\($3dir\)"};
     168    my $f = $4;
     169    my $x ; my $i = rindex($f,'/');
     170    if ($i < 0) { $x="$f";
     171    } else { $x = substr($f,$i+1);
     172    }
     173    push @buffer3,
     174          "$v/$x: $f $v/\$(dirstamp)\n",
     175          "\t\$(INSTALL_DATA) \$< $v/$x\n",
     176          "TMPINSTALL_FILES += $v/$x\n\n";
     177    $seen{"TMPINSTALL_FILES"} = 1;
     178  } elsif ( $l =~ /^\s*(dist_|)([a-zA-Z0-9_]+)_DATA\s*\+\=(.*)/o )
     179  { # ignore
     180  } elsif ( $l =~ /^\s*(nodist_|dist_|)([a-zA-Z0-9_]+)_SCRIPTS\s*\+\=(.*)/o )
     181  { # ignore
     182  } elsif ( $l =~ /^\s*(nodist_|dist_|)(project_)([a-zA-Z0-9_]+)_PROGRAMS\s*\+\=(.*)/o )
     183  { # tmpinstall
     184    my $v = $dirmap{"\$\($3dir\)"};
     185
     186    my $f = $4;
     187    my $x ; my $i = rindex($f,'/');
     188    if ($i < 0) { $x="$f";
     189    } else { $x = substr($f,$i+1);
     190    }
     191    push @buffer3,
    149192          "$v/$x: $f $v/\$(dirstamp)\n",
    150193          "\t\$(INSTALL_PROGRAM) \$< $v/$x\n",
    151194          "TMPINSTALL_FILES += $v/$x\n\n";
    152         $seen{"TMPINSTALL_FILES"} = 1;
    153       }
    154   } elsif ( $l =~ /^\s*(nodist_|)([a-zA-Z0-9_]*)_LIBRARIES\s*[\+]?\=(.*)$/o )
    155   {
    156       my $v = $dirmap{"\$\($2dir\)"};
    157       my @instfiles = split(' ',$3);
    158       foreach my $f ( @instfiles )
    159       {
    160         my $x ;
    161         my $i = rindex($f,'/');
    162         if ($i < 0) {
    163           $x="$f";
    164         } else {
    165           $x = substr($f,$i+1);
    166         }
    167         push @buffer3,
    168           "$v/$x: $f $v/\$(dirstamp)\n",
    169           "\t\$(INSTALL_DATA) \$< $v/$x\n",
    170           "TMPINSTALL_FILES += $v/$x\n\n";
    171         $seen{"TMPINSTALL_FILES"} = 1;
    172       }
    173   } elsif ( $l =~ /^\s*(nodist_|)([a-zA-Z0-9_]*)_DATA\s*[\+]?\=(.*)$/o )
    174   {
    175       my $v = $dirmap{"\$\($2dir\)"};
    176       my @instfiles = split(' ',$3);
    177       foreach my $f ( @instfiles )
    178       {
    179         my $x ;
    180         my $i = rindex($f,'/');
    181         if ($i < 0) {
    182           $x="$f";
    183         } else {
    184           $x = substr($f,$i+1);
    185         }
    186         push @buffer3,
    187           "$v/$x: $f $v/\$(dirstamp)\n",
    188           "\t\$(INSTALL_DATA) \$< $v/$x\n",
    189           "TMPINSTALL_FILES += $v/$x\n\n";
    190         $seen{"TMPINSTALL_FILES"} = 1;
    191       }
     195    $seen{"TMPINSTALL_FILES"} = 1;
     196  } elsif ( $l =~ /^\s*(nodist_|dist_|)([a-zA-Z0-9_]+)_PROGRAMS\s*\+\=(.*)/o )
     197  { # ignore
    192198  } elsif ( $l =~ /^\s*(if|else|endif)\s*.*$/o )
    193199  { # conditionals
     
    196202}
    197203
    198 # foreach my $l ( @buffer3 ) { print STDERR "$l"; }
     204# foreach my $l ( @buffer3 ) { print STDERR "3:<$l>"; }
    199205
    200206my $output;
Note: See TracChangeset for help on using the changeset viewer.