blob: 5b1f71001a1dc1acb10930a59d27888099d7740d [file] [log] [blame]
Jens Geyer0e87c462013-06-18 22:25:07 +02001#
2# Licensed to the Apache Software Foundation (ASF) under one
3# or more contributor license agreements. See the NOTICE file
4# distributed with this work for additional information
5# regarding copyright ownership. The ASF licenses this file
6# to you under the Apache License, Version 2.0 (the
7# "License"); you may not use this file except in compliance
8# with the License. You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing,
13# software distributed under the License is distributed on an
14# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15# KIND, either express or implied. See the License for the
16# specific language governing permissions and limitations
17# under the License.
18#
19
20THRIFT = $(top_builddir)/compiler/cpp/thrift
21
22gen-go/tutorial/calculator.go gen-go/shared/shared_service.go: $(top_srcdir)/tutorial/tutorial.thrift
23 $(THRIFT) --gen go -r $<
24
25all-local: gen-go/tutorial/calculator.go
26
27
28check: src/git.apache.org/thrift.git/lib/go/thrift
29 $(THRIFT) -r --gen go $(top_srcdir)/tutorial/tutorial.thrift
30 cp -r gen-go/* src/
Jens Geyera7da4882013-07-18 00:33:05 +020031 GOPATH=`pwd` $(GO) build ./...
32 GOPATH=`pwd` $(GO) build -o go-tutorial src/*.go
33 GOPATH=`pwd` $(GO) build -o calculator-remote src/tutorial/calculator-remote/calculator-remote.go
Jens Geyer0e87c462013-06-18 22:25:07 +020034
35src/git.apache.org/thrift.git/lib/go/thrift:
36 mkdir -p src/git.apache.org/thrift.git/lib/go
37 ln -sf $(realpath $(top_srcdir)/lib/go/thrift) src/git.apache.org/thrift.git/lib/go/thrift
38
39tutorialserver: all
Jens Geyera7da4882013-07-18 00:33:05 +020040 GOPATH=`pwd` $(GO) run src/*.go -server=true
Jens Geyer0e87c462013-06-18 22:25:07 +020041
42tutorialclient: all
Jens Geyera7da4882013-07-18 00:33:05 +020043 GOPATH=`pwd` $(GO) run src/*.go -client=true
Jens Geyer0e87c462013-06-18 22:25:07 +020044
45clean-local:
46 $(RM) -r gen-*
47
48EXTRA_DIST = \
Jens Geyer470cae32013-06-19 23:30:50 +020049 src/client.go \
50 src/handler.go \
51 src/server.go \
52 src/main.go