summaryrefslogtreecommitdiff
path: root/src/protoc-c.sh
blob: 41477995f36e4ad451a11889bdc1d6b989dbb365 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh

PROTOC_C=${PROTOC_C:-protoc-c}

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 "${build_dir}/$(basename $2)" $2
rm -rf "${build_dir}"