2008-09-18 Michael Hutchinson <mhutchinson@novell.com>
[mono-project.git] / scripts / patch-quiet.sh
blob9c18d6db2f08ce3f6ff93025229568a412894e0c
1 #!/bin/sh
4 # patch-quiet.sh: Shell script to rewrite Makefiles using libtool to be less verbose
7 if [ "$1" = "" ]; then
8 echo "Usage: patch-quiet.sh <path to Makefile>"
9 exit 1
12 src=$1
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
28 # FIXME: libtool message which is not silenced by --quiet:
29 # $echo "copying selected object files to avoid basename conflicts..."