From 9a883a6336e65c0f0df8507f88779fc2a895f880 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 22 Aug 2006 01:45:39 +0000 Subject: r17680: make standalone tdb support building and testing in a different directory to source (This used to be commit a81a3874e1a40131cbba22d14d7b68fd0f5b54c5) --- source4/lib/tdb/Makefile.in | 19 ++++++++++++++----- source4/lib/tdb/configure.in | 2 ++ 2 files changed, 16 insertions(+), 5 deletions(-) (limited to 'source4/lib/tdb') diff --git a/source4/lib/tdb/Makefile.in b/source4/lib/tdb/Makefile.in index 1c23aaeea7..849d0bd7c9 100644 --- a/source4/lib/tdb/Makefile.in +++ b/source4/lib/tdb/Makefile.in @@ -2,24 +2,33 @@ # Makefile for tdb directory # -CFLAGS = -Iinclude @CFLAGS@ CC = @CC@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ includedir = @includedir@ libdir = @libdir@ +VPATH = @srcdir@ +srcdir = @srcdir@ +builddir = @builddir@ +CFLAGS = -I$(srcdir)/include @CFLAGS@ PROGS = bin/tdbtool bin/tdbtorture TDB_OBJ = common/tdb.o common/dump.o common/io.o common/lock.o \ common/open.o common/traverse.o common/freelist.o common/error.o \ common/transaction.o -all: $(PROGS) +DIRS = lib bin common tools examples + +all: dirs $(PROGS) .c.o: @echo Compiling $*.c - @$(CC) $(CFLAGS) -c $< -o $@ + @mkdir -p `dirname $@` + $(CC) $(CFLAGS) -c $< -o $@ + +dirs: + @mkdir -p $(DIRS) install: all mkdir -p $(bindir) @@ -27,8 +36,8 @@ install: all mkdir -p $(libdir) mkdir -p $(libdir)/pkgconfig cp $(PROGS) $(bindir) - cp include/tdb.h $(includedir) - cp tdb.pc $(libdir)/pkgconfig + cp $(srcdir)/include/tdb.h $(includedir) + cp $(srcdir)/tdb.pc $(libdir)/pkgconfig bin/tdbtest: tools/tdbtest.o $(TDB_OBJ) $(CC) $(CFLAGS) -o bin/tdbtest tools/tdbtest.o $(TDB_OBJ) -lgdbm diff --git a/source4/lib/tdb/configure.in b/source4/lib/tdb/configure.in index 0a72af20d9..b067940781 100644 --- a/source4/lib/tdb/configure.in +++ b/source4/lib/tdb/configure.in @@ -1,7 +1,9 @@ +AC_PREREQ(2.50) AC_DEFUN([SMB_MODULE_DEFAULT], [echo -n ""]) AC_DEFUN([SMB_LIBRARY_ENABLE], [echo -n ""]) AC_DEFUN([SMB_ENABLE], [echo -n ""]) AC_INIT(include/tdb.h) +AC_CONFIG_SRCDIR([common/tdb.c]) AC_CONFIG_HEADER(include/config.h) AC_PROG_CC AC_SYS_LARGEFILE -- cgit