add "updatemakes" from libtomcrypt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
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$