Makefile.am 11.8 KB
Newer Older
1
# Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
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 EXCEPTIONS-CLIENT CMakeLists.txt
23

24
SUBDIRS =		. include @docs_dirs@ @zlib_dir@ \
25
			@readline_topdir@ sql-common scripts \
26
			@pstack_dir@ \
27 28
			@sql_union_dirs@ unittest storage plugin \
			@sql_server@ @man_dirs@ tests \
29
			netware @libmysqld_dirs@ \
30
			mysql-test support-files sql-bench @tools_dirs@ \
31
			win
32

33 34 35 36 37 38 39 40
DIST_SUBDIRS =		. include Docs zlib \
			cmd-line-utils sql-common scripts \
			pstack \
			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 \
41
			BUILD
kent@mysql.com's avatar
kent@mysql.com committed
42
DISTCLEANFILES = ac_available_languages_fragment
monty@donna.mysql.com's avatar
monty@donna.mysql.com committed
43

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

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

51
# Remove BK's "SCCS" subdirectories from source distribution
52
# Create initial database files for Windows installations and check them.
53
dist-hook:
kent@mysql.com's avatar
kent@mysql.com committed
54
	rm -rf `find $(distdir) -type d -name SCCS -print`
55
	mkdir -p $(distdir)/win
56
	scripts/mysql_install_db --no-defaults --cross-bootstrap \
57
		--builddir=$(top_builddir) \
58 59
		--datadir=$(distdir)/win/data \
		--srcdir=$(top_srcdir)
60
	storage/myisam/myisamchk --silent --fast $(distdir)/win/data/mysql/*.MYI
61

Narayanan V's avatar
Narayanan V committed
62
all-local:		@ABI_CHECK@	
Narayanan V's avatar
Narayanan V committed
63

64
tags:
65
	support-files/build-tags
66

tsmith/tim@siva.hindu.god's avatar
tsmith/tim@siva.hindu.god committed
67 68 69
.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 \
70
  test-unit test-ps test-nr test-pr test-ns test-binlog-statement \
71
  test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp \
72
  test-ext-stress test-ext test-embedded test-reprepare \
73 74
  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
75

kent@mysql.com's avatar
kent@mysql.com committed
76 77 78 79 80 81 82
# 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
83

84 85 86 87
test-unit:
	cd unittest && $(MAKE) test

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

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

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

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

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

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

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

122 123
test:	test-unit test-ns test-pr

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

128 129 130 131 132 133 134
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
135

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

140 141
test-bt:
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
142 143
	    @PERL@ ./mysql-test-run.pl --comment=normal --force --timer \
	        --skip-ndbcluster --report-features
144
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
145 146
	    @PERL@ ./mysql-test-run.pl  --comment=ps    --force --timer \
	        --skip-ndbcluster --ps-protocol
147 148 149
	-if [ -e bin/ndbd -o -e storage/ndb/src/kernel/ndbd ] ; then \
	  cd mysql-test ; \
	    MTR_BUILD_THREAD=auto \
150 151
	      @PERL@ ./mysql-test-run.pl --comment=ndb+rpl_ndb+ps --force --timer \
	          --ps-protocol --mysqld=--binlog-format=row --suite=ndb,rpl_ndb ; \
152
	    MTR_BUILD_THREAD=auto \
153
	      @PERL@ ./mysql-test-run.pl --comment=ndb --force --timer \
154 155 156 157
	          --with-ndbcluster-only ; \
	else \
	  echo "no program found for 'ndbcluster' tests - skipped testing" ; \
	fi
158
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
159
	    @PERL@ ./mysql-test-run.pl --force --comment=funcs1+ps --ps-protocol --reorder --suite=funcs_1
160
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
161
	    @PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2
162
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
163
	    @PERL@ ./mysql-test-run.pl --force --comment=partitions --suite=parts
164 165
	-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
166 167
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
	    @PERL@ ./mysql-test-run.pl --force --comment=jp --suite=jp
168 169
	-if [ -d mysql-test/suite/nist ] ; then \
	  cd mysql-test ; MTR_BUILD_THREAD=auto \
170
	      @PERL@ ./mysql-test-run.pl --comment=nist --force --suite=nist ; \
171 172 173
	fi
	-if [ -d mysql-test/suite/nist ] ; then \
	  cd mysql-test ; MTR_BUILD_THREAD=auto \
174 175 176 177 178 179 180 181
	      @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" ; \
182
	fi
183

kent.boortz@sun.com's avatar
kent.boortz@sun.com committed
184 185 186
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
187
	        --skip-ndbcluster --ps-protocol --report-features
kent.boortz@sun.com's avatar
kent.boortz@sun.com committed
188 189 190 191 192 193 194 195 196 197
	-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
198

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

kent.boortz@sun.com's avatar
kent.boortz@sun.com committed
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 \
Narayanan V's avatar
Narayanan V committed
315
	         @CC@ -E -nostdinc -dI \
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.%