Makefile.am 11.8 KB
Newer Older
1
# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
bk@work.mysql.com's avatar
bk@work.mysql.com committed
2 3 4
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; version 2 of the License.
bk@work.mysql.com's avatar
bk@work.mysql.com committed
6 7 8 9 10 11 12 13 14 15 16 17 18
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

# Process this file with automake to create Makefile.in

AUTOMAKE_OPTIONS =	foreign
19

bk@work.mysql.com's avatar
bk@work.mysql.com committed
20
# These are built from source in the Docs directory
kent@mysql.com's avatar
kent@mysql.com committed
21
EXTRA_DIST =		INSTALL-SOURCE INSTALL-WIN-SOURCE \
22
			README COPYING CMakeLists.txt
23

24
SUBDIRS =		. include @docs_dirs@ @zlib_dir@ \
25
			@readline_topdir@ sql-common scripts \
Joerg Bruehe's avatar
Joerg Bruehe committed
26
			@sql_union_dirs@ unittest \
27
			@sql_server@ @man_dirs@ tests \
28
			netware @libmysqld_dirs@ \
29
			mysql-test support-files sql-bench @tools_dirs@ \
30
			win
31

32 33 34 35 36 37 38
DIST_SUBDIRS =		. include Docs zlib \
			cmd-line-utils sql-common scripts \
			strings mysys dbug extra regex libmysql libmysql_r client unittest storage plugin \
			vio sql man tests \
			netware libmysqld \
			mysql-test support-files sql-bench server-tools \
			win \
39
			BUILD
kent@mysql.com's avatar
kent@mysql.com committed
40
DISTCLEANFILES = ac_available_languages_fragment
monty@donna.mysql.com's avatar
monty@donna.mysql.com committed
41

bk@work.mysql.com's avatar
bk@work.mysql.com committed
42 43 44 45 46
# Create permission databases
init-db:		all
	$(top_builddir)/scripts/mysql_install_db

bin-dist:		all
47
	$(top_builddir)/scripts/make_binary_distribution @MAKE_BINARY_DISTRIBUTION_OPTIONS@
bk@work.mysql.com's avatar
bk@work.mysql.com committed
48

49
# Remove BK's "SCCS" subdirectories from source distribution
50
# Create initial database files for Windows installations and check them.
51
dist-hook:
kent@mysql.com's avatar
kent@mysql.com committed
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 57
		--datadir=$(distdir)/win/data \
		--srcdir=$(top_srcdir)
