Makefile.am 12.8 KB
Newer Older
1
# Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
unknown's avatar
unknown 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
unknown's avatar
unknown committed
5
# the Free Software Foundation; version 2 of the License.
unknown's avatar
unknown 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

unknown's avatar
unknown committed
20
# These are built from source in the Docs directory
unknown's avatar
unknown committed
21
EXTRA_DIST =		INSTALL-SOURCE INSTALL-WIN-SOURCE \
22 23 24
			README COPYING EXCEPTIONS-CLIENT \
			CMakeLists.txt \
			config/ac-macros/libevent_configure.m4
25

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

unknown's avatar
unknown committed
35 36 37 38 39 40 41 42
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 \
43
			BUILD
unknown's avatar
unknown committed
44
DISTCLEANFILES = ac_available_languages_fragment
unknown's avatar
unknown committed
45

unknown's avatar
unknown committed
46 47 48 49 50
# Create permission databases
init-db:		all
	$(top_builddir)/scripts/mysql_install_db

bin-dist:		all
51
	$(top_builddir)/scripts/make_binary_distribution @MAKE_BINARY_DISTRIBUTION_OPTIONS@
unknown's avatar
unknown committed
52

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

63 64 65 66 67
# Simple target to allow scripts etc. to get the name of the source
# tarball easily.
show-dist-name:
	@echo "$(PACKAGE)-$(VERSION)"

Narayanan V's avatar
Narayanan V committed
68
all-local:		@ABI_CHECK@	
69

unknown's avatar
unknown committed
70
tags:
71
	support-files/build-tags
72

unknown's avatar
unknown committed
73 74 75
.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 \
unknown's avatar
unknown committed
76
  test-unit test-unit-big test-ps test-nr test-pr test-ns test-binlog-statement \
77
  test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp \
78
  test-ext-stress test-ext test-embedded test-reprepare \
79 80
  test-fast test-fast-cursor test-fast-view test-fast-prepare \
  test-full-qa
unknown's avatar
unknown committed
81

unknown's avatar
unknown committed
82 83 84 85 86 87 88
# 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.
89 90 91
#
# Set MTR_EXTRA_OPTIONS to add custom options for mysql-test-run,
# like MTR_EXTRA_OPTIONS"--parallel=3 --mem".
unknown's avatar
unknown committed
92

93
test-unit:
unknown's avatar
unknown committed
94 95 96 97
	cd unittest; $(MAKE) test

test-unit-big:
	cd unittest; MYTAP_CONFIG=big $(MAKE) test
98 99

test-ps:
100
	cd mysql-test ; \
101
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(force) --ps-protocol --mysqld=--binlog-format=mixed
102

103
test-nr:
104
	cd mysql-test ; \
105
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(force) --mysqld=--binlog-format=row
unknown's avatar
unknown committed
106

107
test-pr:
108
	cd mysql-test ; \
109
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(force) $(mem) --ps-protocol --mysqld=--binlog-format=row #@libevent_test_option@
110

111
test-ns:
unknown's avatar
unknown committed
112
	cd mysql-test ; \
113
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(force) $(mem) --mysqld=--binlog-format=mixed
unknown's avatar
unknown committed
114 115

test-binlog-statement:
116
	cd mysql-test ; \
117
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(force) --mysqld=--binlog-format=statement
118

unknown's avatar
unknown committed
119
# This code is duplicated in "test-bt", see the Changeset comment of 2007-Dec-07
unknown's avatar
unknown committed
120 121 122
test-embedded:
	if [ -e bin/mysqltest_embedded -o -e libmysqld/examples/mysqltest_embedded ] ; then \
	  cd mysql-test ; MTR_BUILD_THREAD=auto \
123
	      @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=embedded --force --timer \
124
	          --embedded-server --skip-rpl --skip-ndbcluster ; \
unknown's avatar
unknown committed
125 126
	else \
	  echo "no program found for 'embedded' tests - skipped testing" ; \
Michael Widenius's avatar
Michael Widenius committed
127
		fi
unknown's avatar
unknown committed
128

129 130
test-reprepare:
	cd mysql-test ; \
131
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(force) $(mem) --ps-protocol \
132 133
		--mysqld=--debug=+d,reprepare_each_statement

