2006-11-18 02:41:20 +03:00
#!gmake
#
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-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-05-02 23:21:14 +04:00
LIB_FLAGS = @LDFLAGS@ -Llib @LIBS@ $( POPT_LIBS) @INFINIBAND_LIBS@
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 \
lib/util/debug.o
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
CTDB_TAKEOVER_OBJ = takeover/system.o takeover/ctdb_takeover.o
2006-11-18 02:41:20 +03: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-06-07 16:06:19 +04:00
server/ctdb_traverse.o $( CTDB_CLIENT_OBJ) \
$( CTDB_TAKEOVER_OBJ) $( CTDB_TCP_OBJ) @INFINIBAND_WRAPPER_OBJ@
2006-11-18 02:41:20 +03:00
2007-06-17 05:13:42 +04:00
TEST_BINS = bin/ctdb_bench bin/ctdb_fetch bin/ctdb_store @INFINIBAND_BINS@
2007-05-29 09:52:03 +04:00
BINS = bin/ctdb
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-06-07 16:16:48 +04:00
bin/ctdb : $( CLIENT_OBJS ) tools /ctdb .o
2007-04-26 16:27:49 +04:00
@echo Linking $@
2007-06-07 16:16:48 +04:00
@$( CC) $( CFLAGS) -o $@ tools/ctdb.o $( CTDB_CLIENT_OBJ) $( LIB_FLAGS)
2007-04-26 16:27:49 +04:00
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)
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-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-09 09:21:30 +04:00
${ INSTALLCMD } -m755 bin/ctdb $( DESTDIR) $( bindir)
${ INSTALLCMD } -m755 bin/ctdbd $( DESTDIR) $( sbindir)
${ INSTALLCMD } -m644 include/ctdb.h $( DESTDIR) $( includedir)
${ INSTALLCMD } -m644 include/ctdb_private.h $( DESTDIR) $( includedir) # for samba3
${ INSTALLCMD } -m755 config/events $( DESTDIR) $( etcdir) /ctdb
${ INSTALLCMD } -m755 config/functions $( DESTDIR) $( etcdir) /ctdb
${ INSTALLCMD } -m755 config/statd-callout $( DESTDIR) $( etcdir) /ctdb
${ INSTALLCMD } -m755 config/events.d/10.interface $( DESTDIR) $( etcdir) /ctdb/events.d
${ INSTALLCMD } -m755 config/events.d/40.vsftpd $( DESTDIR) $( etcdir) /ctdb/events.d
${ INSTALLCMD } -m755 config/events.d/50.samba $( DESTDIR) $( etcdir) /ctdb/events.d
${ INSTALLCMD } -m755 config/events.d/59.nfslock $( DESTDIR) $( etcdir) /ctdb/events.d
${ INSTALLCMD } -m755 config/events.d/60.nfs $( DESTDIR) $( etcdir) /ctdb/events.d
${ INSTALLCMD } -m755 tools/onnode.ssh $( DESTDIR) $( bindir)
${ INSTALLCMD } -m755 tools/onnode.rsh $( DESTDIR) $( bindir)
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