Tagging 2.4.2.3 (but will be reverting debugger changes, not releasing
[mono.git] / scripts / patch-quiet.sh
bloba2fc34e0f5df7e4039678b726755c3ef6c77d286
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 if head -n1 $src | grep -q '# Postprocessed with patch-quiet\.sh'; then
15 # already handled
16 exit 0
19 echo "# Postprocessed with patch-quiet.sh" > $src.tmp && cat $src >> $src.tmp && cp $src.tmp $src && rm -f $src.tmp
21 # compile
22 sed -e 's/^\t\(if \)\?$(COMPILE)/\t$(if $(V),,@echo -e "CC\\t$@";) \1$(COMPILE)/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
23 sed -e 's/^\t\(if \)\?$(LTCOMPILE)/\t$(if $(V),,@echo -e "CC\\t$@";) \1$(LTCOMPILE)/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
24 # link
25 # automake defines multiple symbols ending with LINK
26 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
27 #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
28 # CC
29 sed -e 's/^\t\(if \)\?$(CC)/\t$(if $(V),,@echo -e "CC\\t$@";) \1$(CC)/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
30 # mv
31 sed -e 's/^\tmv -f/\t$(if $(V),,@)mv -f/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
32 sed -e 's/^am__mv = /&$(if $(V),,@)/' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
33 # libtool messages
34 sed -e 's/\$(LIBTOOL)/$(LIBTOOL) $(if $(V),,--quiet)/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
36 # This causes this script to be rerun if Makefile.am changes
37 sed -e 's/am__depfiles_maybe = depfiles/& quiet/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp