add "updatemakes" from libtomcrypt

This commit is contained in:
Steffen Jaeckel 2014-10-13 15:49:02 +02:00
parent da2fc240ef
commit 4f2db5fa8f
4 changed files with 100 additions and 0 deletions

34
filter.pl Executable file
View File

@ -0,0 +1,34 @@
#!/usr/bin/perl
# we want to filter every between START_INS and END_INS out and then insert crap from another file (this is fun)
$dst = shift;
$ins = shift;
open(SRC,"<$dst");
open(INS,"<$ins");
open(TMP,">tmp.delme");
$l = 0;
while (<SRC>) {
if ($_ =~ /START_INS/) {
print TMP $_;
$l = 1;
while (<INS>) {
print TMP $_;
}
close INS;
} elsif ($_ =~ /END_INS/) {
print TMP $_;
$l = 0;
} elsif ($l == 0) {
print TMP $_;
}
}
close TMP;
close SRC;
# $Source$
# $Revision$
# $Date$

8
genlist.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
export a=`find . -maxdepth 1 -type f -name '*.c' | sort | sed -e 'sE\./EE' | sed -e 's/\.c/\.o/' | xargs`
perl ./parsenames.pl OBJECTS "$a"
# $Source$
# $Revision$
# $Date$

25
parsenames.pl Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/perl
#
# Splits the list of files and outputs for makefile type files
# wrapped at 80 chars
#
# Tom St Denis
@a = split(" ", $ARGV[1]);
$b = "$ARGV[0]=";
$len = length($b);
print $b;
foreach my $obj (@a) {
$len = $len + length($obj);
$obj =~ s/\*/\$/;
if ($len > 100) {
printf "\\\n";
$len = length($obj);
}
print "$obj ";
}
print "\n\n";
# $Source$
# $Revision$
# $Date$

33
updatemakes.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
bash genlist.sh > tmplist
perl filter.pl makefile tmplist
sed -e 's/ *$//' < tmp.delme > makefile
rm -f tmp.delme
perl filter.pl makefile.icc tmplist
sed -e 's/ *$//' < tmp.delme > makefile.icc
rm -f tmp.delme
perl filter.pl makefile.shared tmplist
sed -e 's/ *$//' < tmp.delme > makefile.shared
rm -f tmp.delme
perl filter.pl makefile.cygwin_dll tmplist
sed -e 's/ *$//' < tmp.delme > makefile.cygwin_dll
rm -f tmp.delme
perl filter.pl makefile.bcc tmplist
sed -e 's/\.o /.obj /g' -e 's/ *$//' < tmp.delme > makefile.bcc
rm -f tmp.delme
perl filter.pl makefile.msvc tmplist
sed -e 's/\.o /.obj /g' -e 's/ *$//' < tmp.delme > makefile.msvc
rm -f tmp.delme
rm -f tmplist
# $Source$
# $Revision$
# $Date$