blob: 104d3705a49509bd417fc887d964381faac1aeed [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
James E. King IIIb96c4382019-01-24 17:45:07 -050040clean-local:
41 $(RM) -r vendor/
42
43distclean-local:
44 $(RM) -r .dub/
45 $(RM) -r autom4te.cache/
46
47CLEANFILES = \
48 composer.lock \
49 dub.selections.json
50
51DISTCLEANFILES = \
52 Makefile \
53 Makefile.in \
54 apache-thrift-test-library \
55 autoscan.log \
56 compile \
57 config.guess \
58 config.hin \
59 config.hin~ \
60 config.log \
61 config.status \
62 config.sub \
63 configure \
64 configure.scan \
65 debcomp \
66 install-sh \
67 ltmain.sh \
68 missing \
69 ylwrap
70
David Reisse2113932009-03-26 08:47:07 +000071dist-hook:
James E. King IIIb96c4382019-01-24 17:45:07 -050072 find $(distdir) -type f \( -iname ".DS_Store" -or -iname "._*" -or -iname ".gitignore" \) | xargs rm -f
Jens Geyer79f988c2014-10-03 20:42:54 +020073 find $(distdir) -type d \( -iname ".deps" -or -iname ".libs" \) | xargs rm -rf
74 find $(distdir) -type d \( -iname ".svn" -or -iname ".git" \) | xargs rm -rf
David Reisse2113932009-03-26 08:47:07 +000075
Roger Meier22872782010-10-22 11:20:25 +000076print-version:
James E. King, III0ad20bd2017-09-30 15:44:16 -070077 @echo $(PACKAGE_VERSION)
Roger Meier22872782010-10-22 11:20:25 +000078
Nobuaki Sukegawaf5b795d2015-03-29 14:48:48 +090079.PHONY: precross cross
Roger Meier41ad4342015-03-24 22:30:40 +010080precross-%: all
81 $(MAKE) -C $* precross
82precross: all precross-test precross-lib
Roger Meier7e103292014-02-22 18:13:03 +010083
Nobuaki Sukegawa03f0e182015-05-09 18:33:42 +090084empty :=
85space := $(empty) $(empty)
86comma := ,
87
wilfrem2c69b5a2015-04-20 19:24:50 +090088CROSS_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 +090089CROSS_LANGS_COMMA_SEPARATED = $(subst $(space),$(comma),$(CROSS_LANGS))
90
Nobuaki Sukegawaffc2bb32016-01-12 19:20:05 +090091if WITH_PY3
92CROSS_PY=$(PYTHON3)
93else
94CROSS_PY=$(PYTHON)
95endif
96
Nobuaki Sukegawabd165302016-01-19 11:10:07 +090097if WITH_PYTHON
Nobuaki Sukegawa2c64bdd2016-09-04 15:33:40 +090098crossfeature: precross
James E. King III714c77c2018-03-20 19:58:38 -040099 $(CROSS_PY) test/test.py --retry-count 5 --features .* --skip-known-failures --server $(CROSS_LANGS_COMMA_SEPARATED)
Nobuaki Sukegawabd165302016-01-19 11:10:07 +0900100else
101# feature test needs python build
Nobuaki Sukegawa2c64bdd2016-09-04 15:33:40 +0900102crossfeature:
Nobuaki Sukegawabd165302016-01-19 11:10:07 +0900103endif
Roger Meierbb23ead2015-04-11 13:12:35 +0200104
Nobuaki Sukegawa2c64bdd2016-09-04 15:33:40 +0900105cross-%: precross crossfeature
James E. King III714c77c2018-03-20 19:58:38 -0400106 $(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 +0900107
108cross: cross-.*
109
Nobuaki Sukegawa147a5a22015-04-11 23:01:40 +0900110TIMES = 1 2 3
Roger Meierbb23ead2015-04-11 13:12:35 +0200111fail: precross
Nobuaki Sukegawaffc2bb32016-01-12 19:20:05 +0900112 $(CROSS_PY) test/test.py || true
113 $(CROSS_PY) test/test.py --update-expected-failures=overwrite
Nobuaki Sukegawa147a5a22015-04-11 23:01:40 +0900114 $(foreach var,$(TIMES),test/test.py -s || true;test/test.py --update-expected-failures=merge;)
Roger Meier41ad4342015-03-24 22:30:40 +0100115
Konrad Grochowski05fb8422014-11-24 11:16:54 +0100116codespell_skip_files = \
Konrad Grochowski40b2b642014-12-09 15:26:39 +0100117 *.jar \
118 *.class \
119 *.so \
Konrad Grochowski05fb8422014-11-24 11:16:54 +0100120 *.a \
121 *.la \
122 *.o \
123 *.p12 \
124 *OCamlMakefile \
125 .keystore \
126 .truststore \
127 CHANGES \
128 config.sub \
129 configure \
130 depcomp \
131 libtool.m4 \
132 output.* \
133 rebar \
134 thrift
135
Konrad Grochowski05fb8422014-11-24 11:16:54 +0100136skipped_files = $(subst $(space),$(comma),$(codespell_skip_files))
137
138style-local:
139 codespell --write-changes --skip=$(skipped_files) --disable-colors
140
Jake Farrelle0c53162011-11-16 12:58:36 +0000141EXTRA_DIST = \
jfarrellf13e4312015-08-25 00:39:29 -0400142 .clang-format \
James E. King IIIb96c4382019-01-24 17:45:07 -0500143 .dockerignore \
jfarrellf13e4312015-08-25 00:39:29 -0400144 .editorconfig \
Jens Geyer79f988c2014-10-03 20:42:54 +0200145 .travis.yml \
Jens Geyerf3a29742017-11-30 22:30:03 +0100146 .rustfmt.toml \
James E. King IIIb96c4382019-01-24 17:45:07 -0500147 ApacheThrift.nuspec \
jfarrellf13e4312015-08-25 00:39:29 -0400148 appveyor.yml \
James E. King IIIb96c4382019-01-24 17:45:07 -0500149 bootstrap.sh \
Jens Geyer79f988c2014-10-03 20:42:54 +0200150 bower.json \
jfarrellf13e4312015-08-25 00:39:29 -0400151 build \
James E. King IIIb96c4382019-01-24 17:45:07 -0500152 CHANGES.md \
jfarrellf13e4312015-08-25 00:39:29 -0400153 CMakeLists.txt \
Jens Geyer79f988c2014-10-03 20:42:54 +0200154 composer.json \
155 contrib \
Roger Meiera199a162015-04-30 18:19:06 +0200156 CONTRIBUTING.md \
Jens Geyer79f988c2014-10-03 20:42:54 +0200157 debian \
Jens Geyer79f988c2014-10-03 20:42:54 +0200158 doap.rdf \
James E. King IIIb96c4382019-01-24 17:45:07 -0500159 doc \
160 dub.json \
161 jitpack.yml \
James E. King, III0ad20bd2017-09-30 15:44:16 -0700162 LANGUAGES.md \
Jens Geyer79f988c2014-10-03 20:42:54 +0200163 LICENSE \
Jens Geyer79f988c2014-10-03 20:42:54 +0200164 NOTICE \
James E. King IIIb96c4382019-01-24 17:45:07 -0500165 package.json \
166 phpcs.xml.dist \
Nobuaki Sukegawa73d16372016-03-19 23:32:11 +0900167 README.md \
James E. King IIIb96c4382019-01-24 17:45:07 -0500168 sonar-project.properties \
Nobuaki Sukegawa73d16372016-03-19 23:32:11 +0900169 Thrift.podspec