projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mp-gcd, gf-gcd: Tweak memory management subtly.
[u/mdw/catacomb]
/
genmodes
diff --git
a/genmodes
b/genmodes
index
a69229a
..
76b82a6
100755
(executable)
--- a/
genmodes
+++ b/
genmodes
@@
-1,5
+1,6
@@
#! /bin/sh
#! /bin/sh
+set -e
baselist=$1
extlist=$2
baselist=$1
extlist=$2
@@
-8,7
+9,7
@@
for i in $baselist; do
for j in $extlist; do
J=`echo "$j" | tr -d '\n' | tr a-z A-Z | tr -c a-zA-Z0-9 _`
guard="CATACOMB_${I}_${J}_H"
for j in $extlist; do
J=`echo "$j" | tr -d '\n' | tr a-z A-Z | tr -c a-zA-Z0-9 _`
guard="CATACOMB_${I}_${J}_H"
- cat >$i-$j.h <<EOF
+ cat >$i-$j.h
.new
<<EOF
/* -*-c-*-
*
* $i-$j.h [generated]
/* -*-c-*-
*
* $i-$j.h [generated]
@@
-37,7
+38,13
@@
${J}_DECL($I, $i)
#endif
EOF
#endif
EOF
- cat >$i-$j.c <<EOF
+ if cmp "$i-$j.h" "$i-$j.h.new" >/dev/null 2>&1; then
+ rm "$i-$j.h.new"
+ else
+ mv "$i-$j.h.new" "$i-$j.h"
+ echo >&2 "Written new $i-$j.h."
+ fi
+ cat >$i-$j.c.new <<EOF
/* -*-c-*-
*
* $i-$j.c [generated]
/* -*-c-*-
*
* $i-$j.c [generated]
@@
-47,5
+54,11
@@
EOF
#include "$j-def.h"
${J}_DEF($I, $i)
EOF
#include "$j-def.h"
${J}_DEF($I, $i)
EOF
+ if cmp "$i-$j.c" "$i-$j.c.new" >/dev/null 2>&1; then
+ rm "$i-$j.c.new"
+ else
+ mv "$i-$j.c.new" "$i-$j.c"
+ echo >&2 "Written new $i-$j.c."
+ fi
done
done
done
done