Michael Widenius's avatar
Michael Widenius committed
134
test: test-ns test-pr
135

Magnus Svensson's avatar
Magnus Svensson committed
136 137
smoke:
	cd mysql-test ; \
138
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --do-test=s
Magnus Svensson's avatar
Magnus Svensson committed
139

140 141 142 143 144 145 146
test-full:	test test-nr test-ps

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

test-force-full:
	$(MAKE) force=--force test-full
unknown's avatar
unknown committed
147

148 149
#used by autopush.pl to run memory based tests
test-force-mem:
150
	$(MAKE) force=--force mem=--mem test
151

unknown's avatar
unknown committed
152 153
test-bt:
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
154
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=normal --force --timer \
155
	        --skip-ndbcluster --report-features
unknown's avatar
unknown committed
156
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
157
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS)  --comment=ps    --force --timer \
158
	        --skip-ndbcluster --ps-protocol
159 160
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=PBXT --mysqld=--default-storage-engine=pbxt --suite=pbxt
unknown's avatar
unknown committed
161 162 163
	-if [ -e bin/ndbd -o -e storage/ndb/src/kernel/ndbd ] ; then \
	  cd mysql-test ; \
	    MTR_BUILD_THREAD=auto \
164
	      @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=ndb+rpl_ndb+ps --force --timer \
unknown's avatar
unknown committed
165
	          --ps-protocol --mysqld=--binlog-format=row --suite=ndb,rpl_ndb ; \
unknown's avatar
unknown committed
166
	    MTR_BUILD_THREAD=auto \
167
	      @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=ndb --force --timer \
unknown's avatar
unknown committed
168
	          --with-ndbcluster-only ; \
unknown's avatar
unknown committed
169
	else \
unknown's avatar
unknown committed
170
	  echo "no program found for 'ndbcluster' tests - skipped testing" ; \
unknown's avatar
unknown committed
171
	fi
172
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
173
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=funcs1+ps --ps-protocol --reorder --suite=funcs_1
174
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
175
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=funcs2 --suite=funcs_2
unknown's avatar
unknown committed
176
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
177
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=stress --suite=stress
unknown's avatar
unknown committed
178
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
179
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=jp --suite=jp
180 181
	-if [ -d mysql-test/suite/nist ] ; then \
	  cd mysql-test ; MTR_BUILD_THREAD=auto \
182
	      @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=nist --force --suite=nist ; \
183 184 185
	fi
	-if [ -d mysql-test/suite/nist ] ; then \
	  cd mysql-test ; MTR_BUILD_THREAD=auto \
186
	      @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=nist+ps --force --suite=nist --ps-protocol ; \
unknown's avatar
unknown committed
187 188 189
	fi
	-if [ -e bin/mysqltest_embedded -o -e libmysqld/examples/mysqltest_embedded ] ; then \
	  cd mysql-test ; MTR_BUILD_THREAD=auto \
190
	      @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=embedded --force --timer \
unknown's avatar
unknown committed
191 192 193
	          --embedded-server --skip-rpl --skip-ndbcluster ; \
	else \
	  echo "no program found for 'embedded' tests - skipped testing" ; \
194
	fi
195

unknown's avatar
unknown committed
196 197
test-bt-fast:
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
198
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS)  --comment=ps    --force --timer \
Build Team's avatar
Build Team committed
199
	        --skip-ndbcluster --ps-protocol --report-features
unknown's avatar
unknown committed
200 201 202
	-if [ -e bin/ndbd -o -e storage/ndb/src/kernel/ndbd ] ; then \
	  cd mysql-test ; \
	    MTR_BUILD_THREAD=auto \
203
	      @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=ndb --force --timer \
unknown's avatar
unknown committed
204 205 206 207 208
	          --with-ndbcluster-only ; \
	else \
	  echo "no program found for 'ndbcluster' tests - skipped testing" ; \
	fi
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
209
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=stress --suite=stress
unknown's avatar
unknown committed
210

211 212
test-bt-debug:
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
213
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=debug  --force --timer \
214
	        --skip-ndbcluster --skip-rpl --report-features
215

unknown's avatar
unknown committed
216 217
test-bt-debug-fast:

