summaryrefslogtreecommitdiffstats
path: root/hacks/glx/molecules.sh
blob: 4f417c3991132b0dac4cde24743ac796314e4f4c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

TARGET=$1
shift
SRCS=$*

TMP=molecules.h.$$
rm -f $TMP
trap "rm -f $TMP" 1 2 3 15 EXIT

if [ -z "$UTILS_SRC" ]; then UTILS_SRC="../../utils"; fi

for f in $SRCS ; do
  sh "$UTILS_SRC/ad2c" "$f" |
    sed 's/",$/\\n"/' >> $TMP
  echo ',' >> $TMP
done

if cmp -s $TMP $TARGET ; then
  rm $TMP
else
  mv $TMP $TARGET
fi