Makefile.am 10.5 KB
Newer Older
1
# Copyright (C) 2000-2006 MySQL AB
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.
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

Narayanan V's avatar
Narayanan V committed
61 62
all-local:		abi_check

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

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

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

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

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

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

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

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

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

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

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

121 122 123 124 125 126 127 128 129
test:	test-unit test-ns test-pr

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
130

131 132
#used by autopush.pl to run memory based tests
test-force-mem:
133
	$(MAKE) force=--force mem=--mem test
134

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

177 178
# Re-enable the "jp" suite when bug#28563 is fixed
#	-cd mysql-test ; MTR_BUILD_THREAD=auto \
179
#	    @PERL@ ./mysql-test-run.pl --force --comment=jp --suite=jp
180

181 182
test-bt-debug:
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
183 184
	    @PERL@ ./mysql-test-run.pl --comment=debug  --force --timer \
	        --skip-ndbcluster --skip-rpl --report-features
185

186 187 188 189
# Keep these for a while
test-pl:	test
test-full-pl:	test-full
test-force-pl:	test-force
190
test-force-pl-mem:  test-force-mem
191 192
test-force-full-pl: test-force-full

193 194
test-ext-funcs:
	cd mysql-test ; \
195
	    @PERL@ ./mysql-test-run.pl --force --reorder --suite=funcs_1 ; \
196
	    @PERL@ ./mysql-test-run.pl --force --suite=funcs_2
197 198 199

test-ext-rpl:
	cd mysql-test ; \
200
	    @PERL@ ./mysql-test-run.pl --force --suite=rpl
201 202 203

test-ext-partitions:
	cd mysql-test ; \
204
	    @PERL@ ./mysql-test-run.pl --force --suite=parts
205 206 207

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

210 211
test-ext-stress:
	cd mysql-test ; \
212
	    @PERL@ ./mysql-test-run.pl --force --big-test --suite=stress
213 214

test-ext:	test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp test-ext-stress
215 216 217

test-fast:
	cd mysql-test ; \
218 219 220
	    @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 
221 222 223 224 225 226 227 228 229 230 231 232

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 \
233 234
	    test-binlog-statement test-ext test-fast-view \
	        test-fast-cursor test-unit
235

Narayanan V's avatar
Narayanan V committed
236
#
Narayanan V's avatar
Narayanan V committed
237 238 239
# 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
240 241
#

Narayanan V's avatar
Narayanan V committed
242 243 244 245 246 247
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
248 249

#
Narayanan V's avatar
Narayanan V committed
250
# Rules for checking that the abi/api has not changed.
Narayanan V's avatar
Narayanan V committed
251
#
Narayanan V's avatar
Narayanan V committed
252
# The following steps are followed in the do_abi_check rule below
Narayanan V's avatar
Narayanan V committed
253 254
#
# 1) Generate preprocessor output for the files that need to
Narayanan V's avatar
Narayanan V committed
255 256 257 258
#    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
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282
#    to prevent seeing these messages.
# 2) sed the output to remove blank lines and lines that begin
#    with # (The header information is retained to enable easy
#    analysis of abi diffs at a later stage).
# 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
# leave a include/mysql/plugin.out file.
#
# A developer with a justified API change will then do a
# mv include/mysql/plugin.out include/mysql/plugin.pp 
# to replace the old canons with the new ones.
#

Narayanan V's avatar
Narayanan V committed
283 284 285 286 287 288 289 290 291
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
292 293 294 295 296 297 298 299 300
	         @CC@ -E -nostdinc -dI \
	                  -I$(top_srcdir)/include \
	                  -I$(top_srcdir)/include/mysql \
	                  -I$(top_srcdir)/sql \
	                                 $$file 2>/dev/null | \
	                  @SED@ -e '/^# /d' \
	                            -e '/^[ 	]*$$/d' > $$file.out; \
	                  @DIFF@ $$file.pp $$file.out; \
	                  @RM@ $$file.out; \
Narayanan V's avatar
Narayanan V committed
301
	done
Narayanan V's avatar
Narayanan V committed
302

303 304
# Don't update the files from bitkeeper
%::SCCS/s.%