blob: 7357f506aa464b56e47a2d24a3b8b2bc977aa0ea [file] [log] [blame]
Jens Geyerf4598682014-05-08 23:18:44 +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
Roger Meier41ad4342015-03-24 22:30:40 +010020THRIFT = $(top_builddir)/compiler/cpp/thrift
Jens Geyerf4598682014-05-08 23:18:44 +020021THRIFTCMD = $(THRIFT) -out src/gen --gen go:thrift_import=thrift
22THRIFTTEST = $(top_srcdir)/test/ThriftTest.thrift
23
Roger Meier41ad4342015-03-24 22:30:40 +010024precross: bin/testclient bin/testserver
Jens Geyerf4598682014-05-08 23:18:44 +020025
26ThriftTest.thrift: $(THRIFTTEST)
Jens Geyer79f988c2014-10-03 20:42:54 +020027 grep -v list.*map.*list.*map $(THRIFTTEST) > ThriftTest.thrift
Jens Geyerf4598682014-05-08 23:18:44 +020028
29# Thrift for GO has problems with complex map keys: THRIFT-2063
jfarrell8fd8c632014-07-10 09:14:51 -040030gopath: $(THRIFT) ThriftTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020031 mkdir -p src/gen
32 $(THRIFTCMD) ThriftTest.thrift
33 $(THRIFTCMD) ../StressTest.thrift
34 ln -nfs ../../../lib/go/thrift src/thrift
35 GOPATH=`pwd` $(GO) get code.google.com/p/gomock/gomock
36 touch gopath
Jens Geyerf4598682014-05-08 23:18:44 +020037
38bin/testclient: gopath
Jens Geyer79f988c2014-10-03 20:42:54 +020039 GOPATH=`pwd` $(GO) install bin/testclient
Jens Geyerf4598682014-05-08 23:18:44 +020040
41bin/testserver: gopath
Jens Geyer79f988c2014-10-03 20:42:54 +020042 GOPATH=`pwd` $(GO) install bin/testserver
Jens Geyerf4598682014-05-08 23:18:44 +020043
44bin/stress: gopath
Jens Geyer79f988c2014-10-03 20:42:54 +020045 GOPATH=`pwd` $(GO) install bin/stress
Jens Geyerf4598682014-05-08 23:18:44 +020046
47clean-local:
Jens Geyer79f988c2014-10-03 20:42:54 +020048 $(RM) -r src/gen src/code.google.com src/thrift bin pkg gopath ThriftTest.thrift
Jens Geyerf4598682014-05-08 23:18:44 +020049
Roger Meier41ad4342015-03-24 22:30:40 +010050check_PROGRAMS: bin/testclient bin/testserver bin/stress
51
Jens Geyerf4598682014-05-08 23:18:44 +020052check: gopath
Jens Geyer79f988c2014-10-03 20:42:54 +020053 GOPATH=`pwd` $(GO) test -v common/...
Jens Geyerf4598682014-05-08 23:18:44 +020054
55genmock: gopath
Jens Geyer79f988c2014-10-03 20:42:54 +020056 GOPATH=`pwd` $(GO) install code.google.com/p/gomock/mockgen
57 GOPATH=`pwd` bin/mockgen -destination=src/common/mock_handler.go -package=common gen/thrifttest ThriftTest
Jens Geyerf4598682014-05-08 23:18:44 +020058
jfarrell8fd8c632014-07-10 09:14:51 -040059EXTRA_DIST = \
Jens Geyer79f988c2014-10-03 20:42:54 +020060 src/bin \
61 src/common