diff --git a/lib/tdb/config.mk b/lib/tdb/config.mk
index b2e322c..fa8d629 100644
--- a/lib/tdb/config.mk
+++ b/lib/tdb/config.mk
@@ -35,6 +35,15 @@ PRIVATE_DEPENDENCIES = \
 tdbtorture_OBJ_FILES = $(tdbsrcdir)/tools/tdbtorture.o
 
 ################################################
+# Start BINARY tdbundump
+[BINARY::tdbundump]
+INSTALLDIR = BINDIR
+PRIVATE_DEPENDENCIES = \
+		LIBTDB
+# End BINARY tdbundump
+################################################
+
+################################################
 # Start BINARY tdbdump
 [BINARY::tdbdump]
 INSTALLDIR = BINDIR
diff --git a/lib/tdb/tdb.mk b/lib/tdb/tdb.mk
index 0dcd419..d14ead4 100644
--- a/lib/tdb/tdb.mk
+++ b/lib/tdb/tdb.mk
@@ -1,7 +1,7 @@
 dirs::
 	@mkdir -p bin common tools
 
-PROGS = bin/tdbtool$(EXEEXT) bin/tdbdump$(EXEEXT) bin/tdbbackup$(EXEEXT)
+PROGS = bin/tdbtool$(EXEEXT) bin/tdbundump$(EXEEXT) bin/tdbdump$(EXEEXT) bin/tdbbackup$(EXEEXT)
 PROGS_NOINSTALL = bin/tdbtest$(EXEEXT) bin/tdbtorture$(EXEEXT)
 ALL_PROGS = $(PROGS) $(PROGS_NOINSTALL)
 
@@ -23,6 +23,9 @@ bin/tdbtorture$(EXEEXT): tools/tdbtorture.o $(TDB_LIB)
 bin/tdbdump$(EXEEXT): tools/tdbdump.o $(TDB_LIB)
 	$(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbdump tools/tdbdump.o -L. -ltdb $(TDB_DEPS)
 
+bin/tdbundump$(EXEEXT): tools/tdbundump.o $(TDB_LIB)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbundump tools/tdbundump.o -L. -ltdb $(TDB_DEPS)
+
 bin/tdbbackup$(EXEEXT): tools/tdbbackup.o $(TDB_LIB)
 	$(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbbackup tools/tdbbackup.o -L. -ltdb $(TDB_DEPS)
 
@@ -53,7 +56,7 @@ tdb.$(SHLIBEXT): libtdb.$(SHLIBEXT) pytdb.o
 install:: installdirs installbin installheaders installlibs \
 		  $(PYTHON_INSTALL_TARGET) installdocs
 
-doc:: manpages/tdbbackup.8 manpages/tdbdump.8 manpages/tdbtool.8
+doc:: manpages/tdbbackup.8 manpages/tdbundump.8 manpages/tdbdump.8 manpages/tdbtool.8
 
 .SUFFIXES: .8.xml .8
 
diff --git a/lib/tdb/wscript b/lib/tdb/wscript
index d661e41..2b6331e 100644
--- a/lib/tdb/wscript
+++ b/lib/tdb/wscript
@@ -75,6 +75,10 @@ def build(bld):
                          'tdb',
                          install=False)
 
+        bld.SAMBA_BINARY('tdbundump',
+                         'tools/tdbundump.c',
+                         'tdb', manpages='manpages/tdbundump.8')
+
         bld.SAMBA_BINARY('tdbdump',
                          'tools/tdbdump.c',
                          'tdb', manpages='manpages/tdbdump.8')
