diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-07-11 17:35:39 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-07-11 17:35:39 +0200 |
commit | 3f9dd618670ec74aebd56ba716b817e414f0d5d9 (patch) | |
tree | 6ebb1d30d3c3172052157c79f666fb7db01112c6 /src | |
parent | d518218c961cf65395bd900d40106c443740de8f (diff) | |
download | cmumble-3f9dd618670ec74aebd56ba716b817e414f0d5d9.tar.gz cmumble-3f9dd618670ec74aebd56ba716b817e414f0d5d9.tar.bz2 cmumble-3f9dd618670ec74aebd56ba716b817e414f0d5d9.zip |
protoc-c.sh: Build in suffixed-subdirs
Fixes race in parallel build.
Diffstat (limited to 'src')
-rwxr-xr-x | src/protoc-c.sh | 12 |
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}" |