58
	storage/myisam/myisamchk --silent --fast $(distdir)/win/data/mysql/*.MYI
59

Narayanan V's avatar
Narayanan V committed
60
all-local:		@ABI_CHECK@	
Narayanan V's avatar
Narayanan V committed
61

62
tags:
63
	support-files/build-tags
64

tsmith/tim@siva.hindu.god's avatar
tsmith/tim@siva.hindu.god committed
65 66 67
.PHONY:	init-db bin-dist \
  test    test-force    test-full    test-force-full    test-force-mem \
  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 72
  test-fast test-fast-cursor test-fast-view test-fast-prepare \
  test-full-qa
monty@donna.mysql.com's avatar
monty@donna.mysql.com committed
73

kent@mysql.com's avatar
kent@mysql.com committed
74 75 76 77 78 79 80
# Target 'test' will run the regression test suite using the built server.
#
# If you are running in a shared environment, users can avoid clashing
# port numbers by setting individual small numbers 1-100 to the
# environment variable MTR_BUILD_THREAD. The script "mysql-test-run"
# will then calculate the various port numbers it needs from this,
# making sure each user use different ports.
kent@mysql.com's avatar
kent@mysql.com committed
81

82 83 84 85
test-unit:
	cd unittest && $(MAKE) test

test-ps:
86
	cd mysql-test ; \
87
	    @PERL@ ./mysql-test-run.pl $(force) --ps-protocol --mysqld=--binlog-format=mixed
88

89
test-nr:
90
	cd mysql-test ; \
91
	    @PERL@ ./mysql-test-run.pl $(force) --mysqld=--binlog-format=row
kent@mysql.com's avatar
kent@mysql.com committed
92

93
test-pr:
94
	cd mysql-test ; \
95
	    @PERL@ ./mysql-test-run.pl $(force) $(mem) --ps-protocol --mysqld=--binlog-format=row
96

97
test-ns:
98
	cd mysql-test ; \
99
	    @PERL@ ./mysql-test-run.pl $(force) $(mem) --mysqld=--binlog-format=mixed
100 101

test-binlog-statement:
102
	cd mysql-test ; \
103
	    @PERL@ ./mysql-test-run.pl $(force) --mysqld=--binlog-format=statement
104

joerg@trift2's avatar
joerg@trift2 committed
105
# This code is duplicated in "test-bt", see the Changeset comment of 2007-Dec-07
joerg@trift2's avatar
joerg@trift2 committed
106 107 108
test-embedded:
	if [ -e bin/mysqltest_embedded -o -e libmysqld/examples/mysqltest_embedded ] ; then \
	  cd mysql-test ; MTR_BUILD_THREAD=auto \
109 110
	      @PERL@ ./mysql-test-run.pl --comment=embedded --force --timer \
	          --embedded-server --skip-rpl --skip-ndbcluster ; \
joerg@trift2's avatar
joerg@trift2 committed
111 112 113 114
	else \
	  echo "no program found for 'embedded' tests - skipped testing" ; \
	fi

115 116 117 118 119
test-reprepare:
	cd mysql-test ; \
	    @PERL@ ./mysql-test-run.pl $(force) $(mem) --ps-protocol \
		--mysqld=--debug=+d,reprepare_each_statement

120 121
test:	test-unit test-ns test-pr

Magnus Svensson's avatar
Magnus Svensson committed
122 123 124 125
smoke:
	cd mysql-test ; \
	    @PERL@ ./mysql-test-run.pl --do-test=s

126 127 128 129 130 131 132
test-full:	test test-nr test-ps

test-force:
	$(MAKE) force=--force test

test-force-full:
	$(MAKE) force=--force test-full
monty@mysql.com's avatar
monty@mysql.com committed
133

134 135
#used by autopush.pl to run memory based tests
test-force-mem:
136
	$(MAKE) force=--force mem=--mem test
137

138 139
test-bt:
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
140 141
	    @PERL@ ./mysql-test-run.pl --comment=normal --force --timer \
	        --skip-ndbcluster --report-features
142
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
143 144
	    @PERL@ ./mysql-test-run.pl  --comment=ps    --force --timer \
	        --skip-ndbcluster --ps-protocol
145 146 147
	-if [ -e bin/ndbd -o -e storage/ndb/src/kernel/ndbd ] ; then \
	  cd mysql-test ; \
	    MTR_BUILD_THREAD=auto \
148 149
	      @PERL@ ./mysql-test-run.pl --comment=ndb+ps --force --timer \
	          --ps-protocol --mysqld=--binlog-format=row --suite=ndb ; \
150
	    MTR_BUILD_THREAD=auto \
151
	      @PERL@ ./mysql-test-run.pl --comment=ndb --force --timer \
152 153 154 155
	          --with-ndbcluster-only ; \
	else \
	  echo "no program found for 'ndbcluster' tests - skipped testing" ; \
	fi
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 163
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
	    @PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress
kent.boortz@sun.com's avatar
kent.boortz@sun.com committed
164 165
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
	    @PERL@ ./mysql-test-run.pl --force --comment=jp --suite=jp
166 167
	-if [ -d mysql-test/suite/nist ] ; then \
	  cd mysql-test ; MTR_BUILD_THREAD=auto \
168
	      @PERL@ ./mysql-test-run.pl --comment=nist --force --suite=nist ; \
169 170 171
	fi
	-if [ -d mysql-test/suite/nist ] ; then \
	  cd mysql-test ; MTR_BUILD_THREAD=auto \
172 173 174 175 176 177 178 179
	      @PERL@ ./mysql-test-run.pl --comment=nist+ps --force --suite=nist --ps-protocol ; \
	fi
	-if [ -e bin/mysqltest_embedded -o -e libmysqld/examples/mysqltest_embedded ] ; then \
	  cd mysql-test ; MTR_BUILD_THREAD=auto \
	      @PERL@ ./mysql-test-run.pl --comment=embedded --force --timer \
	          --embedded-server --skip-rpl --skip-ndbcluster ; \
	else \
	  echo "no program found for 'embedded' tests - skipped testing" ; \
180
	fi
181

kent.boortz@sun.com's avatar
kent.boortz@sun.com committed
182 183 184
test-bt-fast:
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
	    @PERL@ ./mysql-test-run.pl  --comment=ps    --force --timer \
Build Team's avatar
Build Team committed
185
	        --skip-ndbcluster --ps-protocol --report-features
kent.boortz@sun.com's avatar
kent.boortz@sun.com committed
186 187 188 189 190 191 192 193 194 195
	-if [ -e bin/ndbd -o -e storage/ndb/src/kernel/ndbd ] ; then \
	  cd mysql-test ; \
	    MTR_BUILD_THREAD=auto \
	      @PERL@ ./mysql-test-run.pl --comment=ndb --force --timer \
	          --with-ndbcluster-only ; \
	else \
	  echo "no program found for 'ndbcluster' tests - skipped testing" ; \
	fi
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
	    @PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress
196

197 198
test-bt-debug:
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
199 200
	    @PERL@ ./mysql-test-run.pl --comment=debug  --force --timer \
	        --skip-ndbcluster --skip-rpl --report-features
201

kent.boortz@sun.com's avatar
kent.boortz@sun.com committed
202 203
test-bt-debug-fast:

204 205
test-bt-debug-fast:

206 207 208 209
# Keep these for a while
test-pl:	test
test-full-pl:	test-full
test-force-pl:	test-force
210
test-force-pl-mem:  test-force-mem
211 212
test-force-full-pl: test-force-full

213 214
test-ext-funcs:
	cd mysql-test ; \
215
	    @PERL@ ./mysql-test-run.pl --force --reorder --suite=funcs_1 ; \
216
	    @PERL@ ./mysql-test-run.pl --force --suite=funcs_2
217 218 219

test-ext-rpl:
	cd mysql-test ; \
220
	    @PERL@ ./mysql-test-run.pl --force --suite=rpl
221 222 223

test-ext-partitions:
	cd mysql-test ; \
224
	    @PERL@ ./mysql-test-run.pl --force --suite=parts
225 226 227

test-ext-jp:
	cd mysql-test ; \
228
	    @PERL@ ./mysql-test-run.pl --force --suite=jp
229

230 231
test-ext-stress:
	cd mysql-test ; \
232
	    @PERL@ ./mysql-test-run.pl --force --big-test --suite=stress
233 234

test-ext:	test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp test-ext-stress
235 236 237

test-fast:
	cd mysql-test ; \
238 239 240
	    @PERL@ ./mysql-test-run.pl $(subset) --force --skip-ndb --skip-innodb --skip-im --skip-rpl ; \
	    @PERL@ ./mysql-test-run.pl $(subset) --force --suite=funcs_1 --do-test=myisam ; \
	    @PERL@ ./mysql-test-run.pl $(subset) --force --suite=stress --do-test=ddl_myisam 
241 242 243 244 245 246 247 248 249 250 251 252

test-fast-view:
	$(MAKE) subset=--view-protocol test-fast

test-fast-cursor:
	$(MAKE) subset=--cursor-protocol test-fast

test-fast-prepare:
	$(MAKE) subset=--ps-protocol test-fast

test-full-qa:
	$(MAKE) force=--force test-pr \
253 254
	    test-binlog-statement test-ext test-fast-view \
	        test-fast-cursor test-unit
255

Narayanan V's avatar
Narayanan V committed
256
#
Narayanan V's avatar
Narayanan V committed
257 258 259
# Headers which need to be checked for abi/api compatibility.
# API_PREPROCESSOR_HEADER will be used until mysql_priv.h stablizes
# after which TEST_PREPROCESSOR_HEADER will be used.
Narayanan V's avatar
Narayanan V committed
260 261
#

Narayanan V's avatar
Narayanan V committed
262 263 264 265 266 267
API_PREPROCESSOR_HEADER = $(top_srcdir)/include/mysql/plugin.h \
                           $(top_srcdir)/include/mysql.h

TEST_PREPROCESSOR_HEADER = $(top_srcdir)/include/mysql/plugin.h \
                            $(top_srcdir)/sql/mysql_priv.h \
                            $(top_srcdir)/include/mysql.h
Narayanan V's avatar
Narayanan V committed
268 269

#
Narayanan V's avatar
Narayanan V committed
270
# Rules for checking that the abi/api has not changed.
Narayanan V's avatar
Narayanan V committed
271
#
Narayanan V's avatar
Narayanan V committed
272
# The following steps are followed in the do_abi_check rule below
Narayanan V's avatar
Narayanan V committed
273 274
#
# 1) Generate preprocessor output for the files that need to
Narayanan V's avatar
Narayanan V committed
275 276 277 278
#    be tested for abi/api changes. use -nostdinc to prevent
#    generation of preprocessor output for system headers. This
#    results in messages in stderr saying that these headers
#    were not found. Redirect the stderr output to /dev/null
Narayanan V's avatar
Narayanan V committed
279
#    to prevent seeing these messages.
Narayanan V's avatar
Narayanan V committed
280 281
# 2) sed the output to 
#    2.1) remove blank lines and lines that begin with "# "
Narayanan V's avatar
Narayanan V committed
282 283 284 285
#    2.2) When gcc -E is run on the Mac OS  and solaris sparc platforms it
#         introduces a line of output that shows up as a difference between
#         the .pp and .out files. Remove these OS specific preprocessor text
#         inserted by the preprocessor.
Narayanan V's avatar
Narayanan V committed
286 287 288 289 290 291 292 293 294 295 296 297 298
# 3) diff the generated file and the canons (.pp files already in
#    the repository).
# 4) delete the .out file that is generated.
#
# If the diff fails, the generated file is not removed. This will
# be useful for analysis of ABI differences (e.g. using a visual
# diff tool).
#
# A ABI change that causes a build to fail will always be accompanied
# by new canons (.out files). The .out files that are not removed will
# be replaced as the new .pp files.
#
# e.g. If include/mysql/plugin.h has an ABI change then this rule would
Narayanan V's avatar
Narayanan V committed
299
# leave a <build directory>/abi_check.out file.
Narayanan V's avatar
Narayanan V committed
300 301
#
# A developer with a justified API change will then do a
Narayanan V's avatar
Narayanan V committed
302
# mv <build directory>/abi_check.out include/mysql/plugin.pp 
Narayanan V's avatar
Narayanan V committed
303 304 305
# to replace the old canons with the new ones.
#

Narayanan V's avatar
Narayanan V committed
306 307 308 309 310 311 312 313 314
abi_check:	$(API_PREPROCESSOR_HEADER)
	$(MAKE) abi_headers="$^" do_abi_check

abi_check_all:	$(TEST_PREPROCESSOR_HEADER)
	$(MAKE) abi_headers="$^" do_abi_check

do_abi_check:
	set -ex; \
	for file in $(abi_headers); do \
315
	         @CC@ -E -nostdinc -dI -DMYSQL_ABI_CHECK \
Narayanan V's avatar
Narayanan V committed
316 317 318
	                  -I$(top_srcdir)/include \
	                  -I$(top_srcdir)/include/mysql \
	                  -I$(top_srcdir)/sql \
Narayanan V's avatar
Narayanan V committed
319 320 321
	                  -I$(top_builddir)/include \
	                  -I$(top_builddir)/include/mysql \
	                  -I$(top_builddir)/sql \
Narayanan V's avatar
Narayanan V committed
322 323
	                                 $$file 2>/dev/null | \
	                  @SED@ -e '/^# /d' \
Narayanan V's avatar
Narayanan V committed
324
	                            -e '/^[ 	]*$$/d' \
Narayanan V's avatar
Narayanan V committed
325 326
	                            -e '/^#pragma GCC set_debug_pwd/d' \
	                            -e '/^#ident/d' > \
Narayanan V's avatar
Narayanan V committed
327
	                                       $(top_builddir)/abi_check.out; \
Narayanan V's avatar
Narayanan V committed
328
	                  @DIFF@ -w $$file.pp $(top_builddir)/abi_check.out; \
Narayanan V's avatar
Narayanan V committed
329
	                  @RM@ $(top_builddir)/abi_check.out; \
Narayanan V's avatar
Narayanan V committed
330
	done
Narayanan V's avatar
Narayanan V committed
331

332 333
# Don't update the files from bitkeeper
%::SCCS/s.%