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@
VPATH = @srcdir@:@tdbdir@:@tallocdir@:@libreplacedir@
srcdir = @srcdir@
builddir = @builddir@
EXTRA_OBJ = @EXTRA_OBJ@
2007-01-25 07:10:40 +03:00
CFLAGS = -g -I$( srcdir) /include -Iinclude -Ilib/util -I$( srcdir) \
2006-11-18 02:41:20 +03:00
-I@tallocdir@ -I@tdbdir@/include -I@libreplacedir@ \
-DLIBDIR= \" $( libdir) \" -DSHLIBEXT= \" @SHLIBEXT@\" -DUSE_MMAP= 1 @CFLAGS@
2006-12-15 18:02:45 +03:00
LIB_FLAGS = @LDFLAGS@ -Llib @LIBS@ -lpopt @INFINIBAND_LIBS@
2006-11-18 02:41:20 +03:00
2006-11-28 12:48:34 +03:00
EVENTS_OBJ = lib/events/events.o lib/events/events_standard.o
2006-11-18 02:41:20 +03:00
2007-04-26 16:27:49 +04: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 \
lib/util/idtree.o lib/util/db_wrap.o lib/util/debug.o
2006-11-27 13:38:13 +03: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
CTDB_OBJ = $( CTDB_COMMON_OBJ) $( CTDB_TCP_OBJ)
2006-11-18 02:41:20 +03:00
2006-12-15 18:02:45 +03:00
OBJS = @TDBOBJ@ @TALLOCOBJ@ @LIBREPLACEOBJ@ @INFINIBAND_WRAPPER_OBJ@ $( EXTRA_OBJ) $( EVENTS_OBJ) $( CTDB_OBJ)
2006-11-18 02:41:20 +03:00
2007-04-26 16:51:41 +04: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 bin/ctdb_dump @INFINIBAND_BINS@
2006-11-18 02:41:20 +03: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 16:16:50 +04:00
bin/ctdb_test : $( OBJS ) tests /ctdb_test .o
2006-11-18 02:41:20 +03:00
@echo Linking $@
2007-04-17 16:16:50 +04:00
@$( CC) $( CFLAGS) -o $@ tests/ctdb_test.o $( OBJS) $( LIB_FLAGS)
2006-11-18 02:41:20 +03:00
2007-04-17 16:16:50 +04:00
bin/ctdbd : $( OBJS ) direct /ctdbd .o
2007-04-11 12:54:22 +04:00
@echo Linking $@
2007-04-17 16:16:50 +04:00
@$( CC) $( CFLAGS) -o $@ direct/ctdbd.o $( OBJS) $( LIB_FLAGS)
2007-04-11 12:54:22 +04:00
2007-04-26 16:27:49 +04:00
bin/ctdb_control : $( OBJS ) tools /ctdb_control .o
@echo Linking $@
@$( CC) $( CFLAGS) -o $@ tools/ctdb_control.o $( OBJS) $( LIB_FLAGS)
2007-04-22 11:24:27 +04:00
bin/ctdb_dump : $( OBJS ) tools /ctdb_dump .o
@echo Linking $@
@$( CC) $( CFLAGS) -o $@ tools/ctdb_dump.o $( OBJS) $( LIB_FLAGS)
2007-04-11 12:54:22 +04:00
bin/ctdbd_test : $( OBJS ) direct /ctdbd_test .o
@echo Linking $@
@$( CC) $( CFLAGS) -o $@ direct/ctdbd_test.o
2007-04-17 16:16:50 +04:00
bin/ctdb_bench : $( OBJS ) tests /ctdb_bench .o
2006-12-19 08:27:03 +03:00
@echo Linking $@
2007-04-17 16:16:50 +04:00
@$( CC) $( CFLAGS) -o $@ tests/ctdb_bench.o $( OBJS) $( LIB_FLAGS)
2006-12-19 08:27:03 +03:00
2007-04-17 16:16:50 +04:00
bin/ctdb_fetch : $( OBJS ) tests /ctdb_fetch .o
2007-04-05 07:18:31 +04:00
@echo Linking $@
2007-04-17 16:16:50 +04:00
@$( CC) $( CFLAGS) -o $@ tests/ctdb_fetch.o $( OBJS) $( LIB_FLAGS)
2007-04-05 07:18:31 +04:00
2007-04-17 16:16:50 +04:00
bin/ctdb_fetch1 : $( OBJS ) tests /ctdb_fetch 1.o
2007-04-12 15:17:10 +04:00
@echo Linking $@
2007-04-17 16:16:50 +04:00
@$( CC) $( CFLAGS) -o $@ tests/ctdb_fetch1.o $( OBJS) $( LIB_FLAGS)
2007-04-12 15:17:10 +04:00
2007-04-17 16:16:50 +04:00
bin/ctdb_messaging : $( OBJS ) tests /ctdb_messaging .o
2007-04-11 07:43:15 +04:00
@echo Linking $@
2007-04-17 16:16:50 +04:00
@$( CC) $( CFLAGS) -o $@ tests/ctdb_messaging.o $( OBJS) $( LIB_FLAGS)
2007-04-11 07:43:15 +04:00
2007-02-12 18:47:12 +03:00
bin/ibwrapper_test : $( OBJS ) ib /ibwrapper_test .o
2006-12-15 18:02:45 +03:00
@echo Linking $@
2007-02-12 18:47:12 +03:00
@$( CC) $( CFLAGS) -o $@ ib/ibwrapper_test.o $( OBJS) $( LIB_FLAGS)
2006-12-15 18:02:45 +03:00
2007-04-17 16:16:50 +04:00
bin/lockwait : $( OBJS ) tests /lockwait .o
2007-04-16 10:01:37 +04:00
@echo Linking $@
2007-04-17 16:16:50 +04:00
@$( CC) $( CFLAGS) -o $@ tests/lockwait.o $( OBJS) $( LIB_FLAGS)
2007-04-16 10:01:37 +04:00
2006-11-18 02:41:20 +03:00
clean :
2006-12-15 18:02:45 +03:00
rm -f *.o */*.o */*/*.o
2006-11-18 02:41:20 +03:00
rm -f $( BINS)
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-04-27 19:24:10 +04:00
mkdir -p $( bindir)
mkdir -p $( includedir)
2007-04-28 19:13:02 +04:00
rsync $( BINS) $( bindir)
rsync $( srcdir) /include/ctdb.h $( includedir)
2007-04-27 19:24:10 +04:00
2007-04-28 12:57:58 +04:00
test :
tests/run_tests.sh
valgrindtest :
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