2008-07-09 Zoltan Varga <vargaz@gmail.com>
[mono.git] / scripts / patch-quiet.sh
1 #!/bin/sh
2
3 #
4 # patch-quiet.sh: Shell script to rewrite Makefiles using libtool to be less verbose
5 #
6
7 if [ "$1" = "" ]; then
8         echo "Usage: patch-quiet.sh <path to Makefile>"
9         exit 1
10 fi
11
12 src=$1
13
14 # compile
15 sed -e 's/^\t$(COMPILE)/\t$(if $(V),,@echo -e "CC\\t$@";) $(COMPILE)/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
16 sed -e 's/^\t$(LTCOMPILE)/\t$(if $(V),,@echo -e "CC\\t$@";) $(LTCOMPILE)/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
17 # link
18 # automake defines multiple symbols ending with LINK
19 sed -e 's/\t$(\(.*LINK\))/\t$(if $(V),,@echo -e "LD\\t$@";) $(\1)/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
20 #sed -e 's/LINK = $(LIBTOOL)/LINK = $(if $(V),,@echo -e "LD\\t$@";) $(LIBTOOL)/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
21 # CC
22 sed -e 's/^\t$(CC)/\t$(if $(V),,@echo -e "CC\\t$@";) $(CC)/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
23 # mv
24 sed -e 's/\tmv -f/\t$(if $(V),,@)mv -f/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
25 # libtool messages
26 sed -e 's/\$(LIBTOOL)/$(LIBTOOL) --quiet/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
27
28 # FIXME: libtool message which is not silenced by --quiet:
29 # $echo "copying selected object files to avoid basename conflicts..."