2006-11-18 02:41:20 +03:00
#!gmake
2007-07-14 04:58:51 +04:00
2008-07-09 05:08:44 +04:00
2006-11-18 02:41:20 +03:00
CC = @CC@
2010-05-20 10:27:40 +04:00
AR = ar
ARFLAGS = cru
RANLIB = ranlib
2006-11-18 02:41:20 +03:00
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
includedir = @includedir@
2010-08-06 12:12:13 +04:00
docdir = @docdir@
2006-11-18 02:41:20 +03:00
libdir = @libdir@
bindir = @bindir@
2007-05-29 09:52:03 +04:00
sbindir = @sbindir@
2007-06-09 09:21:30 +04:00
mandir = @mandir@
2007-04-30 00:42:23 +04:00
localstatedir = @localstatedir@
2009-02-04 02:15:57 +03:00
logdir = @LOGDIR@
2012-10-18 18:55:19 +04:00
sockpath = @SOCKPATH@
2010-08-18 03:46:31 +04:00
VPATH = @srcdir@:@tdbdir@:@tallocdir@:@libreplacedir@:@poptdir@:@teventdir@:
2006-11-18 02:41:20 +03:00
srcdir = @srcdir@
2007-05-29 09:20:41 +04:00
etcdir = @sysconfdir@
2006-11-18 02:41:20 +03:00
builddir = @builddir@
2007-05-28 00:48:18 +04:00
DESTDIR = /
2006-11-18 02:41:20 +03:00
EXTRA_OBJ = @EXTRA_OBJ@
2007-06-09 02:41:36 +04:00
XSLTPROC = /usr/bin/xsltproc
2007-06-09 09:21:30 +04:00
INSTALLCMD = @INSTALL@
2006-11-18 02:41:20 +03:00
2007-05-02 23:21:14 +04:00
POPT_LIBS = @POPT_LIBS@
POPT_CFLAGS = @POPT_CFLAGS@
POPT_OBJ = @POPT_OBJ@
2012-03-21 06:18:10 +04:00
TALLOC_LIBS = @TALLOC_LIBS@
TALLOC_CFLAGS = @TALLOC_CFLAGS@
TALLOC_OBJ = @TALLOC_OBJ@
2012-03-21 08:56:45 +04:00
TEVENT_LIBS = @TEVENT_LIBS@
TEVENT_CFLAGS = @TEVENT_CFLAGS@
TEVENT_OBJ = @TEVENT_OBJ@
2012-03-21 07:45:56 +04:00
TDB_LIBS = @TDB_LIBS@
TDB_CFLAGS = @TDB_CFLAGS@
TDB_OBJ = @TDB_OBJ@
2013-05-24 09:25:52 +04:00
REPLACE_OBJ = @LIBREPLACEOBJ@
2011-10-20 16:17:45 +04:00
SOCKET_WRAPPER_OBJ = @SOCKET_WRAPPER_OBJS@
2011-07-13 20:11:23 +04:00
PMDA_LIBS = -lpcp -lpcp_pmda
PMDA_INSTALL = @CTDB_PMDA_INSTALL@
2013-05-28 08:16:25 +04:00
PMDA_DEST_DIR = /var/lib/pcp/pmdas/ctdb
2011-07-13 20:11:23 +04:00
2013-06-07 05:24:17 +04:00
WRAPPER = @
i f e q ( $( V ) , 1 )
WRAPPER =
e n d i f
i f e q ( $( VERBOSE ) , 1 )
WRAPPER =
e n d i f
2013-05-24 09:14:20 +04:00
i f e q ( $( CC ) , g c c )
2013-07-10 10:35:53 +04:00
EXTRA_CFLAGS = -Wno-format-zero-length -Wno-deprecated-declarations -fPIC
2013-05-24 09:14:20 +04:00
e n d i f
2012-02-06 15:50:05 +04:00
CFLAGS = @CPPFLAGS@ -g -I$( srcdir) /include -Iinclude -Ilib -Ilib/util -I$( srcdir) \
2012-03-21 07:45:56 +04:00
$( TALLOC_CFLAGS) $( TEVENT_CFLAGS) $( TDB_CFLAGS) -I@libreplacedir@ \
2008-10-14 18:08:29 +04:00
-DVARDIR= \" $( localstatedir) \" -DETCDIR= \" $( etcdir) \" \
2013-10-03 09:47:30 +04:00
-DCTDB_VARDIR= \" $( localstatedir) /lib/ctdb\" \
2013-04-30 09:07:49 +04:00
-DLOGDIR= \" $( logdir) \" -DBINDIR= \" $( bindir) \" \
2012-10-18 18:55:19 +04:00
-DSOCKPATH= \" $( sockpath) \" \
2013-07-10 10:30:29 +04:00
-DUSE_MMAP= 1 @CFLAGS@ $( POPT_CFLAGS) \
2013-05-24 09:14:20 +04:00
$( EXTRA_CFLAGS)
2011-09-03 03:30:08 +04:00
LDSHFLAGS = -fPIC -shared
#LDSHFLAGS=-fPIC -shared -Wl,-Bsymbolic -Wl,-z,relo -Wl,-Bsymbolic-funtions -Wl,--as-needed -Wl,-z,defs
SHLD = ${ CC } ${ CFLAGS } ${ LDSHFLAGS } -o $@
2006-11-18 02:41:20 +03:00
2012-03-21 07:45:56 +04:00
LIB_FLAGS = @LDFLAGS@ -Llib @LIBS@ $( POPT_LIBS) $( TALLOC_LIBS) $( TEVENT_LIBS) $( TDB_LIBS) \
@INFINIBAND_LIBS@ @CTDB_PCAP_LDFLAGS@
2006-11-18 02:41:20 +03:00
2013-05-22 08:23:17 +04:00
CTDB_VERSION_H = include/ctdb_version.h
2012-10-30 04:48:23 +04:00
2007-06-07 16:30:29 +04:00
UTIL_OBJ = lib/util/idtree.o lib/util/db_wrap.o lib/util/strlist.o lib/util/util.o \
2009-12-18 14:32:38 +03:00
lib/util/util_time.o lib/util/util_file.o lib/util/fault.o lib/util/substitute.o \
lib/util/signal.o
2006-11-18 02:41:20 +03:00
2007-06-07 16:30:29 +04:00
CTDB_COMMON_OBJ = common/ctdb_io.o common/ctdb_util.o \
2007-06-07 16:06:19 +04:00
common/ctdb_ltdb.o common/ctdb_message.o common/cmdline.o \
2009-11-18 04:44:18 +03:00
lib/util/debug.o common/rb_tree.o @CTDB_SYSTEM_OBJ@ common/system_common.o \
2013-02-05 05:13:57 +04:00
common/ctdb_logging.o common/ctdb_fork.o
2010-05-20 10:27:40 +04:00
2006-11-28 03:51:33 +03:00
CTDB_TCP_OBJ = tcp/tcp_connect.o tcp/tcp_io.o tcp/tcp_init.o
2006-11-27 13:38:13 +03:00
2013-05-24 09:25:52 +04:00
CTDB_EXTERNAL_OBJ = $( POPT_OBJ) $( TALLOC_OBJ) $( TDB_OBJ) \
$( REPLACE_OBJ) $( EXTRA_OBJ) $( TEVENT_OBJ) $( SOCKET_WRAPPER_OBJ)
2007-06-07 16:06:19 +04:00
CTDB_CLIENT_OBJ = client/ctdb_client.o \
2013-05-24 09:25:52 +04:00
$( CTDB_COMMON_OBJ) $( UTIL_OBJ) $( CTDB_EXTERNAL_OBJ)
2007-06-07 16:06:19 +04:00
2012-06-14 10:12:48 +04:00
CTDB_SERVER_OBJ = server/ctdbd.o server/ctdb_daemon.o \
2007-06-07 16:16:48 +04:00
server/ctdb_recoverd.o server/ctdb_recover.o server/ctdb_freeze.o \
server/ctdb_tunables.o server/ctdb_monitor.o server/ctdb_server.o \
server/ctdb_control.o server/ctdb_call.o server/ctdb_ltdb_server.o \
2007-07-04 10:51:13 +04:00
server/ctdb_traverse.o server/eventscript.o server/ctdb_takeover.o \
2007-09-21 06:24:02 +04:00
server/ctdb_serverids.o server/ctdb_persistent.o \
2009-07-28 18:45:31 +04:00
server/ctdb_keepalive.o server/ctdb_logging.o server/ctdb_uptime.o \
2010-09-29 06:13:05 +04:00
server/ctdb_vacuum.o server/ctdb_banning.o server/ctdb_statistics.o \
2012-10-11 04:29:29 +04:00
server/ctdb_update_record.o server/ctdb_lock.o \
2007-07-04 10:52:38 +04:00
$( CTDB_CLIENT_OBJ) $( CTDB_TCP_OBJ) @INFINIBAND_WRAPPER_OBJ@
2006-11-18 02:41:20 +03:00
2009-12-15 04:14:49 +03:00
TEST_BINS = tests/bin/ctdb_bench tests/bin/ctdb_fetch tests/bin/ctdb_fetch_one \
2011-07-20 09:47:15 +04:00
tests/bin/ctdb_fetch_readonly_once tests/bin/ctdb_fetch_readonly_loop \
2011-07-20 05:50:14 +04:00
tests/bin/ctdb_store tests/bin/ctdb_trackingdb_test \
2009-01-09 10:15:06 +03:00
tests/bin/ctdb_randrec tests/bin/ctdb_persistent \
tests/bin/ctdb_traverse tests/bin/rb_test tests/bin/ctdb_transaction \
2011-07-20 06:13:53 +04:00
tests/bin/ctdb_takeover_tests tests/bin/ctdb_update_record \
2012-03-12 09:09:32 +04:00
tests/bin/ctdb_update_record_persistent \
2013-09-18 08:27:03 +04:00
tests/bin/ctdb_functest tests/bin/ctdb_stubtest \
2012-12-04 11:27:10 +04:00
tests/bin/ctdb_porting_tests tests/bin/ctdb_lock_tdb \
2007-08-08 05:21:18 +04:00
@INFINIBAND_BINS@
2013-04-22 09:36:27 +04:00
BINS = bin/ctdb @CTDB_SCSI_IO@ bin/smnotify bin/ping_pong bin/ltdbtool \
bin/ctdb_lock_helper @CTDB_PMDA@
2011-07-13 20:11:23 +04:00
2007-05-29 09:52:03 +04:00
SBINS = bin/ctdbd
2006-11-18 02:41:20 +03:00
2009-01-09 10:15:06 +03:00
DIRS = lib bin tests/bin
2006-11-18 02:41:20 +03:00
2012-10-17 03:09:26 +04:00
.SUFFIXES : .c .o .h
2007-06-12 07:44:01 +04:00
2013-08-25 15:44:59 +04:00
all : showflags dirs $( CTDB_VERSION_H ) $( CTDB_SERVER_OBJ ) $( CTDB_CLIENT_OBJ ) $( BINS ) $( SBINS ) $( TEST_BINS )
2006-11-18 02:41:20 +03:00
showflags :
@echo 'ctdb will be compiled with flags:'
@echo ' CFLAGS = $(CFLAGS)'
2012-03-21 09:08:57 +04:00
@echo ' LIBS = $(LIB_FLAGS)'
2006-11-18 02:41:20 +03:00
2009-02-04 02:22:01 +03:00
showlayout ::
@echo "ctdb will be installed into:"
@echo " prefix: $( prefix) "
@echo " bindir: $( bindir) "
@echo " sbindir: $( sbindir) "
@echo " libdir: $( libdir) "
@echo " vardir: $( localstatedir) "
@echo " logdir: $( logdir) "
@echo " mandir: $( mandir) "
@echo " etcdir: $( etcdir) "
2006-11-18 02:41:20 +03:00
.c.o :
@echo Compiling $* .c
@mkdir -p ` dirname $@ `
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -c $< -o $@
2006-11-18 02:41:20 +03:00
dirs :
2013-06-07 05:24:17 +04:00
$( WRAPPER) mkdir -p $( DIRS)
2006-11-18 02:41:20 +03:00
2012-10-30 04:48:23 +04:00
$(CTDB_VERSION_H) :
@echo Generating $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) ./packaging/mkversion.sh
2012-10-30 04:48:23 +04:00
2007-06-07 16:06:19 +04:00
bin/ctdbd : $( CTDB_SERVER_OBJ )
2007-04-11 12:54:22 +04:00
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ $( CTDB_SERVER_OBJ) $( LIB_FLAGS)
2007-04-11 12:54:22 +04:00
2007-08-07 03:03:51 +04:00
bin/scsi_io : $( CTDB_CLIENT_OBJ ) utils /scsi_io /scsi_io .o
2007-07-02 10:13:31 +04:00
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ utils/scsi_io/scsi_io.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2007-07-02 10:13:31 +04:00
2013-08-29 11:22:38 +04:00
bin/ctdb : $( CTDB_CLIENT_OBJ ) tools /ctdb .o tools /ctdb_vacuum .o
2007-04-26 16:27:49 +04:00
@echo Linking $@
2013-08-29 11:22:38 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ tools/ctdb.o tools/ctdb_vacuum.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2007-04-26 16:27:49 +04:00
2012-03-21 07:45:56 +04:00
bin/ltdbtool : tools /ltdbtool .o $( TDB_OBJ )
2011-04-14 14:51:59 +04:00
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ $+ $( TDB_LIBS) $( LIB_FLAGS)
2011-04-14 14:51:59 +04:00
2013-05-24 09:25:52 +04:00
bin/ctdb_lock_helper : server /ctdb_lock_helper .o lib /util /util_file .o $( CTDB_EXTERNAL_OBJ )
2013-04-22 09:36:27 +04:00
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ server/ctdb_lock_helper.o lib/util/util_file.o $( CTDB_EXTERNAL_OBJ) $( TDB_LIBS) $( LIB_FLAGS)
2013-04-22 09:36:27 +04:00
2009-05-20 10:59:00 +04:00
bin/smnotify : utils /smnotify /gen_xdr .o utils /smnotify /gen_smnotify .o utils /smnotify /smnotify .o $( POPT_OBJ )
2007-08-03 04:18:48 +04:00
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ utils/smnotify/smnotify.o utils/smnotify/gen_xdr.o utils/smnotify/gen_smnotify.o $( POPT_OBJ) $( LIB_FLAGS)
2007-08-03 04:18:48 +04:00
2009-02-25 01:13:16 +03:00
utils/smnotify/smnotify.o : utils /smnotify /smnotify .c utils /smnotify /smnotify .h
2007-08-03 04:18:48 +04:00
utils/smnotify/smnotify.h : utils /smnotify /smnotify .x
@echo Generating $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) rpcgen -h utils/smnotify/smnotify.x > utils/smnotify/smnotify.h
2007-08-03 04:18:48 +04:00
utils/smnotify/gen_xdr.c : utils /smnotify /smnotify .x utils /smnotify /smnotify .h
@echo Generating $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) rpcgen -c utils/smnotify/smnotify.x | grep -Ev '^[[:space:]]+register int32_t \*buf;' > utils/smnotify/gen_xdr.c
2007-08-03 04:18:48 +04:00
utils/smnotify/gen_smnotify.c : utils /smnotify /smnotify .x utils /smnotify /smnotify .h
@echo Generating $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) rpcgen -l utils/smnotify/smnotify.x > utils/smnotify/gen_smnotify.c
2007-08-03 04:18:48 +04:00
2009-04-29 19:57:43 +04:00
bin/ping_pong : utils /ping_pong /ping_pong .o
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ utils/ping_pong/ping_pong.o $( LIB_FLAGS)
2009-04-29 19:57:43 +04:00
2011-07-13 20:11:23 +04:00
bin/pmdactdb : $( CTDB_CLIENT_OBJ ) utils /pmda /pmda_ctdb .o
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ utils/pmda/pmda_ctdb.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS) $( PMDA_LIBS)
2009-04-29 19:57:43 +04:00
2009-01-09 10:15:06 +03:00
tests/bin/rb_test : $( CTDB_CLIENT_OBJ ) tests /src /rb_test .o
2007-08-08 05:21:18 +04:00
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ tests/src/rb_test.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2007-08-08 05:21:18 +04:00
2009-01-09 10:15:06 +03:00
tests/bin/ctdb_bench : $( CTDB_CLIENT_OBJ ) tests /src /ctdb_bench .o
2006-12-19 08:27:03 +03:00
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ tests/src/ctdb_bench.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2006-12-19 08:27:03 +03:00
2009-01-09 10:15:06 +03:00
tests/bin/ctdb_fetch : $( CTDB_CLIENT_OBJ ) tests /src /ctdb_fetch .o
2007-04-05 07:18:31 +04:00
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ tests/src/ctdb_fetch.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2007-04-05 07:18:31 +04:00
2009-12-15 04:14:49 +03:00
tests/bin/ctdb_fetch_one : $( CTDB_CLIENT_OBJ ) tests /src /ctdb_fetch_one .o
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ tests/src/ctdb_fetch_one.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2009-12-15 04:14:49 +03:00
2013-08-25 15:43:29 +04:00
tests/bin/ctdb_fetch_readonly_once : tests /src /ctdb_fetch_readonly_once .o $( CTDB_CLIENT_OBJ )
2011-01-23 23:39:33 +03:00
@echo Linking $@
2013-08-25 15:43:29 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ tests/src/ctdb_fetch_readonly_once.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2011-07-20 09:43:55 +04:00
2011-07-20 09:47:15 +04:00
tests/bin/ctdb_fetch_readonly_loop : $( CTDB_CLIENT_OBJ ) tests /src /ctdb_fetch_readonly_loop .o
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ tests/src/ctdb_fetch_readonly_loop.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2011-07-20 09:47:15 +04:00
2011-07-20 05:50:14 +04:00
tests/bin/ctdb_trackingdb_test : $( CTDB_CLIENT_OBJ ) tests /src /ctdb_trackingdb_test .o
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ tests/src/ctdb_trackingdb_test.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2011-07-20 05:50:14 +04:00
2013-05-29 09:14:42 +04:00
tests/bin/ctdb_update_record : $( CTDB_CLIENT_OBJ ) tests /src /ctdb_update_record .o
2011-07-20 06:13:53 +04:00
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ tests/src/ctdb_update_record.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2011-07-20 06:13:53 +04:00
2013-05-29 09:14:42 +04:00
tests/bin/ctdb_update_record_persistent : $( CTDB_CLIENT_OBJ ) tests /src /ctdb_update_record_persistent .o
2012-03-12 09:09:32 +04:00
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ tests/src/ctdb_update_record_persistent.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2012-03-12 09:09:32 +04:00
2013-05-29 09:14:42 +04:00
tests/bin/ctdb_store : $( CTDB_CLIENT_OBJ ) tests /src /ctdb_store .o
2007-06-17 05:13:42 +04:00
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ tests/src/ctdb_store.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2007-06-17 05:13:42 +04:00
2013-05-29 09:14:42 +04:00
tests/bin/ctdb_traverse : $( CTDB_CLIENT_OBJ ) tests /src /ctdb_traverse .o
2008-01-29 03:39:06 +03:00
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ tests/src/ctdb_traverse.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2008-01-29 03:39:06 +03:00
2013-05-29 09:14:42 +04:00
tests/bin/ctdb_randrec : $( CTDB_CLIENT_OBJ ) tests /src /ctdb_randrec .o
2008-01-04 01:19:06 +03:00
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ tests/src/ctdb_randrec.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2008-01-04 01:19:06 +03:00
2013-05-29 09:14:42 +04:00
tests/bin/ctdb_persistent : $( CTDB_CLIENT_OBJ ) tests /src /ctdb_persistent .o
2007-09-21 06:24:02 +04:00
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ tests/src/ctdb_persistent.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2007-09-21 06:24:02 +04:00
2013-01-14 20:21:01 +04:00
tests/bin/ctdb_porting_tests : $( CTDB_CLIENT_OBJ ) tests /src /ctdb_porting_tests .o
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ tests/src/ctdb_porting_tests.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2013-01-14 20:21:01 +04:00
2013-05-29 09:14:42 +04:00
tests/bin/ctdb_transaction : $( CTDB_CLIENT_OBJ ) tests /src /ctdb_transaction .o
2008-07-30 13:55:54 +04:00
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ tests/src/ctdb_transaction.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2008-07-30 13:55:54 +04:00
2011-11-11 07:15:52 +04:00
CTDB_SERVER_MOST_OBJ = $( CTDB_SERVER_OBJ:server/ctdbd.o= )
2011-12-07 07:04:54 +04:00
CTDBD_TEST_C = $( CTDB_SERVER_MOST_OBJ:.o= .c) tests/src/ctdbd_test.c
2013-09-18 08:27:03 +04:00
CTDB_TEST_C = $( CTDB_CLIENT_OBJ:.o= .c) tools/ctdb.c tools/ctdb_vacuum.c tests/src/ctdb_test_stubs.c
2011-12-07 07:04:54 +04:00
2012-03-21 07:45:56 +04:00
CTDB_TEST_OBJ = $( TALLOC_OBJ) $( TDB_OBJ) \
2013-05-24 09:25:52 +04:00
@CTDB_SYSTEM_OBJ@ $( REPLACE_OBJ) $( EXTRA_OBJ) $( TEVENT_OBJ) $( SOCKET_WRAPPER_OBJ)
2011-11-11 07:15:52 +04:00
2011-12-07 07:04:54 +04:00
tests/src/ctdb_takeover_tests.o : tests /src /ctdb_takeover_tests .c $( CTDBD_TEST_C )
2011-07-28 09:22:42 +04:00
2011-11-11 07:15:52 +04:00
tests/bin/ctdb_takeover_tests : $( CTDB_TEST_OBJ ) tests /src /ctdb_takeover_tests .o
2011-07-28 09:22:42 +04:00
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ tests/src/ctdb_takeover_tests.o $( CTDB_TEST_OBJ) $( LIB_FLAGS)
2011-07-28 09:22:42 +04:00
2013-09-18 08:27:03 +04:00
tests/src/ctdb_functest.o : tests /src /ctdb_functest .c tests /src /ctdb_test .c $( CTDB_TEST_C )
2011-12-07 07:04:54 +04:00
2013-09-18 08:27:03 +04:00
tests/bin/ctdb_functest : tests /src /ctdb_functest .o $( CTDB_TEST_OBJ )
2011-12-07 07:04:54 +04:00
@echo Linking $@
2013-09-18 08:27:03 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ $^ $( POPT_OBJ) $( LIB_FLAGS)
2011-12-07 07:04:54 +04:00
2013-09-18 08:27:03 +04:00
tests/src/ctdb_test.o : tests /src /ctdb_test .c $( CTDB_TEST_C )
2011-12-15 04:26:57 +04:00
2013-09-18 08:27:03 +04:00
tests/bin/ctdb_stubtest : tests /src /ctdb_test .o $( CTDB_TEST_OBJ )
2011-12-15 04:26:57 +04:00
@echo Linking $@
2013-09-18 08:27:03 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ $^ $( POPT_OBJ) $( LIB_FLAGS)
2011-12-15 04:26:57 +04:00
2013-08-22 11:59:31 +04:00
tests/bin/ctdb_lock_tdb : tests /src /ctdb_lock_tdb .o $( CTDB_CLIENT_OBJ )
2012-12-04 11:27:10 +04:00
@echo Linking $@
$( WRAPPER) $( CC) $( CFLAGS) -o $@ $^ $( LIB_FLAGS)
2009-01-09 10:15:06 +03:00
tests/bin/ibwrapper_test : $( CTDB_CLIENT_OBJ ) ib /ibwrapper_test .o
2006-12-15 18:02:45 +03:00
@echo Linking $@
2013-06-07 05:24:17 +04:00
$( WRAPPER) $( CC) $( CFLAGS) -o $@ ib/ibwrapper_test.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2006-12-15 18:02:45 +03:00
2012-10-17 03:09:26 +04:00
manpages :
$( MAKE) -C doc
2007-06-10 04:45:52 +04:00
2006-11-18 02:41:20 +03:00
clean :
2010-05-20 10:27:40 +04:00
rm -f *.o */*.o */*.a */*/*.o */*~
2007-08-22 11:16:01 +04:00
rm -f utils/smnotify/gen_xdr.c
2007-06-02 07:16:11 +04:00
rm -f $( BINS) $( SBINS) $( TEST_BINS)
2006-11-18 02:41:20 +03:00
distclean : clean
rm -f *~ */*~
2006-12-15 18:02:45 +03:00
rm -rf bin
2006-12-18 17:58:29 +03:00
rm -f config.log config.status config.cache config.h
2006-11-18 02:41:20 +03:00
rm -f Makefile
2012-10-17 03:09:26 +04:00
install : all manpages $( PMDA_INSTALL )
2009-04-08 03:21:11 +04:00
mkdir -p $( DESTDIR) $( libdir) /pkgconfig
2007-05-28 00:48:18 +04:00
mkdir -p $( DESTDIR) $( bindir)
2007-06-01 17:25:33 +04:00
mkdir -p $( DESTDIR) $( sbindir)
2007-05-28 00:48:18 +04:00
mkdir -p $( DESTDIR) $( includedir)
2007-06-01 15:10:49 +04:00
mkdir -p $( DESTDIR) $( etcdir) /ctdb
mkdir -p $( DESTDIR) $( etcdir) /ctdb/events.d
2013-04-23 06:17:31 +04:00
mkdir -p $( DESTDIR) $( etcdir) /ctdb/nfs-rpc-checks.d
2013-05-08 10:45:09 +04:00
mkdir -p $( DESTDIR) $( etcdir) /sudoers.d/
2013-05-17 10:42:25 +04:00
mkdir -p $( DESTDIR) $( etcdir) /ctdb/notify.d
2013-10-23 08:37:41 +04:00
mkdir -p $( DESTDIR) $( localstatedir) /lib/ctdb
mkdir -p $( DESTDIR) $( localstatedir) /run/ctdb
mkdir -p $( DESTDIR) $( logdir)
2009-04-08 03:21:11 +04:00
${ INSTALLCMD } -m 644 ctdb.pc $( DESTDIR) $( libdir) /pkgconfig
2007-06-26 01:40:37 +04:00
${ INSTALLCMD } -m 755 bin/ctdb $( DESTDIR) $( bindir)
${ INSTALLCMD } -m 755 bin/ctdbd $( DESTDIR) $( sbindir)
2007-08-04 04:15:07 +04:00
${ INSTALLCMD } -m 755 bin/smnotify $( DESTDIR) $( bindir)
2009-04-29 19:57:43 +04:00
$( INSTALLCMD) -m 755 bin/ping_pong $( DESTDIR) $( bindir)
2011-05-04 15:44:59 +04:00
$( INSTALLCMD) -m 755 bin/ltdbtool $( DESTDIR) $( bindir)
2013-04-22 09:36:27 +04:00
$( INSTALLCMD) -m 755 bin/ctdb_lock_helper $( DESTDIR) $( bindir)
2010-05-20 10:27:40 +04:00
${ INSTALLCMD } -m 644 include/ctdb.h $( DESTDIR) $( includedir)
2010-05-20 09:48:30 +04:00
${ INSTALLCMD } -m 644 include/ctdb_client.h $( DESTDIR) $( includedir)
${ INSTALLCMD } -m 644 include/ctdb_protocol.h $( DESTDIR) $( includedir)
2007-06-26 01:40:37 +04:00
${ INSTALLCMD } -m 644 include/ctdb_private.h $( DESTDIR) $( includedir) # for samba3
2010-06-02 03:18:48 +04:00
${ INSTALLCMD } -m 644 include/ctdb_typesafe_cb.h $( DESTDIR) $( includedir)
2013-04-03 07:44:08 +04:00
${ INSTALLCMD } -m 440 config/ctdb.sudoers $( DESTDIR) $( etcdir) /sudoers.d/ctdb
2008-07-09 04:24:19 +04:00
${ INSTALLCMD } -m 644 config/functions $( DESTDIR) $( etcdir) /ctdb
2007-06-26 01:40:37 +04:00
${ INSTALLCMD } -m 755 config/statd-callout $( DESTDIR) $( etcdir) /ctdb
2013-07-09 09:22:07 +04:00
${ INSTALLCMD } -m 755 config/ctdbd_wrapper $( DESTDIR) $( sbindir)
2007-08-15 09:01:31 +04:00
${ INSTALLCMD } -m 755 config/events.d/00.ctdb $( DESTDIR) $( etcdir) /ctdb/events.d
2009-09-28 08:06:40 +04:00
${ INSTALLCMD } -m 755 config/events.d/01.reclock $( DESTDIR) $( etcdir) /ctdb/events.d
2007-06-26 01:40:37 +04:00
${ INSTALLCMD } -m 755 config/events.d/10.interface $( DESTDIR) $( etcdir) /ctdb/events.d
2009-03-31 13:00:00 +04:00
${ INSTALLCMD } -m 755 config/events.d/11.natgw $( DESTDIR) $( etcdir) /ctdb/events.d
2009-06-23 05:29:26 +04:00
${ INSTALLCMD } -m 755 config/events.d/11.routing $( DESTDIR) $( etcdir) /ctdb/events.d
2009-12-19 20:26:01 +03:00
${ INSTALLCMD } -m 755 config/events.d/13.per_ip_routing $( DESTDIR) $( etcdir) /ctdb/events.d
2009-10-26 02:22:00 +03:00
${ INSTALLCMD } -m 644 config/events.d/20.multipathd $( DESTDIR) $( etcdir) /ctdb/events.d
2009-05-25 06:02:36 +04:00
${ INSTALLCMD } -m 644 config/events.d/31.clamd $( DESTDIR) $( etcdir) /ctdb/events.d
2007-06-26 01:40:37 +04:00
${ INSTALLCMD } -m 755 config/events.d/40.vsftpd $( DESTDIR) $( etcdir) /ctdb/events.d
2011-08-11 04:00:53 +04:00
${ INSTALLCMD } -m 644 config/events.d/40.fs_use $( DESTDIR) $( etcdir) /ctdb/events.d
2008-01-11 02:44:16 +03:00
${ INSTALLCMD } -m 755 config/events.d/41.httpd $( DESTDIR) $( etcdir) /ctdb/events.d
2012-08-16 08:41:11 +04:00
${ INSTALLCMD } -m 755 config/events.d/49.winbind $( DESTDIR) $( etcdir) /ctdb/events.d
2007-06-26 01:40:37 +04:00
${ INSTALLCMD } -m 755 config/events.d/50.samba $( DESTDIR) $( etcdir) /ctdb/events.d
${ INSTALLCMD } -m 755 config/events.d/60.nfs $( DESTDIR) $( etcdir) /ctdb/events.d
2012-05-17 05:16:57 +04:00
${ INSTALLCMD } -m 755 config/events.d/60.ganesha $( DESTDIR) $( etcdir) /ctdb/events.d
2010-05-04 07:56:55 +04:00
${ INSTALLCMD } -m 755 config/events.d/62.cnfs $( DESTDIR) $( etcdir) /ctdb/events.d
2008-02-06 06:00:04 +03:00
${ INSTALLCMD } -m 755 config/events.d/70.iscsi $( DESTDIR) $( etcdir) /ctdb/events.d
2008-01-09 00:50:03 +03:00
${ INSTALLCMD } -m 755 config/events.d/91.lvs $( DESTDIR) $( etcdir) /ctdb/events.d
2013-08-15 22:23:57 +04:00
${ INSTALLCMD } -m 644 config/events.d/99.timeout $( DESTDIR) $( etcdir) /ctdb/events.d
2013-04-23 06:17:31 +04:00
${ INSTALLCMD } -m 644 config/nfs-rpc-checks.d/10.statd.check $( DESTDIR) $( etcdir) /ctdb/nfs-rpc-checks.d/
${ INSTALLCMD } -m 644 config/nfs-rpc-checks.d/20.nfsd.check $( DESTDIR) $( etcdir) /ctdb/nfs-rpc-checks.d/
${ INSTALLCMD } -m 644 config/nfs-rpc-checks.d/30.lockd.check $( DESTDIR) $( etcdir) /ctdb/nfs-rpc-checks.d/
${ INSTALLCMD } -m 644 config/nfs-rpc-checks.d/40.mountd.check $( DESTDIR) $( etcdir) /ctdb/nfs-rpc-checks.d/
${ INSTALLCMD } -m 644 config/nfs-rpc-checks.d/50.rquotad.check $( DESTDIR) $( etcdir) /ctdb/nfs-rpc-checks.d/
2007-09-05 08:20:34 +04:00
${ INSTALLCMD } -m 755 tools/ctdb_diagnostics $( DESTDIR) $( bindir)
2008-07-09 08:23:02 +04:00
${ INSTALLCMD } -m 755 tools/onnode $( DESTDIR) $( bindir)
2007-06-09 09:21:30 +04:00
if [ -f doc/ctdb.1 ] ; then ${ INSTALLCMD } -d $( DESTDIR) $( mandir) /man1; fi
if [ -f doc/ctdb.1 ] ; then ${ INSTALLCMD } -m 644 doc/ctdb.1 $( DESTDIR) $( mandir) /man1; fi
2007-06-10 04:45:52 +04:00
if [ -f doc/ctdbd.1 ] ; then ${ INSTALLCMD } -m 644 doc/ctdbd.1 $( DESTDIR) $( mandir) /man1; fi
2007-06-12 07:44:01 +04:00
if [ -f doc/onnode.1 ] ; then ${ INSTALLCMD } -m 644 doc/onnode.1 $( DESTDIR) $( mandir) /man1; fi
2011-05-04 16:25:48 +04:00
if [ -f doc/ltdbtool.1 ] ; then ${ INSTALLCMD } -m 644 doc/ltdbtool.1 $( DESTDIR) $( mandir) /man1; fi
2011-03-26 13:55:30 +03:00
if [ -f doc/ping_pong.1 ] ; then ${ INSTALLCMD } -m 644 doc/ping_pong.1 $( DESTDIR) $( mandir) /man1; fi
2013-07-16 06:52:00 +04:00
${ INSTALLCMD } -m 755 config/notify.sh $( DESTDIR) $( etcdir) /ctdb
2012-05-17 04:17:51 +04:00
${ INSTALLCMD } -m 755 config/debug-hung-script.sh $( DESTDIR) $( etcdir) /ctdb
2013-07-16 06:52:00 +04:00
${ INSTALLCMD } -m 755 config/ctdb-crash-cleanup.sh $( DESTDIR) $( etcdir) /ctdb
${ INSTALLCMD } -m 755 config/gcore_trace.sh $( DESTDIR) $( etcdir) /ctdb
2013-07-16 06:53:16 +04:00
${ INSTALLCMD } -m 755 config/debug_locks.sh $( DESTDIR) $( etcdir) /ctdb
2007-04-27 19:24:10 +04:00
2011-07-13 20:11:23 +04:00
install_pmda :
2013-05-28 08:16:25 +04:00
$( INSTALLCMD) -m 755 -d $( DESTDIR) $( PMDA_DEST_DIR)
$( INSTALLCMD) -m 755 utils/pmda/Install utils/pmda/Remove $( DESTDIR) $( PMDA_DEST_DIR)
$( INSTALLCMD) -m 644 utils/pmda/pmns utils/pmda/domain.h utils/pmda/help utils/pmda/README $( DESTDIR) $( PMDA_DEST_DIR)
$( INSTALLCMD) -m 755 bin/pmdactdb $( DESTDIR) $( PMDA_DEST_DIR)
2011-07-13 20:11:23 +04:00
2012-04-24 10:28:15 +04:00
# Should use $(datarootdir) but older autoconfs don't do this. :-(
install_tests : all
tests/INSTALL --destdir= $( DESTDIR) --datarootdir= $( prefix) /share --libdir= $( libdir) --bindir= $( bindir) --etcdir= $( etcdir)
2013-11-14 13:34:50 +04:00
autotest : all
tests/run_tests.sh -e -S -C
2007-05-01 00:34:55 +04:00
test : all
2012-05-14 06:47:02 +04:00
tests/run_tests.sh -V tests/var
2007-04-28 12:57:58 +04:00
2012-03-21 04:51:56 +04:00
test_cluster : all
tests/run_cluster_tests.sh
2007-05-01 00:34:55 +04:00
valgrindtest : all
2007-04-28 12:57:58 +04:00
VALGRIND = "valgrind -q --trace-children=yes" tests/run_tests.sh
2012-01-11 12:04:39 +04:00
ctags :
find . -name "*.[ch]" | xargs ctags
etags :
find . -name "*.[ch]" | xargs etags
2007-04-27 19:24:10 +04:00
2006-11-18 02:41:20 +03:00
realdistclean : distclean
2009-04-08 03:21:11 +04:00
rm -f configure config.h.in ctdb.pc