2006-11-18 10:41:20 +11:00
#!gmake
#
CC = @CC@
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
includedir = @includedir@
libdir = @libdir@
bindir = @bindir@
2007-04-29 22:42:23 +02:00
localstatedir = @localstatedir@
2007-05-03 05:21:14 +10:00
VPATH = @srcdir@:@tdbdir@:@tallocdir@:@libreplacedir@:@poptdir@
2006-11-18 10:41:20 +11:00
srcdir = @srcdir@
builddir = @builddir@
EXTRA_OBJ = @EXTRA_OBJ@
2007-05-03 05:21:14 +10:00
POPT_LIBS = @POPT_LIBS@
POPT_CFLAGS = @POPT_CFLAGS@
POPT_OBJ = @POPT_OBJ@
2007-05-02 07:32:04 +10:00
CFLAGS = -g -I$( srcdir) /include -Iinclude -Ilib -Ilib/util -I$( srcdir) \
2006-11-18 10:41:20 +11:00
-I@tallocdir@ -I@tdbdir@/include -I@libreplacedir@ \
2007-05-03 05:21:14 +10:00
-DVARDIR= \" $( localstatedir) \" -DUSE_MMAP= 1 @CFLAGS@ $( POPT_CFLAGS)
2006-11-18 10:41:20 +11:00
2007-05-03 05:21:14 +10:00
LIB_FLAGS = @LDFLAGS@ -Llib @LIBS@ $( POPT_LIBS) @INFINIBAND_LIBS@
2006-11-18 10:41:20 +11:00
2007-05-02 07:32:04 +10:00
UTIL_OBJ = lib/util/idtree.o lib/util/db_wrap.o lib/util/strlist.o lib/util/util.o
2006-11-18 10:41:20 +11:00
2007-04-26 14:27:49 +02:00
CTDB_COMMON_OBJ = common/ctdb.o common/ctdb_daemon.o common/ctdb_client.o \
common/ctdb_io.o common/util.o common/ctdb_util.o \
common/ctdb_call.o common/ctdb_ltdb.o common/ctdb_lockwait.o \
common/ctdb_message.o common/cmdline.o common/ctdb_control.o \
2007-05-15 15:13:36 +10:00
lib/util/debug.o common/ctdb_recover.o common/ctdb_recoverd.o \
2007-05-18 19:19:35 +10:00
common/ctdb_freeze.o common/ctdb_traverse.o common/ctdb_monitor.o
2006-11-27 21:38:13 +11:00
2007-05-25 17:04:13 +10:00
CTDB_TAKEOVER_OBJ = takeover/system.o takeover/ctdb_takeover.o
2006-11-28 11:51:33 +11:00
CTDB_TCP_OBJ = tcp/tcp_connect.o tcp/tcp_io.o tcp/tcp_init.o
2006-11-27 21:38:13 +11:00
2007-05-25 17:04:13 +10:00
CTDB_OBJ = $( CTDB_COMMON_OBJ) $( CTDB_TAKEOVER_OBJ) $( CTDB_TCP_OBJ) $( POPT_OBJ)
2006-11-18 10:41:20 +11:00
2007-05-05 17:18:06 +10:00
OBJS = @TDB_OBJ@ @TALLOC_OBJ@ @LIBREPLACEOBJ@ @INFINIBAND_WRAPPER_OBJ@ $( EXTRA_OBJ) @EVENTS_OBJ@ $( CTDB_OBJ) $( UTIL_OBJ)
2006-11-18 10:41:20 +11:00
2007-05-19 14:07:01 +10:00
BINS = bin/ctdbd bin/ctdbd_test bin/ctdb_test bin/ctdb_bench bin/ctdb_messaging bin/ctdb_fetch bin/ctdb_fetch1 bin/lockwait bin/ctdb_control @INFINIBAND_BINS@
2006-11-18 10:41:20 +11:00
DIRS = lib bin
all : showflags dirs $( OBJS ) $( BINS )
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-04-17 22:16:50 +10:00
bin/ctdb_test : $( OBJS ) tests /ctdb_test .o
2006-11-18 10:41:20 +11:00
@echo Linking $@
2007-04-17 22:16:50 +10:00
@$( CC) $( CFLAGS) -o $@ tests/ctdb_test.o $( OBJS) $( LIB_FLAGS)
2006-11-18 10:41:20 +11:00
2007-04-17 22:16:50 +10:00
bin/ctdbd : $( OBJS ) direct /ctdbd .o
2007-04-11 18:54:22 +10:00
@echo Linking $@
2007-04-17 22:16:50 +10:00
@$( CC) $( CFLAGS) -o $@ direct/ctdbd.o $( OBJS) $( LIB_FLAGS)
2007-04-11 18:54:22 +10:00
2007-04-26 14:27:49 +02:00
bin/ctdb_control : $( OBJS ) tools /ctdb_control .o
@echo Linking $@
@$( CC) $( CFLAGS) -o $@ tools/ctdb_control.o $( OBJS) $( LIB_FLAGS)
2007-04-11 18:54:22 +10:00
bin/ctdbd_test : $( OBJS ) direct /ctdbd_test .o
@echo Linking $@
@$( CC) $( CFLAGS) -o $@ direct/ctdbd_test.o
2007-04-17 22:16:50 +10:00
bin/ctdb_bench : $( OBJS ) tests /ctdb_bench .o
2006-12-19 16:27:03 +11:00
@echo Linking $@
2007-04-17 22:16:50 +10:00
@$( CC) $( CFLAGS) -o $@ tests/ctdb_bench.o $( OBJS) $( LIB_FLAGS)
2006-12-19 16:27:03 +11:00
2007-04-17 22:16:50 +10:00
bin/ctdb_fetch : $( OBJS ) tests /ctdb_fetch .o
2007-04-05 13:18:31 +10:00
@echo Linking $@
2007-04-17 22:16:50 +10:00
@$( CC) $( CFLAGS) -o $@ tests/ctdb_fetch.o $( OBJS) $( LIB_FLAGS)
2007-04-05 13:18:31 +10:00
2007-04-17 22:16:50 +10:00
bin/ctdb_fetch1 : $( OBJS ) tests /ctdb_fetch 1.o
2007-04-12 21:17:10 +10:00
@echo Linking $@
2007-04-17 22:16:50 +10:00
@$( CC) $( CFLAGS) -o $@ tests/ctdb_fetch1.o $( OBJS) $( LIB_FLAGS)
2007-04-12 21:17:10 +10:00
2007-04-17 22:16:50 +10:00
bin/ctdb_messaging : $( OBJS ) tests /ctdb_messaging .o
2007-04-11 13:43:15 +10:00
@echo Linking $@
2007-04-17 22:16:50 +10:00
@$( CC) $( CFLAGS) -o $@ tests/ctdb_messaging.o $( OBJS) $( LIB_FLAGS)
2007-04-11 13:43:15 +10:00
2007-02-12 16:47:12 +01:00
bin/ibwrapper_test : $( OBJS ) ib /ibwrapper_test .o
2006-12-15 16:02:45 +01:00
@echo Linking $@
2007-02-12 16:47:12 +01:00
@$( CC) $( CFLAGS) -o $@ ib/ibwrapper_test.o $( OBJS) $( LIB_FLAGS)
2006-12-15 16:02:45 +01:00
2007-04-17 22:16:50 +10:00
bin/lockwait : $( OBJS ) tests /lockwait .o
2007-04-16 16:01:37 +10:00
@echo Linking $@
2007-04-17 22:16:50 +10:00
@$( CC) $( CFLAGS) -o $@ tests/lockwait.o $( OBJS) $( LIB_FLAGS)
2007-04-16 16:01:37 +10:00
2006-11-18 10:41:20 +11:00
clean :
2006-12-15 16:02:45 +01:00
rm -f *.o */*.o */*/*.o
2006-11-18 10:41:20 +11:00
rm -f $( BINS)
distclean : clean
rm -f *~ */*~
2006-12-15 16:02:45 +01: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 10:41:20 +11:00
rm -f Makefile
2007-04-28 10:57:58 +02:00
install : all
2007-04-27 17:24:10 +02:00
mkdir -p $( bindir)
mkdir -p $( includedir)
2007-04-28 17:13:02 +02:00
rsync $( BINS) $( bindir)
rsync $( srcdir) /include/ctdb.h $( includedir)
2007-04-27 17:24:10 +02:00
2007-05-01 06:34:55 +10:00
test : all
2007-04-28 10:57:58 +02:00
tests/run_tests.sh
2007-05-01 06:34:55 +10:00
valgrindtest : all
2007-04-28 10:57:58 +02:00
VALGRIND = "valgrind -q --trace-children=yes" tests/run_tests.sh
2007-04-27 17:24:10 +02:00
2006-11-18 10:41:20 +11:00
realdistclean : distclean
2006-12-18 17:58:29 +03:00
rm -f configure config.h.in