From 199ff63e5f25aba1e32e920391dd84f03145e33a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 1 Mar 2017 16:00:13 +0100 Subject: [PATCH] add '-c' option to updatemakes.sh --- updatemakes.sh | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/updatemakes.sh b/updatemakes.sh index cbf174f..5fd4775 100755 --- a/updatemakes.sh +++ b/updatemakes.sh @@ -1,29 +1,26 @@ #!/bin/bash +makefiles=(makefile makefile.icc makefile.shared makefile.unix makefile.mingw) + +function update_makefile() { + perl filter.pl $1 tmplist + sed -e 's/ *$//' < tmp.delme > $1 + rm -f tmp.delme +} + bash genlist.sh > tmplist -perl filter.pl makefile tmplist -sed -e 's/ *$//' < tmp.delme > makefile -rm -f tmp.delme - -perl filter.pl makefile.icc tmplist -sed -e 's/ *$//' < tmp.delme > makefile.icc -rm -f tmp.delme - -perl filter.pl makefile.shared tmplist -sed -e 's/ *$//' < tmp.delme > makefile.shared -rm -f tmp.delme - -perl filter.pl makefile.unix tmplist -sed -e 's/ *$//' < tmp.delme > makefile.unix -rm -f tmp.delme - -perl filter.pl makefile.mingw tmplist -sed -e 's/ *$//' < tmp.delme > makefile.mingw -rm -f tmp.delme +for i in "${makefiles[@]}" +do + update_makefile "$i" +done perl filter.pl makefile.msvc tmplist sed -e 's/\.o /.obj /g' -e 's/ *$//' < tmp.delme > makefile.msvc rm -f tmp.delme rm -f tmplist + +if [ $# -eq 1 ] && [ "$1" == "-c" ]; then + git add ${makefiles[@]} makefile.msvc && git commit -m 'Update makefiles' +fi