lilypond-1.5.13
[lilypond.git] / bin / autowild
blob0371058399e75d36a7004b8c0b65ad53b832d10c
1 #!/bin/sh
2 # autowild
3 # for those of you that have no wild-automake
5 # ugh
6 verbose=true
7 if test x$1 = x-v; then
8 verbose=echo
9 fi
11 #ugh
12 # PERL=@PERL@
13 PERL=/usr/bin/perl
14 PROGNAME=autowild #don't includee path; this messes up stuff
15 WILD_MAKEFILES=$(find . -name \*.wild)
16 for i in $WILD_MAKEFILES; do
17 dir=$(dirname $i)
18 wild=$(basename $i)
19 make=$(basename $i .wild)
20 TOPDIR=${LILYPOND_SOURCEDIR-`pwd`}
21 (cd $dir
23 $verbose -n "trying $dir/$make.. "
24 cat $wild | $PERL $TOPDIR/bin/wild-perl >> $make.NEW
25 if [ ! -f $make ]; then
26 touch $make
29 if cmp -s $make.NEW $make; then
30 $verbose "autowild: $dir/$make didn't change"
31 rm $make.NEW
32 else
33 mv $make.NEW $make
34 $verbose "autowild: creating $dir/$make"
37 done