jam-cloud/pb/build_protoc

28 lines
718 B
Plaintext
Raw Permalink Normal View History

2012-07-31 04:00:33 +00:00
#!/bin/bash
# this build file uses protoc to build all protocol buffers
# http://code.google.com/p/protobuf/downloads/list
2012-07-31 04:00:33 +00:00
TARGET_CPP="$TARGET/cpp"
TARGET_JAVA="$TARGET/java"
2012-07-31 04:00:33 +00:00
mkdir -p "$TARGET_CPP"
mkdir -p "$TARGET_JAVA"
2012-07-31 04:00:33 +00:00
# if you don't want to put protoc on the command line,
# then set a PROTOC environment variable
if [ -z $PROTOC] ; then
PROTOC="protoc"
fi
command -v $PROTOC >/dev/null 2>&1 || { echo >&2 "protoc is required but not installed. Aborting"; exit 1; }
2012-07-31 04:00:33 +00:00
# die on error at this point
set -e
2012-08-06 04:01:24 +00:00
echo "building cpp protocol buffers"
$PROTOC $PROTO_FILES --cpp_out=$TARGET_CPP --proto_path=$SRC
echo "building java protocol buffers"
$PROTOC $PROTO_FILES --java_out=$TARGET_JAVA --proto_path=$SRC