Commit 4f2db5fa8f98a0b18030d7869bfa0ff8ae25f969

Steffen Jaeckel 2014-10-13T15:49:02

add "updatemakes" from libtomcrypt

diff --git a/filter.pl b/filter.pl
new file mode 100755
index 0000000..a8a50c7
--- /dev/null
+++ b/filter.pl
@@ -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$
diff --git a/genlist.sh b/genlist.sh
new file mode 100755
index 0000000..1f53b66
--- /dev/null
+++ b/genlist.sh
@@ -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$
diff --git a/parsenames.pl b/parsenames.pl
new file mode 100755
index 0000000..cc57673
--- /dev/null
+++ b/parsenames.pl
@@ -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$
diff --git a/updatemakes.sh b/updatemakes.sh
new file mode 100755
index 0000000..54c3b84
--- /dev/null
+++ b/updatemakes.sh
@@ -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$