blob: 92ddc93c95596ff72ed6b9fd581d57972681be42 [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
Nobuaki Sukegawaef0a8fa2015-05-10 20:21:17 +090020BUILT_SOURCES = gopath
21
Yuxuan 'fishy' Wange8353cb2022-10-28 10:29:25 -070022GOBUILDEXTRA = -buildvcs=false
Yuxuan 'fishy' Wang8045d822022-04-19 14:31:39 -070023
Yuxuan 'fishy' Wangb71f11e2021-03-22 15:01:00 -070024THRIFTCMD = $(THRIFT) -out src/gen --gen go:thrift_import=github.com/apache/thrift/lib/go/thrift,package_prefix=github.com/apache/thrift/test/go/src/gen/$(COMPILER_EXTRAFLAG)
Yuxuan 'fishy' Wang2acfe0f2022-10-21 10:27:40 -070025THRIFTTEST = $(top_srcdir)/test/ThriftTest.thrift
Jens Geyerf4598682014-05-08 23:18:44 +020026
Roger Meier41ad4342015-03-24 22:30:40 +010027precross: bin/testclient bin/testserver
Jens Geyerf4598682014-05-08 23:18:44 +020028
29ThriftTest.thrift: $(THRIFTTEST)
Jens Geyer79f988c2014-10-03 20:42:54 +020030 grep -v list.*map.*list.*map $(THRIFTTEST) > ThriftTest.thrift
Jens Geyerf4598682014-05-08 23:18:44 +020031
D. Can Celasun4f77ab82017-09-21 15:21:00 +020032.PHONY: gopath
33
Jens Geyerf4598682014-05-08 23:18:44 +020034# Thrift for GO has problems with complex map keys: THRIFT-2063
jfarrell8fd8c632014-07-10 09:14:51 -040035gopath: $(THRIFT) ThriftTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020036 mkdir -p src/gen
37 $(THRIFTCMD) ThriftTest.thrift
38 $(THRIFTCMD) ../StressTest.thrift
Yuxuan 'fishy' Wang2acfe0f2022-10-21 10:27:40 -070039 $(THRIFTCMD) ../ConstantsDemo.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020040 touch gopath
Jens Geyerf4598682014-05-08 23:18:44 +020041
42bin/testclient: gopath
Yuxuan 'fishy' Wange8353cb2022-10-28 10:29:25 -070043 $(GO) build $(GOBUILDEXTRA) -o bin/testclient ./src/bin/testclient
Jens Geyerf4598682014-05-08 23:18:44 +020044
45bin/testserver: gopath
Yuxuan 'fishy' Wange8353cb2022-10-28 10:29:25 -070046 $(GO) build $(GOBUILDEXTRA) -o bin/testserver ./src/bin/testserver
Jens Geyerf4598682014-05-08 23:18:44 +020047
48bin/stress: gopath
Yuxuan 'fishy' Wange8353cb2022-10-28 10:29:25 -070049 $(GO) build $(GOBUILDEXTRA) -o bin/stress ./src/bin/stress
Jens Geyerf4598682014-05-08 23:18:44 +020050
51clean-local:
Jens Geyer8b470022015-06-19 21:22:57 +020052 $(RM) -r src/gen src/github.com/golang src/thrift bin pkg gopath ThriftTest.thrift
Jens Geyerf4598682014-05-08 23:18:44 +020053
Roger Meier41ad4342015-03-24 22:30:40 +010054check_PROGRAMS: bin/testclient bin/testserver bin/stress
55
taozle5c302e02017-07-23 15:21:44 +020056check: gopath genmock
Yuxuan 'fishy' Wange8353cb2022-10-28 10:29:25 -070057 $(GO) test -v ./src/common/...
58 $(GO) test -v ./src/gen/...
Jens Geyerf4598682014-05-08 23:18:44 +020059
60genmock: gopath
D. Can Celasune0e1a082019-05-10 09:18:11 +020061 sh genmock.sh
Jens Geyerf4598682014-05-08 23:18:44 +020062
jfarrell8fd8c632014-07-10 09:14:51 -040063EXTRA_DIST = \
Jens Geyer79f988c2014-10-03 20:42:54 +020064 src/bin \
Jens Geyer2ef01132021-02-04 22:41:50 +010065 src/common \
Jens Geyer0d0ac752024-03-12 21:49:28 +010066 go.mod \
67 go.sum \
Jens Geyer2ef01132021-02-04 22:41:50 +010068 genmock.sh