Makefile.am 5.21 KB
Newer Older
bk@work.mysql.com's avatar
bk@work.mysql.com committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
# 
# 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# 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

#called from the top level Makefile


MYSQLDATAdir =		$(localstatedir)
MYSQLSHAREdir =		$(pkgdatadir)
MYSQLBASEdir=		$(prefix)
23
INCLUDES =		@MT_INCLUDES@ \
24
			@bdb_includes@ @innodb_includes@ @gemini_includes@ \
25
			-I$(srcdir)/../include \
bk@work.mysql.com's avatar
bk@work.mysql.com committed
26
			-I$(srcdir)/../regex \
27
			-I$(srcdir) -I../include -I.. -I. $(openssl_includes)
bk@work.mysql.com's avatar
bk@work.mysql.com committed
28 29 30 31 32
WRAPLIBS=		@WRAPLIBS@
SUBDIRS =		share
bin_PROGRAMS	=	mysqlbinlog
libexec_PROGRAMS =	mysqld
noinst_PROGRAMS =	gen_lex_hash
33
gen_lex_hash_LDFLAGS =        @NOINST_LDFLAGS@
bk@work.mysql.com's avatar
bk@work.mysql.com committed
34 35 36 37 38 39 40 41 42
LDADD =			../isam/libnisam.a \
			../merge/libmerge.a \
			../myisam/libmyisam.a \
			../myisammrg/libmyisammrg.a \
			../heap/libheap.a \
			../mysys/libmysys.a \
			../dbug/libdbug.a \
			../regex/libregex.a \
			../strings/libmystrings.a
43 44
			#../vio/libvio.a

45
mysqld_LDADD =		@MYSQLD_EXTRA_LDFLAGS@ \
serg@serg.mysql.com's avatar
serg@serg.mysql.com committed
46
			@bdb_libs@ @innodb_libs@ @pstack_libs@ \
47
                        @gemini_libs@ \
48
			$(LDADD)  $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ @openssl_libs@
bk@work.mysql.com's avatar
bk@work.mysql.com committed
49 50 51 52
noinst_HEADERS =	item.h item_func.h item_sum.h item_cmpfunc.h \
			item_strfunc.h item_timefunc.h item_uniq.h \
			item_create.h mysql_priv.h \
			procedure.h sql_class.h sql_lex.h sql_list.h \
53
			sql_manager.h sql_map.h sql_string.h unireg.h \
54 55 56
			field.h handler.h \
			ha_isammrg.h ha_isam.h ha_myisammrg.h\
			ha_heap.h ha_myisam.h ha_berkeley.h ha_innobase.h \
57
			ha_gemini.h opt_range.h opt_ft.h \
bk@work.mysql.com's avatar
bk@work.mysql.com committed
58 59
			sql_select.h structs.h table.h sql_udf.h hash_filo.h\
			lex.h lex_symbol.h sql_acl.h sql_crypt.h md5.h \
60
                        log_event.h mini_client.h sql_repl.h slave.h \
61
			stacktrace.h sql_sort.h
62
mysqld_SOURCES =	sql_lex.cc sql_handler.cc \
bk@work.mysql.com's avatar
bk@work.mysql.com committed
63 64 65 66
			item.cc item_sum.cc item_buff.cc item_func.cc \
			item_cmpfunc.cc item_strfunc.cc item_timefunc.cc \
			thr_malloc.cc item_create.cc \
			field.cc key.cc sql_class.cc sql_list.cc \
67
			net_serv.cc violite.c net_pkg.cc lock.cc my_lock.c \
68
			sql_string.cc sql_manager.cc sql_map.cc \
bk@work.mysql.com's avatar
bk@work.mysql.com committed
69 70 71
			mysqld.cc password.c hash_filo.cc hostname.cc \
			convert.cc sql_parse.cc sql_yacc.yy \
			sql_base.cc table.cc sql_select.cc sql_insert.cc \
72
			sql_update.cc sql_delete.cc uniques.cc \
