blob: 511452dfc8597cb249165ec6efba45c1e9d6c096 [file] [log] [blame]
David Reissea2cba82009-03-30 21:35:00 +00001#
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
David Reiss832b2622007-12-28 18:25:33 +000020ACLOCAL_AMFLAGS = -I ./aclocal
21
Nobuaki Sukegawa11da87e2016-09-10 14:02:19 +090022if WITH_PLUGIN
23# To enable bootstrap, build order is lib/cpp -> compiler -> others
24SUBDIRS = lib/cpp compiler/cpp lib
25if WITH_TESTS
26SUBDIRS += lib/cpp/test
27endif
28else
Roger Meierc88d5812014-01-26 11:51:26 +010029SUBDIRS = compiler/cpp lib
Nobuaki Sukegawa11da87e2016-09-10 14:02:19 +090030endif
Jake Farrell627f1a02011-09-14 03:43:49 +000031
32if WITH_TESTS
33SUBDIRS += test
34endif
David Reisse2113932009-03-26 08:47:07 +000035
Roger Meierc88d5812014-01-26 11:51:26 +010036if WITH_TUTORIAL
jfarrell102c6002013-08-15 21:20:19 -040037SUBDIRS += tutorial
Roger Meierc88d5812014-01-26 11:51:26 +010038endif
jfarrell102c6002013-08-15 21:20:19 -040039
David Reisse2113932009-03-26 08:47:07 +000040dist-hook:
Jens Geyer79f988c2014-10-03 20:42:54 +020041 find $(distdir) -type f \( -iname ".DS_Store" -or -iname "._*" -or -iname ".gitignore" \) | xargs rm -rf
42 find $(distdir) -type d \( -iname ".deps" -or -iname ".libs" \) | xargs rm -rf
43 find $(distdir) -type d \( -iname ".svn" -or -iname ".git" \) | xargs rm -rf
David Reisse2113932009-03-26 08:47:07 +000044
Roger Meier22872782010-10-22 11:20:25 +000045print-version:
James E. King, III0ad20bd2017-09-30 15:44:16 -070046 @echo $(PACKAGE_VERSION)
Roger Meier22872782010-10-22 11:20:25 +000047
Nobuaki Sukegawaf5b795d2015-03-29 14:48:48 +090048.PHONY: precross cross
Roger Meier41ad4342015-03-24 22:30:40 +010049precross-%: all
50 $(MAKE) -C $* precross
51precross: all precross-test precross-lib
Roger Meier7e103292014-02-22 18:13:03 +010052
Nobuaki Sukegawa03f0e182015-05-09 18:33:42 +090053empty :=
54space := $(empty) $(empty)
55comma := ,
56
wilfrem2c69b5a2015-04-20 19:24:50 +090057CROSS_LANGS = @MAYBE_CPP@ @MAYBE_C_GLIB@ @MAYBE_CL@ @MAYBE_D@ @MAYBE_JAVA@ @MAYBE_CSHARP@ @MAYBE_PYTHON@ @MAYBE_PY3@ @MAYBE_RUBY@ @MAYBE_HASKELL@ @MAYBE_PERL@ @MAYBE_PHP@ @MAYBE_GO@ @MAYBE_NODEJS@ @MAYBE_DART@ @MAYBE_ERLANG@ @MAYBE_LUA@ @MAYBE_RS@ @MAYBE_DOTNETCORE@ @MAYBE_NODETS@
Nobuaki Sukegawa03f0e182015-05-09 18:33:42 +090058CROSS_LANGS_COMMA_SEPARATED = $(subst $(space),$(comma),$(CROSS_LANGS))
59
Nobuaki Sukegawaffc2bb32016-01-12 19:20:05 +090060if WITH_PY3
61CROSS_PY=$(PYTHON3)
62else
63CROSS_PY=$(PYTHON)
64endif
65
Nobuaki Sukegawabd165302016-01-19 11:10:07 +090066if WITH_PYTHON
Nobuaki Sukegawa2c64bdd2016-09-04 15:33:40 +090067crossfeature: precross
James E. King III714c77c2018-03-20 19:58:38 -040068 $(CROSS_PY) test/test.py --retry-count 5 --features .* --skip-known-failures --server $(CROSS_LANGS_COMMA_SEPARATED)
Nobuaki Sukegawabd165302016-01-19 11:10:07 +090069else
70# feature test needs python build
Nobuaki Sukegawa2c64bdd2016-09-04 15:33:40 +090071crossfeature:
Nobuaki Sukegawabd165302016-01-19 11:10:07 +090072endif
Roger Meierbb23ead2015-04-11 13:12:35 +020073
Nobuaki Sukegawa2c64bdd2016-09-04 15:33:40 +090074cross-%: precross crossfeature
James E. King III714c77c2018-03-20 19:58:38 -040075 $(CROSS_PY) test/test.py --retry-count 5 --skip-known-failures --server $(CROSS_LANGS_COMMA_SEPARATED) --client $(CROSS_LANGS_COMMA_SEPARATED) --regex "$*"
Nobuaki Sukegawa2c64bdd2016-09-04 15:33:40 +090076
77cross: cross-.*
78
Nobuaki Sukegawa147a5a22015-04-11 23:01:40 +090079TIMES = 1 2 3
Roger Meierbb23ead2015-04-11 13:12:35 +020080fail: precross
Nobuaki Sukegawaffc2bb32016-01-12 19:20:05 +090081 $(CROSS_PY) test/test.py || true
82 $(CROSS_PY) test/test.py --update-expected-failures=overwrite
Nobuaki Sukegawa147a5a22015-04-11 23:01:40 +090083 $(foreach var,$(TIMES),test/test.py -s || true;test/test.py --update-expected-failures=merge;)
Roger Meier41ad4342015-03-24 22:30:40 +010084
Konrad Grochowski05fb8422014-11-24 11:16:54 +010085codespell_skip_files = \
Konrad Grochowski40b2b642014-12-09 15:26:39 +010086 *.jar \
87 *.class \
88 *.so \
Konrad Grochowski05fb8422014-11-24 11:16:54 +010089 *.a \
90 *.la \
91 *.o \
92 *.p12 \
93 *OCamlMakefile \
94 .keystore \
95 .truststore \
96 CHANGES \
97 config.sub \
98 configure \
99 depcomp \
100 libtool.m4 \
101 output.* \
102 rebar \
103 thrift
104
Konrad Grochowski05fb8422014-11-24 11:16:54 +0100105skipped_files = $(subst $(space),$(comma),$(codespell_skip_files))
106
107style-local:
108 codespell --write-changes --skip=$(skipped_files) --disable-colors
109
Jake Farrelle0c53162011-11-16 12:58:36 +0000110EXTRA_DIST = \
jfarrellf13e4312015-08-25 00:39:29 -0400111 .clang-format \
112 .editorconfig \
Jens Geyer79f988c2014-10-03 20:42:54 +0200113 .travis.yml \
Jens Geyerf3a29742017-11-30 22:30:03 +0100114 .rustfmt.toml \
115 .dockerignore \
jfarrellf13e4312015-08-25 00:39:29 -0400116 appveyor.yml \
Jens Geyer79f988c2014-10-03 20:42:54 +0200117 bower.json \
jfarrellf13e4312015-08-25 00:39:29 -0400118 build \
Jens Geyerf3a29742017-11-30 22:30:03 +0100119 bootstrap.sh \
120 cleanup.sh \
jfarrellf13e4312015-08-25 00:39:29 -0400121 CMakeLists.txt \
Jens Geyer79f988c2014-10-03 20:42:54 +0200122 composer.json \
123 contrib \
Roger Meiera199a162015-04-30 18:19:06 +0200124 CONTRIBUTING.md \
Jens Geyer79f988c2014-10-03 20:42:54 +0200125 debian \
126 doc \
127 doap.rdf \
Roger Meier281bdae2015-02-03 21:45:28 +0100128 package.json \
Jens Geyer79f988c2014-10-03 20:42:54 +0200129 sonar-project.properties \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700130 LANGUAGES.md \
Jens Geyer79f988c2014-10-03 20:42:54 +0200131 LICENSE \
132 CHANGES \
133 NOTICE \
Nobuaki Sukegawa73d16372016-03-19 23:32:11 +0900134 README.md \
135 Thrift.podspec