blob: a146d5c9fa9db839d04afeb8cf548808624f7cce [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
taozle5c302e02017-07-23 15:21:44 +020020if GOVERSION_LT_17
21COMPILER_EXTRAFLAG=":legacy_context"
22endif
23
Jens Geyer0e87c462013-06-18 22:25:07 +020024gen-go/tutorial/calculator.go gen-go/shared/shared_service.go: $(top_srcdir)/tutorial/tutorial.thrift
taozle5c302e02017-07-23 15:21:44 +020025 $(THRIFT) --gen go$(COMPILER_EXTRAFLAG) -r $<
Jens Geyer0e87c462013-06-18 22:25:07 +020026
27all-local: gen-go/tutorial/calculator.go
28
taozlec0d384a2017-07-17 18:40:42 +020029check: src/git.apache.org/thrift.git/lib/go/thrift thirdparty-dep
taozle5c302e02017-07-23 15:21:44 +020030 $(THRIFT) -r --gen go$(COMPILER_EXTRAFLAG) $(top_srcdir)/tutorial/tutorial.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020031 cp -r gen-go/* src/
taozlec0d384a2017-07-17 18:40:42 +020032 GOPATH=`pwd` $(GO) build -o go-tutorial ./src
Jens Geyer79f988c2014-10-03 20:42:54 +020033 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:
Jens Geyer79f988c2014-10-03 20:42:54 +020036 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
Jens Geyer0e87c462013-06-18 22:25:07 +020038
taozlec0d384a2017-07-17 18:40:42 +020039thirdparty-dep:
40 mkdir -p src/golang.org/x/net
41 GOPATH=`pwd`/gopath $(GO) get golang.org/x/net/context
42 ln -sf `pwd`/gopath/src/golang.org/x/net/context src/golang.org/x/net/context
43
Jens Geyer0e87c462013-06-18 22:25:07 +020044tutorialserver: all
Jens Geyer79f988c2014-10-03 20:42:54 +020045 GOPATH=`pwd` $(GO) run src/*.go -server=true
Jens Geyer0e87c462013-06-18 22:25:07 +020046
47tutorialclient: all
taozlec0d384a2017-07-17 18:40:42 +020048 GOPATH=`pwd` $(GO) run src/*.go
Jens Geyer4c835952013-08-13 21:34:17 +020049
50tutorialsecureserver: all
Jens Geyer79f988c2014-10-03 20:42:54 +020051 GOPATH=`pwd` $(GO) run src/*.go -server=true -secure=true
Jens Geyer4c835952013-08-13 21:34:17 +020052
53tutorialsecureclient: all
Jens Geyer79f988c2014-10-03 20:42:54 +020054 GOPATH=`pwd` $(GO) run src/*.go -secure=true
Jens Geyer0e87c462013-06-18 22:25:07 +020055
56clean-local:
Jens Geyer79f988c2014-10-03 20:42:54 +020057 $(RM) -r gen-* src/shared src/tutorial src/git.apache.org go-tutorial calculator-remote
Jens Geyer0e87c462013-06-18 22:25:07 +020058
59EXTRA_DIST = \
Jens Geyer79f988c2014-10-03 20:42:54 +020060 src/client.go \
61 src/handler.go \
62 src/server.go \
63 src/main.go \
Jens Geyerf3a29742017-11-30 22:30:03 +010064 src/go17.go \
65 src/handler_go17.go \
66 src/pre_go17.go \
Jens Geyer79f988c2014-10-03 20:42:54 +020067 server.crt \
68 server.key
jfarrell102c6002013-08-15 21:20:19 -040069