bk@work.mysql.com's avatar
bk@work.mysql.com committed
73
			procedure.cc item_uniq.cc sql_test.cc \
74 75
			log.cc log_event.cc init.cc derror.cc sql_acl.cc \
			unireg.cc \
76
			time.cc opt_range.cc opt_sum.cc opt_ft.cc \
bk@work.mysql.com's avatar
bk@work.mysql.com committed
77
		   	records.cc filesort.cc handler.cc \
78 79 80
		        ha_heap.cc ha_myisam.cc ha_myisammrg.cc \
	                ha_berkeley.cc ha_innobase.cc ha_gemini.cc \
			ha_isam.cc ha_isammrg.cc \
81
			sql_db.cc sql_table.cc sql_rename.cc sql_crypt.cc \
bk@work.mysql.com's avatar
bk@work.mysql.com committed
82 83
			sql_load.cc mf_iocache.cc field_conv.cc sql_show.cc \
			sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc \
84
			slave.cc sql_repl.cc \
85 86
			mini_client.cc mini_client_errors.c \
			md5.c stacktrace.c
bk@work.mysql.com's avatar
bk@work.mysql.com committed
87 88
gen_lex_hash_SOURCES =	gen_lex_hash.cc
gen_lex_hash_LDADD =	$(LDADD) $(CXXLDFLAGS)
89
mysqlbinlog_SOURCES =   mysqlbinlog.cc mini_client.cc net_serv.cc violite.c \
90
			mini_client_errors.c password.c
91
mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS) $(mysqld_LDADD)
bk@work.mysql.com's avatar
bk@work.mysql.com committed
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126

DEFS =			-DMYSQL_SERVER \
			-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
			-DDATADIR="\"$(MYSQLDATAdir)\"" \
			-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
			@DEFS@
# Don't put lex_hash.h in BUILT_SOURCES as this will give infinite recursion
BUILT_SOURCES =		sql_yacc.cc sql_yacc.h
EXTRA_DIST =		udf_example.cc $(BUILT_SOURCES)
YFLAGS =		-d

OMIT_DEPENDENCIES =	pthread.h stdio.h __stdio.h stdlib.h __stdlib.h math.h\
			__math.h time.h __time.h unistd.h __unistd.h types.h \
			xtypes.h ac-types.h posix.h string.h __string.h \
			errno.h socket.h inet.h dirent.h netdb.h \
			cleanup.h cond.h debug_out.h fd.h kernel.h mutex.h \
			prio_queue.h pthread_attr.h pthread_once.h queue.h\
			sleep.h specific.h version.h pwd.h timers.h uio.h \
			cdefs.h machdep.h signal.h __signal.h util.h lex.h \
			wait.h

link_sources:
	rm -f mini_client_errors.c
	@LN_CP_F@ ../libmysql/errmsg.c mini_client_errors.c

gen_lex_hash.o:		gen_lex_hash.cc lex.h
			$(CXXCOMPILE) -c $(INCLUDES) $<

# Try to get better dependencies for the grammar. Othervise really bad
# things like different grammars for different pars of MySQL can
# happen if you are unlucky.
sql_yacc.cc:	sql_yacc.yy
sql_yacc.h:	sql_yacc.yy

sql_yacc.o:	sql_yacc.cc sql_yacc.h
127
		@echo "Note: The following compile may take a long time."
bk@work.mysql.com's avatar
bk@work.mysql.com committed
128 129 130 131 132 133 134 135 136 137 138 139
		@echo "If it fails, re-run configure with --with-low-memory"
		$(CXXCOMPILE) $(LM_CFLAGS) -c $<

lex_hash.h:	lex.h gen_lex_hash.cc sql_yacc.h
		$(MAKE) gen_lex_hash
		./gen_lex_hash > $@

# Hack to ensure that lex_hash.h is built early
sql_lex.o:	lex_hash.h

#distclean:
#		rm -f lex_hash.h
140 141 142

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