2006-11-18 02:41:20 +03:00
#!gmake
2007-07-14 04:58:51 +04:00
2006-11-18 02:41:20 +03:00
CC = @CC@
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
includedir = @includedir@
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@
2007-05-02 23:21:14 +04:00
VPATH = @srcdir@:@tdbdir@:@tallocdir@:@libreplacedir@:@poptdir@
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@
2007-10-15 08:44:06 +04:00
IPQ_LIBS = @IPQ_LIBS@
2007-05-02 01:32:04 +04:00
CFLAGS = -g -I$( srcdir) /include -Iinclude -Ilib -Ilib/util -I$( srcdir) \
2006-11-18 02:41:20 +03:00
-I@tallocdir@ -I@tdbdir@/include -I@libreplacedir@ \
2007-06-07 16:16:48 +04:00
-DVARDIR= \" $( localstatedir) \" -DETCDIR= \" $( etcdir) \" \
-DUSE_MMAP= 1 @CFLAGS@ $( POPT_CFLAGS)
2006-11-18 02:41:20 +03:00
2007-07-14 09:16:52 +04:00
LIB_FLAGS = @LDFLAGS@ -Llib @LIBS@ $( POPT_LIBS) @INFINIBAND_LIBS@ @CTDB_PCAP_LDFLAGS@
2006-11-18 02:41:20 +03: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 \
lib/util/util_time.o lib/util/util_file.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 \
2007-08-08 02:25:20 +04:00
lib/util/debug.o common/rb_tree.o @CTDB_SYSTEM_OBJ@
2007-05-25 11:04:13 +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
2007-06-07 16:06:19 +04:00
CTDB_CLIENT_OBJ = client/ctdb_client.o \
2007-06-07 16:16:48 +04:00
$( CTDB_COMMON_OBJ) $( POPT_OBJ) $( UTIL_OBJ) @TALLOC_OBJ@ @TDB_OBJ@ \
@LIBREPLACEOBJ@ $( EXTRA_OBJ) @EVENTS_OBJ@
2007-06-07 16:06:19 +04:00
2007-06-07 16:16:48 +04:00
CTDB_SERVER_OBJ = server/ctdbd.o server/ctdb_daemon.o server/ctdb_lockwait.o \
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 \
2008-01-17 03:33:23 +03:00
server/ctdb_keepalive.o server/ctdb_logging.o server/ctdb_uptime.c \
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
2008-01-04 01:19:06 +03:00
TEST_BINS = bin/ctdb_bench bin/ctdb_fetch bin/ctdb_store bin/ctdb_randrec bin/ctdb_persistent bin/rb_test \
2007-08-08 05:21:18 +04:00
@INFINIBAND_BINS@
2007-10-15 08:37:54 +04:00
BINS = bin/ctdb @CTDB_SCSI_IO@ bin/ctdb_ipmux bin/smnotify
2007-05-29 09:52:03 +04:00
SBINS = bin/ctdbd
2006-11-18 02:41:20 +03:00
DIRS = lib bin
2007-06-12 07:44:01 +04:00
.SUFFIXES : .c .o .h .1 .1.xml .1.html
2007-06-09 09:21:30 +04:00
all : showflags dirs doc $( 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)'
@echo ' LIBS = $(LIBS)'
.c.o :
@echo Compiling $* .c
@mkdir -p ` dirname $@ `
@$( CC) $( CFLAGS) -c $< -o $@
dirs :
@mkdir -p $( DIRS)
2007-06-07 16:06:19 +04:00
bin/ctdbd : $( CTDB_SERVER_OBJ )
2007-04-11 12:54:22 +04:00
@echo Linking $@
2007-06-07 16:06:19 +04:00
@$( 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 $@
2007-08-07 03:03:51 +04:00
@$( CC) $( CFLAGS) -o $@ utils/scsi_io/scsi_io.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2007-07-02 10:13:31 +04:00
2007-10-08 08:05:22 +04:00
bin/ctdb_ipmux : $( CTDB_CLIENT_OBJ ) utils /ipmux /ipmux .o
@echo Linking $@
2007-10-15 08:44:06 +04:00
@$( CC) $( CFLAGS) -o $@ utils/ipmux/ipmux.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS) $( IPQ_LIBS)
2007-10-08 08:05:22 +04:00
2008-01-08 09:23:27 +03:00
bin/ctdb : $( CTDB_CLIENT_OBJ ) tools /ctdb .o tools /ctdb_vacuum .o
2007-04-26 16:27:49 +04:00
@echo Linking $@
2008-01-08 09:23:27 +03:00
@$( CC) $( CFLAGS) -o $@ tools/ctdb.o tools/ctdb_vacuum.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2007-04-26 16:27:49 +04:00
2007-08-03 04:47:37 +04:00
bin/smnotify : utils /smnotify /gen_xdr .o utils /smnotify /gen_smnotify .o utils /smnotify /smnotify .o
2007-08-03 04:18:48 +04:00
@echo Linking $@
2007-08-15 01:59:01 +04:00
@$( 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
utils/smnotify/smnotify.h : utils /smnotify /smnotify .x
@echo Generating $@
2007-08-15 01:59:01 +04:00
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 $@
2007-08-15 01:59:01 +04:00
rpcgen -c utils/smnotify/smnotify.x > 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 $@
2007-08-15 01:59:01 +04:00
rpcgen -l utils/smnotify/smnotify.x > utils/smnotify/gen_smnotify.c
2007-08-03 04:18:48 +04:00
2007-08-08 05:21:18 +04:00
bin/rb_test : $( CTDB_CLIENT_OBJ ) tests /rb_test .o
@echo Linking $@
@$( CC) $( CFLAGS) -o $@ tests/rb_test.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2007-06-07 16:06:19 +04:00
bin/ctdb_bench : $( CTDB_CLIENT_OBJ ) tests /ctdb_bench .o
2006-12-19 08:27:03 +03:00
@echo Linking $@
2007-06-07 16:06:19 +04:00
@$( CC) $( CFLAGS) -o $@ tests/ctdb_bench.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2006-12-19 08:27:03 +03:00
2007-06-07 16:06:19 +04:00
bin/ctdb_fetch : $( CTDB_CLIENT_OBJ ) tests /ctdb_fetch .o
2007-04-05 07:18:31 +04:00
@echo Linking $@
2007-06-07 16:06:19 +04:00
@$( CC) $( CFLAGS) -o $@ tests/ctdb_fetch.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2007-04-05 07:18:31 +04:00
2007-06-17 05:13:42 +04:00
bin/ctdb_store : $( CTDB_CLIENT_OBJ ) tests /ctdb_store .o
@echo Linking $@
@$( CC) $( CFLAGS) -o $@ tests/ctdb_store.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2008-01-04 01:19:06 +03:00
bin/ctdb_randrec : $( CTDB_CLIENT_OBJ ) tests /ctdb_randrec .o
@echo Linking $@
@$( CC) $( CFLAGS) -o $@ tests/ctdb_randrec.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2007-09-21 06:24:02 +04:00
bin/ctdb_persistent : $( CTDB_CLIENT_OBJ ) tests /ctdb_persistent .o
@echo Linking $@
@$( CC) $( CFLAGS) -o $@ tests/ctdb_persistent.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2007-06-07 16:06:19 +04:00
bin/ibwrapper_test : $( CTDB_CLIENT_OBJ ) ib /ibwrapper_test .o
2006-12-15 18:02:45 +03:00
@echo Linking $@
2007-06-07 16:06:19 +04:00
@$( CC) $( CFLAGS) -o $@ ib/ibwrapper_test.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2006-12-15 18:02:45 +03:00
2007-06-12 07:44:01 +04:00
.1.xml.1 :
-test -z " $( XSLTPROC) " || $( XSLTPROC) -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
2007-06-09 02:41:36 +04:00
2007-06-12 07:44:01 +04:00
.1.xml.1.html :
-test -z " $( XSLTPROC) " || $( XSLTPROC) -o $@ http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $<
2007-06-10 04:45:52 +04:00
2007-06-12 07:44:01 +04:00
doc : doc /ctdb .1 doc /ctdb .1.html \
doc/ctdbd.1 doc/ctdbd.1.html \
doc/onnode.1 doc/onnode.1.html
2007-06-10 04:45:52 +04:00
2006-11-18 02:41:20 +03:00
clean :
2007-06-07 16:16:48 +04:00
rm -f *.o */*.o */*/*.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
2007-04-28 12:57:58 +04:00
install : all
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
2007-06-26 01:40:37 +04:00
${ INSTALLCMD } -m 755 bin/ctdb $( DESTDIR) $( bindir)
2007-10-08 08:05:22 +04:00
${ INSTALLCMD } -m 755 bin/ctdb_ipmux $( DESTDIR) $( bindir)
2007-06-26 01:40:37 +04:00
${ INSTALLCMD } -m 755 bin/ctdbd $( DESTDIR) $( sbindir)
2007-08-04 04:15:07 +04:00
${ INSTALLCMD } -m 755 bin/smnotify $( DESTDIR) $( bindir)
2007-06-26 01:40:37 +04:00
${ INSTALLCMD } -m 644 include/ctdb.h $( DESTDIR) $( includedir)
${ INSTALLCMD } -m 644 include/ctdb_private.h $( DESTDIR) $( includedir) # for samba3
${ INSTALLCMD } -m 755 config/functions $( DESTDIR) $( etcdir) /ctdb
${ INSTALLCMD } -m 755 config/statd-callout $( DESTDIR) $( etcdir) /ctdb
2007-08-15 05:36:01 +04:00
${ INSTALLCMD } -m 755 config/events.d/README $( DESTDIR) $( etcdir) /ctdb/events.d
2007-08-15 09:01:31 +04:00
${ INSTALLCMD } -m 755 config/events.d/00.ctdb $( 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
${ INSTALLCMD } -m 755 config/events.d/40.vsftpd $( 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
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
2007-07-06 04:54:42 +04:00
${ INSTALLCMD } -m 755 config/events.d/61.nfstickle $( DESTDIR) $( etcdir) /ctdb/events.d
2007-10-08 08:05:22 +04:00
${ INSTALLCMD } -m 755 config/events.d/90.ipmux $( 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
2007-09-05 08:20:34 +04:00
${ INSTALLCMD } -m 755 tools/ctdb_diagnostics $( DESTDIR) $( bindir)
2007-06-26 01:40:37 +04:00
${ INSTALLCMD } -m 755 tools/onnode.ssh $( DESTDIR) $( bindir)
${ INSTALLCMD } -m 755 tools/onnode.rsh $( 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
2007-06-01 15:20:05 +04:00
cd $( DESTDIR) $( bindir) && ln -sf onnode.ssh onnode
2007-04-27 19:24:10 +04:00
2007-05-01 00:34:55 +04:00
test : all
2007-04-28 12:57:58 +04:00
tests/run_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
2007-04-27 19:24:10 +04:00
2006-11-18 02:41:20 +03:00
realdistclean : distclean
2006-12-18 17:58:29 +03:00
rm -f configure config.h.in