diff options
Diffstat (limited to 'examples/Makefile')
-rw-r--r-- | examples/Makefile | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/examples/Makefile b/examples/Makefile index 8dc90836..51f13426 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -5,6 +5,8 @@ all: cpp java python cpp: add_person_cpp list_people_cpp +go: add_person_go list_people_go +gotest: add_person_gotest list_people_gotest java: add_person_java list_people_java python: add_person_python list_people_python @@ -13,6 +15,8 @@ clean: rm -f javac_middleman AddPerson*.class ListPeople*.class com/example/tutorial/*.class rm -f protoc_middleman addressbook.pb.cc addressbook.pb.h addressbook_pb2.py com/example/tutorial/AddressBookProtos.java rm -f *.pyc + rm -f protoc_middleman_go tutorial/*.pb.go add_person_go list_people_go + rmdir tutorial 2>/dev/null || true rmdir com/example/tutorial 2>/dev/null || true rmdir com/example 2>/dev/null || true rmdir com 2>/dev/null || true @@ -21,6 +25,11 @@ protoc_middleman: addressbook.proto protoc --cpp_out=. --java_out=. --python_out=. addressbook.proto @touch protoc_middleman +protoc_middleman_go: addressbook.proto + mkdir tutorial # make directory for go package + protoc --go_out=tutorial addressbook.proto + @touch protoc_middleman_go + add_person_cpp: add_person.cc protoc_middleman pkg-config --cflags protobuf # fails if protobuf is not installed c++ add_person.cc addressbook.pb.cc -o add_person_cpp `pkg-config --cflags --libs protobuf` @@ -29,6 +38,18 @@ list_people_cpp: list_people.cc protoc_middleman pkg-config --cflags protobuf # fails if protobuf is not installed c++ list_people.cc addressbook.pb.cc -o list_people_cpp `pkg-config --cflags --libs protobuf` +add_person_go: add_person.go protoc_middleman_go + go build -o add_person_go add_person.go + +add_person_gotest: add_person_test.go add_person_go + go test add_person.go add_person_test.go + +list_people_go: list_people.go protoc_middleman_go + go build -o list_people_go list_people.go + +list_people_gotest: list_people.go list_people_go + go test list_people.go list_people_test.go + javac_middleman: AddPerson.java ListPeople.java protoc_middleman javac AddPerson.java ListPeople.java com/example/tutorial/AddressBookProtos.java @touch javac_middleman |