diff --git a/.gitignore b/.gitignore
index 4e03b23..b1b380f 100644
--- a/.gitignore
+++ b/.gitignore
doc/html
src/bluetoothd.8
src/bluetooth.service
+
+tools/obex-client-tool
+tools/obex-server-tool
+unit/test-gobex
+unit/test-gobex-apparam
+unit/test-gobex-header
+unit/test-gobex-packet
+unit/test-gobex-transfer
diff --git a/Makefile.am b/Makefile.am
index e95ba1a..ae0090b 100644
--- a/Makefile.am
+++ b/Makefile.am
btio_sources = btio/btio.h btio/btio.c
+gobex_sources = gobex/gobex.h gobex/gobex.c \
+ gobex/gobex-defs.h gobex/gobex-defs.c \
+ gobex/gobex-packet.c gobex/gobex-packet.h \
+ gobex/gobex-header.c gobex/gobex-header.h \
+ gobex/gobex-transfer.c gobex/gobex-debug.h \
+ gobex/gobex-apparam.c gobex/gobex-apparam.h
+
builtin_modules =
builtin_sources =
builtin_nodist =
unit_tests =
endif
+unit_tests += unit/test-gobex-header unit/test-gobex-packet unit/test-gobex \
+ unit/test-gobex-transfer unit/test-gobex-apparam
+
+unit_test_gobex_SOURCES = $(gobex_sources) unit/util.c unit/util.h \
+ unit/test-gobex.c
+unit_test_gobex_LDADD = @GLIB_LIBS@
+
+unit_test_gobex_packet_SOURCES = $(gobex_sources) unit/util.c unit/util.h \
+ unit/test-gobex-packet.c
+unit_test_gobex_packet_LDADD = @GLIB_LIBS@
+
+unit_test_gobex_header_SOURCES = $(gobex_sources) unit/util.c unit/util.h \
+ unit/test-gobex-header.c
+unit_test_gobex_header_LDADD = @GLIB_LIBS@
+
+unit_test_gobex_transfer_SOURCES = $(gobex_sources) unit/util.c unit/util.h \
+ unit/test-gobex-transfer.c
+unit_test_gobex_transfer_LDADD = @GLIB_LIBS@
+
+unit_test_gobex_apparam_SOURCES = $(gobex_sources) unit/util.c unit/util.h \
+ unit/test-gobex-apparam.c
+unit_test_gobex_apparam_LDADD = @GLIB_LIBS@
+
+noinst_PROGRAMS += $(unit_tests)
+
TESTS = $(unit_tests)
pkgconfigdir = $(libdir)/pkgconfig
diff --git a/Makefile.tools b/Makefile.tools
index 689b4d2..ef5bd96 100644
--- a/Makefile.tools
+++ b/Makefile.tools
attrib/gatttool.h attrib/interactive.c \
attrib/utils.c src/log.c
attrib_gatttool_LDADD = lib/libbluetooth-private.la @GLIB_LIBS@ @READLINE_LIBS@
+
+noinst_PROGRAMS += tools/obex-client-tool
+tools_obex_client_tool_SOURCES = $(gobex_sources) $(btio_sources) \
+ tools/obex-client-tool.c
+tools_obex_client_tool_LDADD = lib/libbluetooth-private.la \
+ @GLIB_LIBS@ @READLINE_LIBS@
+
+noinst_PROGRAMS += tools/obex-server-tool
+tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \
+ tools/obex-server-tool.c
+tools_obex_server_tool_LDADD = lib/libbluetooth-private.la @GLIB_LIBS@
endif
dist_man_MANS += tools/rfcomm.1 tools/l2ping.8 \