218 219 220 221
# Keep these for a while
test-pl:	test
test-full-pl:	test-full
test-force-pl:	test-force
222
test-force-pl-mem:  test-force-mem
223 224
test-force-full-pl: test-force-full

225 226
test-ext-funcs:
	cd mysql-test ; \
227 228
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --reorder --suite=funcs_1 ; \
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --suite=funcs_2
229 230 231

test-ext-rpl:
	cd mysql-test ; \
232
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --suite=rpl
233 234 235

test-ext-partitions:
	cd mysql-test ; \
236
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --suite=parts
237 238 239

test-ext-jp:
	cd mysql-test ; \
240
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --suite=jp
241

242 243
test-ext-stress:
	cd mysql-test ; \
244
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --big-test --suite=stress
245 246

test-ext:	test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp test-ext-stress
247 248 249

test-fast:
	cd mysql-test ; \
250 251 252
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(subset) --force --skip-ndb --skip-innodb --skip-im --skip-rpl ; \
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(subset) --force --suite=funcs_1 --do-test=myisam ; \
	    @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(subset) --force --suite=stress --do-test=ddl_myisam 
253 254 255 256 257 258 259 260 261 262 263 264

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 \
265 266
	    test-binlog-statement test-ext test-fast-view \
	        test-fast-cursor test-unit
267

Narayanan V's avatar
Narayanan V committed
268
#
Narayanan V's avatar
Narayanan V committed
269 270 271
# 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
272 273
#

Narayanan V's avatar
Narayanan V committed
274 275 276 277 278 279
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
280 281

#
Narayanan V's avatar
Narayanan V committed
282
# Rules for checking that the abi/api has not changed.
Narayanan V's avatar
Narayanan V committed
283
#
Narayanan V's avatar
Narayanan V committed
284
# The following steps are followed in the do_abi_check rule below
Narayanan V's avatar
Narayanan V committed
285 286
#
# 1) Generate preprocessor output for the files that need to
Narayanan V's avatar
Narayanan V committed
287 288 289 290
#    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
291
#    to prevent seeing these messages.
Narayanan V's avatar
Narayanan V committed
292 293
# 2) sed the output to 
#    2.1) remove blank lines and lines that begin with "# "
Narayanan V's avatar
Narayanan V committed
294 295 296 297
#    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
298 299 300 301 302 303 304 305 306 307 308 309 310
# 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
311
# leave a <build directory>/abi_check.out file.
Narayanan V's avatar
Narayanan V committed
312 313
#
# A developer with a justified API change will then do a
Narayanan V's avatar
Narayanan V committed
314
# mv <build directory>/abi_check.out include/mysql/plugin.pp 
Narayanan V's avatar
Narayanan V committed
315 316 317
# to replace the old canons with the new ones.
#

Narayanan V's avatar
Narayanan V committed
318 319 320 321 322 323 324 325 326
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
327
	         @CC@ -E -nostdinc -dI \
Narayanan V's avatar
Narayanan V committed
328 329 330
	                  -I$(top_srcdir)/include \
	                  -I$(top_srcdir)/include/mysql \
	                  -I$(top_srcdir)/sql \
Narayanan V's avatar
Narayanan V committed
331 332 333
	                  -I$(top_builddir)/include \
	                  -I$(top_builddir)/include/mysql \
	                  -I$(top_builddir)/sql \
Narayanan V's avatar
Narayanan V committed
334 335
	                                 $$file 2>/dev/null | \
	                  @SED@ -e '/^# /d' \
Narayanan V's avatar
Narayanan V committed
336
	                            -e '/^[ 	]*$$/d' \
Narayanan V's avatar
Narayanan V committed
337 338
	                            -e '/^#pragma GCC set_debug_pwd/d' \
	                            -e '/^#ident/d' > \
Narayanan V's avatar
Narayanan V committed
339
	                                       $(top_builddir)/abi_check.out; \
Narayanan V's avatar
Narayanan V committed
340
	                  @DIFF@ -w $$file.pp $(top_builddir)/abi_check.out; \
Narayanan V's avatar
Narayanan V committed
341
	                  @RM@ $(top_builddir)/abi_check.out; \
Narayanan V's avatar
Narayanan V committed
342
	done
Narayanan V's avatar
Narayanan V committed
343

344 345
# Don't update the files from bitkeeper
%::SCCS/s.%