Makefile.am 11.8 KB
Newer Older
Joerg Bruehe's avatar
Joerg Bruehe committed
1
# Copyright 2000-2008 MySQL AB, 2009 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
			README COPYING EXCEPTIONS-CLIENT \
                        CMakeLists.txt configure.cmake config.h.cmake BUILD-CMAKE
24

25
SUBDIRS =		. include @docs_dirs@ @zlib_dir@ \
26
			@readline_topdir@ sql-common scripts \
27
			@pstack_dir@ libservices \
Joerg Bruehe's avatar
Joerg Bruehe committed
28
			@sql_union_dirs@ unittest \
29
			@sql_server@ @man_dirs@ tests \
30
			netware @libmysqld_dirs@ \
31
			mysql-test support-files sql-bench \
32 33
			win \
			cmake
unknown's avatar
unknown committed
34 35
DIST_SUBDIRS =		. include Docs zlib \
			cmd-line-utils sql-common scripts \
36
			pstack libservices \
unknown's avatar
unknown committed
37 38 39
			strings mysys dbug extra regex libmysql libmysql_r client unittest storage plugin \
			vio sql man tests \
			netware libmysqld \
40
			mysql-test support-files sql-bench \
unknown's avatar
unknown committed
41
			win \
42
			cmake \
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
	rm -rf `find $(distdir) -type d -name SCCS -print`
unknown's avatar
unknown committed
57
	mkdir -p $(distdir)/win
58
	scripts/mysql_install_db --no-defaults --cross-bootstrap \
59
		--builddir=$(top_builddir) \
unknown's avatar
unknown committed
60 61
		--datadir=$(distdir)/win/data \
		--srcdir=$(top_srcdir)
62
	storage/myisam/myisamchk --silent --fast $(distdir)/win/data/mysql/*.MYI
63 64
	test ! -f $(top_srcdir)/configure.am  || \
	$(INSTALL_DATA)  $(top_srcdir)/configure.am $(distdir)
65

Narayanan V's avatar
Narayanan V committed
66
all-local:		@ABI_CHECK@	
Narayanan V's avatar
Narayanan V committed
67

unknown's avatar
unknown committed
68
tags:
69
	support-files/build-tags
70

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

unknown's avatar
unknown committed
80 81 82 83 84 85 86
# 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.
unknown's avatar
unknown committed
87

88 89 90 91
test-unit:
	cd unittest && $(MAKE) test

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

95
test-nr:
96
	cd mysql-test ; \
97
	    @PERL@ ./mysql-test-run.pl $(force) --mysqld=--binlog-format=row
unknown's avatar
unknown committed
98

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

103
test-ns:
unknown's avatar
unknown committed
104
	cd mysql-test ; \
105 106
	    @PERL@ ./mysql-test-run.pl $(force) $(mem) --mysqld=--binlog-format=mixed ; \
	    @PERL@ ./mysql-test-run.pl $(force) $(mem) --suite=funcs_1
unknown's avatar
unknown committed
107 108

test-binlog-statement:
109
	cd mysql-test ; \
110
	    @PERL@ ./mysql-test-run.pl $(force) --mysqld=--binlog-format=statement
111

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

122 123 124 125 126
test-reprepare:
	cd mysql-test ; \
	    @PERL@ ./mysql-test-run.pl $(force) $(mem) --ps-protocol \
		--mysqld=--debug=+d,reprepare_each_statement

127 128
test:	test-unit test-ns test-pr

Magnus Svensson's avatar
Magnus Svensson committed
129 130 131 132
smoke:
	cd mysql-test ; \
	    @PERL@ ./mysql-test-run.pl --do-test=s

133 134 135
test-full:	test test-nr test-ps

test-force:
136
	$(MAKE) -k force=--force test
137 138

test-force-full:
139
	$(MAKE) -k force=--force test-full
unknown's avatar
unknown committed
140

141 142
#used by autopush.pl to run memory based tests
test-force-mem:
143
	$(MAKE) -k force=--force mem=--mem test
144

145 146
EXP = --experimental=collections/default.experimental

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

unknown's avatar
unknown committed
191 192 193
test-bt-fast:
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
	    @PERL@ ./mysql-test-run.pl  --comment=ps    --force --timer \
194
	        --skip-ndbcluster --ps-protocol --report-features $(EXP)
unknown's avatar
unknown committed
195 196 197 198
	-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 \
199
	          --with-ndbcluster-only $(EXP) ; \
unknown's avatar
unknown committed
200 201 202 203
	else \
	  echo "no program found for 'ndbcluster' tests - skipped testing" ; \
	fi
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
204
	    @PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress $(EXP)
unknown's avatar
unknown committed
205

206 207
test-bt-debug:
	-cd mysql-test ; MTR_BUILD_THREAD=auto \
208
	    @PERL@ ./mysql-test-run.pl --comment=debug  --force --timer \
209
	        --skip-ndbcluster --skip-rpl --report-features $(EXP)
210

211 212 213 214
# Keep these for a while
test-pl:	test
test-full-pl:	test-full
test-force-pl:	test-force
215
test-force-pl-mem:  test-force-mem
216 217
test-force-full-pl: test-force-full

218 219
test-ext-funcs:
	cd mysql-test ; \
220
	    @PERL@ ./mysql-test-run.pl --force --reorder --suite=funcs_1 ; \
221
	    @PERL@ ./mysql-test-run.pl --force --suite=funcs_2
222 223 224

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

test-ext-partitions:
	cd mysql-test ; \
229
	    @PERL@ ./mysql-test-run.pl --force --suite=parts
230 231 232

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

235 236
test-ext-stress:
	cd mysql-test ; \
237
	    @PERL@ ./mysql-test-run.pl --force --big-test --suite=stress
238 239

test-ext:	test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp test-ext-stress
240 241 242

test-fast:
	cd mysql-test ; \
243 244 245
	    @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 
246 247 248 249 250 251 252 253 254 255 256 257

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 \
258 259
	    test-binlog-statement test-ext test-fast-view \
	        test-fast-cursor test-unit
260

Narayanan V's avatar
Narayanan V committed
261
#
Narayanan V's avatar
Narayanan V committed
262
# Headers which need to be checked for abi/api compatibility.
Narayanan V's avatar
Narayanan V committed
263 264
#

Narayanan V's avatar
Narayanan V committed
265
API_PREPROCESSOR_HEADER = $(top_srcdir)/include/mysql/plugin.h \
Marc Alff's avatar
Marc Alff committed
266 267 268
			$(top_srcdir)/include/mysql.h \
			$(top_srcdir)/include/mysql/psi/psi_abi_v1.h \
			$(top_srcdir)/include/mysql/psi/psi_abi_v2.h
Narayanan V's avatar
Narayanan V committed
269

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

Narayanan V's avatar
Narayanan V committed
307 308 309
abi_check:	$(API_PREPROCESSOR_HEADER)
	$(MAKE) abi_headers="$^" do_abi_check

310
abi_check_all:	abi_check 
Narayanan V's avatar
Narayanan V committed
311 312 313 314

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