blob: 07219dc1d7777e17c00d0276d0dc97accd77a522 [file] [log] [blame]
Wink Savillefbaaef92010-05-27 16:25:37 -07001#!/bin/sh
2
3# Run this script to regenerate descriptor.pb.{h,cc} after the protocol
4# compiler changes. Since these files are compiled into the protocol compiler
5# itself, they cannot be generated automatically by a make rule. "make check"
6# will fail if these files do not match what the protocol compiler would
7# generate.
8#
9# HINT: Flags passed to generate_descriptor_proto.sh will be passed directly
10# to make when building protoc. This is particularly useful for passing
11# -j4 to run 4 jobs simultaneously.
12
13if test ! -e src/google/protobuf/stubs/common.h; then
14 cat >&2 << __EOF__
15Could not find source code. Make sure you are running this script from the
16root of the distribution tree.
17__EOF__
18 exit 1
19fi
20
21if test ! -e src/Makefile; then
22 cat >&2 << __EOF__
23Could not find src/Makefile. You must run ./configure (and perhaps
24./autogen.sh) first.
25__EOF__
26 exit 1
27fi
28
29cd src
Wink Savilled0332952010-05-29 13:00:38 -070030make $@ protoc &&
31 ./protoc --cpp_out=dllexport_decl=LIBPROTOBUF_EXPORT:. google/protobuf/descriptor.proto && \
32 ./protoc --cpp_out=dllexport_decl=LIBPROTOC_EXPORT:. google/protobuf/compiler/plugin.proto
Wink Savillefbaaef92010-05-27 16:25:37 -070033cd ..