Revert "Revert "and added files""
[bcm963xx.git] / userapps / opensource / net-snmp / perl / make-perl-makefiles
1 #!/usr/bin/perl
2
3 open(I, "Makefile.subs.pl");
4 @stuff = <I>;
5
6 foreach my $i (@ARGV) {
7     print "updating $i\n";
8     open(I, $i);
9     open(O,">$i.new");
10     while(<I>) {
11         # start replacement here
12         last if /common subroutines -- DO NOT EDIT/;
13         print O;
14     }
15     print O "# common subroutines -- DO NOT EDIT.\n";
16     print O "# They are imported from the Makefile.subs.pl file\n";
17     print O @stuff;
18     rename($i,"$i.bak");
19     rename("$i.new", "$i");
20     close(I);
21     close(O);
22 }