File tree 5 files changed +100
-2
lines changed
5 files changed +100
-2
lines changed Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import (
4
+ "log"
5
+
6
+ "code.google.com/p/goprotobuf/proto"
7
+ "example_mess"
8
+ )
9
+
10
+ func main () {
11
+ test := & example_mess.Boring {
12
+ Cont : proto .String ("wew" ),
13
+ }
14
+ _ , err := proto .Marshal (test )
15
+ if err != nil {
16
+ log .Fatal ("marshaling error: " , err )
17
+ }
18
+ }
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import (
4
+ "log"
5
+
6
+ "code.google.com/p/goprotobuf/proto"
7
+ "example_mess"
8
+ )
9
+
10
+ func main () {
11
+ test := & example_mess.Boring {
12
+ Cont : proto .String ("wew" ),
13
+ }
14
+ _ , err := proto .Marshal (test )
15
+ if err != nil {
16
+ log .Fatal ("marshaling error: " , err )
17
+ }
18
+ }
Original file line number Diff line number Diff line change 1
1
2
2
CPP_BINS = client_sync server_sync server_async
3
3
4
+ GO_BINS = client server
5
+
4
6
# consider also -lboost_thread-mt -lpthread
5
7
CPP_LIBS = -lboost_system-mt -lprotobuf
6
8
CPP_FLAGS = -Wall -O2 --std=c++11 -L/usr/local/lib
@@ -11,6 +13,8 @@ CPP: $(CPP_BINS)
11
13
12
14
Python : Python/gen/msg_pb2.py
13
15
16
+ Go : $(GO_BINS )
17
+
14
18
$(CPP_BINS ) : % : C++/src/% .cc C++/gen/msg.pb.cc C++/src/asio_server.h
15
19
clang++ $(CPP_FLAGS ) C++/src/$@ .cc C++/gen/msg.pb.cc -o C++/bin/$@ $(CPP_LIBS )
16
20
cp C++/bin/$@ bin/cpp_$@
@@ -26,6 +30,24 @@ Python/gen/msg_pb2.py: msg.proto
26
30
echo " #!/bin/sh\n\npython Python/server.py" > bin/python_server.sh
27
31
chmod +x bin/python_server.sh
28
32
33
+
34
+ $(GO_BINS ) : % : Go/src/% /main.go Go/src/example_mess/msg.pb.go Go/src/code.google.com/p/goprotobuf
35
+ GOPATH=$(CURDIR ) /Go go install $@
36
+ cp Go/bin/$@ bin/go_$@
37
+
38
+ Go/src/example_mess/msg.pb.go : msg.proto
39
+ protoc --go_out=Go/src/example_mess msg.proto
40
+ # GOPATH=$(CURDIR)/Go go install pb_message
41
+
42
+ Go/src/code.google.com/p/goprotobuf :
43
+ GOPATH=$(CURDIR ) /Go go get code.google.com/p/goprotobuf/proto
44
+
45
+
29
46
.PHONY : clean
30
47
clean :
31
- rm -f C++/bin/* C++/gen/* Python/gen/* bin/*
48
+ rm -f C++/bin/* C++/gen/* Python/gen/* bin/* Go/pkg/* /example_mess.a Go/bin/*
49
+
50
+ .PHONY : really_clean
51
+ really_clean : clean
52
+ rm -rf Go/pkg/* Go/src/code.google.com
53
+
Original file line number Diff line number Diff line change 1
- package asio ;
1
+ package example_mess ;
2
2
3
3
4
4
//option optimize_for = LITE_RUNTIME;
You can’t perform that action at this time.
0 commit comments