1 # Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; version 2 of the License.
7 # This program is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 # GNU General Public License for more details.
12 # You should have received a copy of the GNU General Public License
13 # along with this program; if not, write to the Free Software
14 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
16 # Process this file with automake to create Makefile.in
18 AUTOMAKE_OPTIONS = foreign
20 # These are built from source in the Docs directory
21 EXTRA_DIST = INSTALL-SOURCE INSTALL-WIN-SOURCE \
22 README COPYING CMakeLists.txt
24 SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
25 @readline_topdir@ sql-common scripts \
26 @sql_union_dirs@ unittest \
27 @sql_server@ @man_dirs@ tests \
28 netware @libmysqld_dirs@ \
29 mysql-test support-files sql-bench @tools_dirs@ \
32 DIST_SUBDIRS = . include Docs zlib \
33 cmd-line-utils sql-common scripts \
34 strings mysys dbug extra regex libmysql libmysql_r client unittest storage plugin \
37 mysql-test support-files sql-bench server-tools \
40 DISTCLEANFILES = ac_available_languages_fragment
42 # Create permission databases
44 $(top_builddir)/scripts/mysql_install_db
47 $(top_builddir)/scripts/make_binary_distribution @MAKE_BINARY_DISTRIBUTION_OPTIONS@
49 # Remove BK's "SCCS" subdirectories from source distribution
50 # Create initial database files for Windows installations and check them.
52 rm -rf `find $(distdir) -type d -name SCCS -print`
53 mkdir -p $(distdir)/win
54 scripts/mysql_install_db --no-defaults --cross-bootstrap \
55 --builddir=$(top_builddir) \
56 --datadir=$(distdir)/win/data \
57 --srcdir=$(top_srcdir)
58 storage/myisam/myisamchk --silent --fast $(distdir)/win/data/mysql/*.MYI
60 all-local: @ABI_CHECK@
63 support-files/build-tags
65 .PHONY: init-db bin-dist \
66 test test-force test-full test-force-full test-force-mem \
67 test-pl test-force-pl test-full-pl test-force-full-pl test-force-pl-mem \
68 test-unit test-ps test-nr test-pr test-ns test-binlog-statement \
69 test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp \
70 test-ext-stress test-ext test-embedded test-reprepare \
71 test-fast test-fast-cursor test-fast-view test-fast-prepare \
74 # Target 'test' will run the regression test suite using the built server.
76 # If you are running in a shared environment, users can avoid clashing
77 # port numbers by setting individual small numbers 1-100 to the
78 # environment variable MTR_BUILD_THREAD. The script "mysql-test-run"
79 # will then calculate the various port numbers it needs from this,
80 # making sure each user use different ports.
83 cd unittest && $(MAKE) test
87 @PERL@ ./mysql-test-run.pl $(force) --ps-protocol --mysqld=--binlog-format=mixed
91 @PERL@ ./mysql-test-run.pl $(force) --mysqld=--binlog-format=row
95 @PERL@ ./mysql-test-run.pl $(force) $(mem) --ps-protocol --mysqld=--binlog-format=row
99 @PERL@ ./mysql-test-run.pl $(force) $(mem) --mysqld=--binlog-format=mixed
101 test-binlog-statement:
103 @PERL@ ./mysql-test-run.pl $(force) --mysqld=--binlog-format=statement
105 # This code is duplicated in "test-bt", see the Changeset comment of 2007-Dec-07
107 if [ -e bin/mysqltest_embedded -o -e libmysqld/examples/mysqltest_embedded ] ; then \
108 cd mysql-test ; MTR_BUILD_THREAD=auto \
109 @PERL@ ./mysql-test-run.pl --comment=embedded --force --timer \
110 --embedded-server --skip-rpl --skip-ndbcluster ; \
112 echo "no program found for 'embedded' tests - skipped testing" ; \
117 @PERL@ ./mysql-test-run.pl $(force) $(mem) --ps-protocol \
118 --mysqld=--debug=+d,reprepare_each_statement
120 test: test-unit test-ns test-pr
124 @PERL@ ./mysql-test-run.pl --do-test=s
126 test-full: test test-nr test-ps
129 $(MAKE) force=--force test
132 $(MAKE) force=--force test-full
134 #used by autopush.pl to run memory based tests
136 $(MAKE) force=--force mem=--mem test
139 -cd mysql-test ; MTR_BUILD_THREAD=auto \
140 @PERL@ ./mysql-test-run.pl --comment=normal --force --timer \
141 --skip-ndbcluster --report-features
142 -cd mysql-test ; MTR_BUILD_THREAD=auto \
143 @PERL@ ./mysql-test-run.pl --comment=ps --force --timer \
144 --skip-ndbcluster --ps-protocol
145 -if [ -e bin/ndbd -o -e storage/ndb/src/kernel/ndbd ] ; then \
147 MTR_BUILD_THREAD=auto \
148 @PERL@ ./mysql-test-run.pl --comment=ndb+ps --force --timer \
149 --ps-protocol --mysqld=--binlog-format=row --suite=ndb ; \
150 MTR_BUILD_THREAD=auto \
151 @PERL@ ./mysql-test-run.pl --comment=ndb --force --timer \
152 --with-ndbcluster-only ; \
154 echo "no program found for 'ndbcluster' tests - skipped testing" ; \
156 -cd mysql-test ; MTR_BUILD_THREAD=auto \
157 @PERL@ ./mysql-test-run.pl --force --comment=funcs1+ps --ps-protocol --reorder --suite=funcs_1
158 -cd mysql-test ; MTR_BUILD_THREAD=auto \
159 @PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2
160 -cd mysql-test ; MTR_BUILD_THREAD=auto \
161 @PERL@ ./mysql-test-run.pl --force --comment=partitions --suite=parts
162 -cd mysql-test ; MTR_BUILD_THREAD=auto \
163 @PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress
164 -cd mysql-test ; MTR_BUILD_THREAD=auto \
165 @PERL@ ./mysql-test-run.pl --force --comment=jp --suite=jp
166 -if [ -d mysql-test/suite/nist ] ; then \
167 cd mysql-test ; MTR_BUILD_THREAD=auto \
168 @PERL@ ./mysql-test-run.pl --comment=nist --force --suite=nist ; \
170 -if [ -d mysql-test/suite/nist ] ; then \
171 cd mysql-test ; MTR_BUILD_THREAD=auto \
172 @PERL@ ./mysql-test-run.pl --comment=nist+ps --force --suite=nist --ps-protocol ; \
174 -if [ -e bin/mysqltest_embedded -o -e libmysqld/examples/mysqltest_embedded ] ; then \
175 cd mysql-test ; MTR_BUILD_THREAD=auto \
176 @PERL@ ./mysql-test-run.pl --comment=embedded --force --timer \
177 --embedded-server --skip-rpl --skip-ndbcluster ; \
179 echo "no program found for 'embedded' tests - skipped testing" ; \
183 -cd mysql-test ; MTR_BUILD_THREAD=auto \
184 @PERL@ ./mysql-test-run.pl --comment=ps --force --timer \
185 --skip-ndbcluster --ps-protocol --report-features
186 -if [ -e bin/ndbd -o -e storage/ndb/src/kernel/ndbd ] ; then \
188 MTR_BUILD_THREAD=auto \
189 @PERL@ ./mysql-test-run.pl --comment=ndb --force --timer \
190 --with-ndbcluster-only ; \
192 echo "no program found for 'ndbcluster' tests - skipped testing" ; \
194 -cd mysql-test ; MTR_BUILD_THREAD=auto \
195 @PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress
198 -cd mysql-test ; MTR_BUILD_THREAD=auto \
199 @PERL@ ./mysql-test-run.pl --comment=debug --force --timer \
200 --skip-ndbcluster --skip-rpl --report-features
206 # Keep these for a while
208 test-full-pl: test-full
209 test-force-pl: test-force
210 test-force-pl-mem: test-force-mem
211 test-force-full-pl: test-force-full
215 @PERL@ ./mysql-test-run.pl --force --reorder --suite=funcs_1 ; \
216 @PERL@ ./mysql-test-run.pl --force --suite=funcs_2
220 @PERL@ ./mysql-test-run.pl --force --suite=rpl
224 @PERL@ ./mysql-test-run.pl --force --suite=parts
228 @PERL@ ./mysql-test-run.pl --force --suite=jp
232 @PERL@ ./mysql-test-run.pl --force --big-test --suite=stress
234 test-ext: test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp test-ext-stress
238 @PERL@ ./mysql-test-run.pl $(subset) --force --skip-ndb --skip-innodb --skip-im --skip-rpl ; \
239 @PERL@ ./mysql-test-run.pl $(subset) --force --suite=funcs_1 --do-test=myisam ; \
240 @PERL@ ./mysql-test-run.pl $(subset) --force --suite=stress --do-test=ddl_myisam
243 $(MAKE) subset=--view-protocol test-fast
246 $(MAKE) subset=--cursor-protocol test-fast
249 $(MAKE) subset=--ps-protocol test-fast
252 $(MAKE) force=--force test-pr \
253 test-binlog-statement test-ext test-fast-view \
254 test-fast-cursor test-unit
257 # Headers which need to be checked for abi/api compatibility.
258 # API_PREPROCESSOR_HEADER will be used until mysql_priv.h stablizes
259 # after which TEST_PREPROCESSOR_HEADER will be used.
262 API_PREPROCESSOR_HEADER = $(top_srcdir)/include/mysql/plugin.h \
263 $(top_srcdir)/include/mysql.h
265 TEST_PREPROCESSOR_HEADER = $(top_srcdir)/include/mysql/plugin.h \
266 $(top_srcdir)/sql/mysql_priv.h \
267 $(top_srcdir)/include/mysql.h
270 # Rules for checking that the abi/api has not changed.
272 # The following steps are followed in the do_abi_check rule below
274 # 1) Generate preprocessor output for the files that need to
275 # be tested for abi/api changes. use -nostdinc to prevent
276 # generation of preprocessor output for system headers. This
277 # results in messages in stderr saying that these headers
278 # were not found. Redirect the stderr output to /dev/null
279 # to prevent seeing these messages.
280 # 2) sed the output to
281 # 2.1) remove blank lines and lines that begin with "# "
282 # 2.2) When gcc -E is run on the Mac OS and solaris sparc platforms it
283 # introduces a line of output that shows up as a difference between
284 # the .pp and .out files. Remove these OS specific preprocessor text
285 # inserted by the preprocessor.
286 # 3) diff the generated file and the canons (.pp files already in
288 # 4) delete the .out file that is generated.
290 # If the diff fails, the generated file is not removed. This will
291 # be useful for analysis of ABI differences (e.g. using a visual
294 # A ABI change that causes a build to fail will always be accompanied
295 # by new canons (.out files). The .out files that are not removed will
296 # be replaced as the new .pp files.
298 # e.g. If include/mysql/plugin.h has an ABI change then this rule would
299 # leave a <build directory>/abi_check.out file.
301 # A developer with a justified API change will then do a
302 # mv <build directory>/abi_check.out include/mysql/plugin.pp
303 # to replace the old canons with the new ones.
306 abi_check: $(API_PREPROCESSOR_HEADER)
307 $(MAKE) abi_headers="$^" do_abi_check
309 abi_check_all: $(TEST_PREPROCESSOR_HEADER)
310 $(MAKE) abi_headers="$^" do_abi_check
314 for file in $(abi_headers); do \
315 @CC@ -E -nostdinc -dI -DMYSQL_ABI_CHECK \
316 -I$(top_srcdir)/include \
317 -I$(top_srcdir)/include/mysql \
318 -I$(top_srcdir)/sql \
319 -I$(top_builddir)/include \
320 -I$(top_builddir)/include/mysql \
321 -I$(top_builddir)/sql \
322 $$file 2>/dev/null | \
325 -e '/^#pragma GCC set_debug_pwd/d' \
327 $(top_builddir)/abi_check.out; \
328 @DIFF@ -w $$file.pp $(top_builddir)/abi_check.out; \
329 @RM@ $(top_builddir)/abi_check.out; \
332 # Don't update the files from bitkeeper