From 3f9dd618670ec74aebd56ba716b817e414f0d5d9 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Mon, 11 Jul 2011 17:35:39 +0200 Subject: protoc-c.sh: Build in suffixed-subdirs Fixes race in parallel build. --- src/protoc-c.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/protoc-c.sh b/src/protoc-c.sh index 163ff7d..4147799 100755 --- a/src/protoc-c.sh +++ b/src/protoc-c.sh @@ -2,10 +2,12 @@ PROTOC_C=${PROTOC_C:-protoc-c} -mkdir -p .protoc-c_build/ -cp $1 .protoc-c_build/ -cd .protoc-c_build/ +build_dir=".protoc-c_build_$(basename $2)/" + +mkdir -p "${build_dir}" +cp $1 "${build_dir}" +cd "${build_dir}" eval $PROTOC_C --c_out=. $(basename $1) cd .. -mv .protoc-c_build/$(basename $2) $2 -rm -rf .protoc-c_build/ +mv "${build_dir}/$(basename $2)" $2 +rm -rf "${build_dir}" -- cgit