summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-07-11 17:35:39 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-07-11 17:35:39 +0200
commit3f9dd618670ec74aebd56ba716b817e414f0d5d9 (patch)
tree6ebb1d30d3c3172052157c79f666fb7db01112c6
parentd518218c961cf65395bd900d40106c443740de8f (diff)
downloadcmumble-3f9dd618670ec74aebd56ba716b817e414f0d5d9.tar.gz
cmumble-3f9dd618670ec74aebd56ba716b817e414f0d5d9.tar.bz2
cmumble-3f9dd618670ec74aebd56ba716b817e414f0d5d9.zip
protoc-c.sh: Build in suffixed-subdirs
Fixes race in parallel build.
-rwxr-xr-xsrc/protoc-c.sh12
1 files changed, 7 insertions, 5 deletions
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}"