Add Android makefiles to Bluez.

This includes the following commits from previous versions:

a) bluez: Add Android.mk for pand (off by default)
   b163e2bb16bb5e06a7100f77fe94c24aef1a162e by <san@google.com>

b) Add missing libbluetooth in linker commands for executables using libbluetoothd.
   3e442fe33c17b9476063068d5bb486b4f936257b by <dougkwan@google.com>

c) Edit makefiles to get network to work. Changed libglib to be a shared library
   fddb10d62d21580c49101c3dc4ab43f6619234c0 by Danica Chang

d) Update Bluetooth configuration path: 0b25504e93b95a809e32227a3832bf08a3c13296
   by Jaikumar Ganesh

e) bluez : use another code for Intel's mmx. fe0762b2463df43b2765582c76a09356c753e16b
   by: Author: Jae-Hyung Ahn <jerry.ahn@windriver.com>,
   Signed-off-by: Bruce Beare <brucex.j.beare@intel.com>
diff --git a/Android.mk b/Android.mk
new file mode 100755
index 0000000..456efdd
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2008 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+ifneq ($(TARGET_SIMULATOR),true)
+ifeq ($(BOARD_HAVE_BLUETOOTH),true)
+  include $(all-subdir-makefiles)
+endif
+endif
diff --git a/audio/Android.mk b/audio/Android.mk
new file mode 100755
index 0000000..835f58b
--- /dev/null
+++ b/audio/Android.mk
@@ -0,0 +1,88 @@
+LOCAL_PATH:= $(call my-dir)
+
+# A2DP plugin
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+	a2dp.c \
+	avdtp.c \
+	control.c \
+	device.c \
+	gateway.c \
+	headset.c \
+	ipc.c \
+	main.c \
+	manager.c \
+	media.c \
+	module-bluetooth-sink.c \
+	sink.c \
+	source.c \
+	telephony-dummy.c \
+	transport.c \
+	unix.c
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.40\" \
+	-DSTORAGEDIR=\"/data/misc/bluetoothd\" \
+	-DCONFIGDIR=\"/etc/bluetooth\" \
+	-DANDROID \
+	-D__S_IFREG=0100000  # missing from bionic stat.h
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../gdbus \
+	$(LOCAL_PATH)/../src \
+	$(LOCAL_PATH)/../btio \
+	$(call include-path-for, glib) \
+	$(call include-path-for, dbus)
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetooth \
+	libbluetoothd \
+	libbtio \
+	libdbus \
+	libglib
+
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/bluez-plugin
+LOCAL_UNSTRIPPED_PATH := $(TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)/bluez-plugin
+LOCAL_MODULE := audio
+
+include $(BUILD_SHARED_LIBRARY)
+
+#
+# liba2dp
+# This is linked to Audioflinger so **LGPL only**
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+	liba2dp.c \
+	ipc.c \
+	../sbc/sbc_primitives.c
+
+ifeq ($(TARGET_ARCH),x86)
+LOCAL_SRC_FILES+= \
+	../sbc/sbc_primitives_mmx.c \
+	../sbc/sbc.c
+else
+LOCAL_SRC_FILES+= \
+	../sbc/sbc.c.arm \
+	../sbc/sbc_primitives_armv6.c
+endif
+
+# to improve SBC performance
+LOCAL_CFLAGS:= -funroll-loops
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../sbc \
+	../../../../frameworks/base/include \
+	system/bluetooth/bluez-clean-headers
+
+LOCAL_SHARED_LIBRARIES := \
+	libcutils
+
+LOCAL_MODULE := liba2dp
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/btio/Android.mk b/btio/Android.mk
new file mode 100755
index 0000000..b71f0b1
--- /dev/null
+++ b/btio/Android.mk
@@ -0,0 +1,29 @@
+LOCAL_PATH:= $(call my-dir)
+
+#
+# libbtio
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+	btio.c
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.89\" \
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../gdbus \
+	$(call include-path-for, glib) \
+
+LOCAL_SHARED_LIBRARIES := \
+	libcutils \
+	libglib \
+	libbluetooth \
+
+LOCAL_MODULE:=libbtio
+
+LOCAL_MODULE_TAGS:=optional
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/compat/Android.mk b/compat/Android.mk
new file mode 100755
index 0000000..a67c2b4
--- /dev/null
+++ b/compat/Android.mk
@@ -0,0 +1,32 @@
+BUILD_PAND := false
+ifeq ($(BUILD_PAND),true)
+
+LOCAL_PATH:= $(call my-dir)
+
+#
+# pand
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+	pand.c bnep.c sdp.c
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.47\" -DSTORAGEDIR=\"/data/misc/bluetoothd\" -DNEED_PPOLL
+
+LOCAL_C_INCLUDES:=\
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src \
+	$(LOCAL_PATH)/../common \
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd \
+	libbluetooth \
+	libcutils
+
+LOCAL_MODULE_TAGS :=
+LOCAL_MODULE:=pand
+
+include $(BUILD_EXECUTABLE)
+endif
diff --git a/gdbus/Android.mk b/gdbus/Android.mk
new file mode 100755
index 0000000..15daeb5
--- /dev/null
+++ b/gdbus/Android.mk
@@ -0,0 +1,16 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+	mainloop.c object.c watch.c polkit.c
+
+LOCAL_CFLAGS+=-O3 -DNEED_DBUS_WATCH_GET_UNIX_FD
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../lib \
+	$(call include-path-for, glib) \
+	$(call include-path-for, dbus)
+
+LOCAL_MODULE:=libgdbus_static
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/health/Android.mk b/health/Android.mk
new file mode 100644
index 0000000..a650618
--- /dev/null
+++ b/health/Android.mk
@@ -0,0 +1,41 @@
+LOCAL_PATH:= $(call my-dir)
+
+# health plugin
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+	hdp.c \
+	hdp_main.c \
+	hdp_manager.c \
+	hdp_util.c \
+	mcap.c \
+	mcap_sync.c \
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.89\" \
+	-DSTORAGEDIR=\"/data/misc/bluetoothd\" \
+	-DCONFIGDIR=\"/etc/bluetooth\" \
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../btio \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src \
+	$(LOCAL_PATH)/../gdbus \
+	$(call include-path-for, glib) \
+	$(call include-path-for, dbus)
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd \
+	libbluetooth \
+	libbtio \
+	libdbus \
+	libcutils \
+	libglib \
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/bluez-plugin
+LOCAL_UNSTRIPPED_PATH := $(TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)/bluez-plugin
+LOCAL_MODULE := health
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/input/Android.mk b/input/Android.mk
new file mode 100755
index 0000000..66efcb6
--- /dev/null
+++ b/input/Android.mk
@@ -0,0 +1,40 @@
+LOCAL_PATH:= $(call my-dir)
+
+# HID plugin
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+	device.c \
+	fakehid.c \
+	main.c \
+	manager.c \
+	server.c
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.40\" \
+	-DSTORAGEDIR=\"/data/misc/bluetoothd\" \
+	-DCONFIGDIR=\"/etc/bluetooth\"
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../btio \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src \
+	$(LOCAL_PATH)/../gdbus \
+	$(call include-path-for, glib) \
+	$(call include-path-for, dbus)
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd \
+	libbluetooth \
+	libbtio \
+	libcutils \
+	libdbus \
+	libexpat \
+	libglib 
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/bluez-plugin
+LOCAL_UNSTRIPPED_PATH := $(TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)/bluez-plugin
+LOCAL_MODULE := input
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/lib/Android.mk b/lib/Android.mk
new file mode 100755
index 0000000..703247f
--- /dev/null
+++ b/lib/Android.mk
@@ -0,0 +1,21 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+	bluetooth.c \
+	sdp.c \
+	hci.c \
+	uuid.c \
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/bluetooth \
+
+LOCAL_SHARED_LIBRARIES := \
+	libcutils \
+	liblog \
+
+LOCAL_MODULE:=libbluetooth
+
+LOCAL_CFLAGS+=-O3
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/network/Android.mk b/network/Android.mk
new file mode 100644
index 0000000..bad7639
--- /dev/null
+++ b/network/Android.mk
@@ -0,0 +1,39 @@
+LOCAL_PATH:= $(call my-dir)
+
+# network plugin
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+	common.c \
+	connection.c \
+	main.c \
+	manager.c \
+	server.c
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.69\" \
+	-DSTORAGEDIR=\"/data/misc/bluetoothd\" \
+	-DCONFIGDIR=\"/etc/bluetooth\"
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../btio \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src \
+	$(LOCAL_PATH)/../gdbus \
+	$(call include-path-for, glib) \
+	$(call include-path-for, dbus)
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd \
+	libbluetooth \
+	libbtio \
+	libcutils \
+	libdbus \
+	libglib \
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/bluez-plugin
+LOCAL_UNSTRIPPED_PATH := $(TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)/bluez-plugin
+LOCAL_MODULE := network
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/plugins/Android.mk b/plugins/Android.mk
new file mode 100755
index 0000000..780e177
--- /dev/null
+++ b/plugins/Android.mk
@@ -0,0 +1,38 @@
+LOCAL_PATH:= $(call my-dir)
+
+#
+# libplugin
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+	hciops.c \
+	mgmtops.c \
+	dbusoob.c \
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.40\" \
+	-DBLUETOOTH_PLUGIN_BUILTIN \
+	-DSTORAGEDIR=\"/data/misc/bluetoothd\"
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../btio \
+	$(LOCAL_PATH)/../lib \
+        $(LOCAL_PATH)/../gdbus \
+        $(LOCAL_PATH)/../src \
+        $(call include-path-for, glib) \
+        $(call include-path-for, dbus) \
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd \
+	libbluetooth \
+	libcutils \
+	libdbus \
+	libglib \
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/bluez-plugin
+LOCAL_UNSTRIPPED_PATH := $(TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)/bluez-plugin
+LOCAL_MODULE:=libbuiltinplugin
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/src/Android.mk b/src/Android.mk
new file mode 100755
index 0000000..6ecb390
--- /dev/null
+++ b/src/Android.mk
@@ -0,0 +1,80 @@
+LOCAL_PATH:= $(call my-dir)
+
+#
+# libbluetoothd
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+	android_bluez.c \
+	adapter.c \
+	agent.c \
+	dbus-common.c \
+	device.c \
+	eir.c \
+	error.c \
+	event.c \
+	glib-helper.c \
+	log.c \
+	main.c \
+	manager.c \
+	oob.c \
+	oui.c \
+	plugin.c \
+	rfkill.c \
+	sdpd-request.c \
+	sdpd-service.c \
+	sdpd-server.c \
+	sdpd-database.c \
+	sdp-xml.c \
+	storage.c \
+	textfile.c
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.40\" \
+	-DSTORAGEDIR=\"/data/misc/bluetoothd\" \
+	-DCONFIGDIR=\"/etc/bluetooth\" \
+	-DSERVICEDIR=\"/system/bin\" \
+	-DPLUGINDIR=\"/system/lib/bluez-plugin\" \
+	-DANDROID_SET_AID_AND_CAP \
+	-DANDROID_EXPAND_NAME \
+	-DOUIFILE=\"/data/misc/bluetoothd/ouifile\" \
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../btio \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../gdbus \
+	$(LOCAL_PATH)/../plugins \
+	$(call include-path-for, glib) \
+	$(call include-path-for, glib)/glib \
+	$(call include-path-for, dbus)
+
+LOCAL_SHARED_LIBRARIES := \
+	libdl \
+	libbluetooth \
+	libbtio \
+	libdbus \
+	libcutils \
+	libglib \
+
+LOCAL_STATIC_LIBRARIES := \
+	libbuiltinplugin \
+	libgdbus_static
+
+LOCAL_MODULE:=libbluetoothd
+
+include $(BUILD_SHARED_LIBRARY)
+
+#
+# bluetoothd
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd
+
+LOCAL_MODULE:=bluetoothd
+
+include $(BUILD_EXECUTABLE)
diff --git a/test/Android.mk b/test/Android.mk
new file mode 100755
index 0000000..60350c2
--- /dev/null
+++ b/test/Android.mk
@@ -0,0 +1,316 @@
+LOCAL_PATH:= $(call my-dir)
+
+#
+# hstest
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.40\"
+
+LOCAL_SRC_FILES:= \
+	hstest.c
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd libbluetooth
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE:=hstest
+
+include $(BUILD_EXECUTABLE)
+
+#
+# l2test
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.40\"
+
+LOCAL_SRC_FILES:= \
+	l2test.c
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd libbluetooth
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE:=l2test
+
+include $(BUILD_EXECUTABLE)
+
+#
+# rctest
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.40\"
+
+LOCAL_SRC_FILES:= \
+	rctest.c
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd libbluetooth
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE:=rctest
+
+include $(BUILD_EXECUTABLE)
+
+
+#
+# scotest
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.40\"
+
+LOCAL_SRC_FILES:= \
+	scotest.c
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd libbluetooth
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE:=scotest
+
+include $(BUILD_EXECUTABLE)
+
+#
+# agent
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.40\"
+
+LOCAL_SRC_FILES:= \
+	agent.c
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src \
+	$(call include-path-for, dbus)
+
+LOCAL_SHARED_LIBRARIES := \
+	libdbus
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE:=agent
+
+include $(BUILD_EXECUTABLE)
+
+#
+# attest
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.40\"
+
+LOCAL_SRC_FILES:= \
+	attest.c
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd libbluetooth
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE:=attest
+
+include $(BUILD_EXECUTABLE)
+
+#
+# avtest
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.40\"
+
+LOCAL_SRC_FILES:= \
+	avtest.c
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd libbluetooth
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE:=avtest
+
+include $(BUILD_EXECUTABLE)
+
+#
+# bdaddr
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.40\"
+
+LOCAL_SRC_FILES:= \
+	bdaddr.c
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd libbluetooth
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE:=bdaddr
+
+include $(BUILD_EXECUTABLE)
+
+#
+# btiotest
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.40\"
+
+LOCAL_SRC_FILES:= \
+	btiotest.c
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src \
+	$(call include-path-for, glib) \
+	$(call include-path-for, glib)\glib
+
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd \
+	libbluetooth \
+	libglib
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE:=btiotest
+
+include $(BUILD_EXECUTABLE)
+
+#
+# hciemu
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.40\"
+
+LOCAL_SRC_FILES:= \
+	hciemu.c
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src \
+	$(call include-path-for, glib) \
+	$(call include-path-for, glib)\glib
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd \
+	libbluetooth \
+	libc \
+	libcutils
+
+LOCAL_STATIC_LIBRARIES := \
+	libglib_static
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE:=hciemu
+
+include $(BUILD_EXECUTABLE)
+
+#
+# lmptest
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.40\"
+
+LOCAL_SRC_FILES:= \
+	lmptest.c
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd libbluetooth
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE:=lmptest
+
+include $(BUILD_EXECUTABLE)
+
+#
+# sdptest
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.40\"
+
+LOCAL_SRC_FILES:= \
+	sdptest.c
+
+LOCAL_C_INCLUDES:= \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd libbluetooth
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE:=sdptest
+
+include $(BUILD_EXECUTABLE)
diff --git a/tools/Android.mk b/tools/Android.mk
new file mode 100755
index 0000000..38639f0
--- /dev/null
+++ b/tools/Android.mk
@@ -0,0 +1,187 @@
+LOCAL_PATH:= $(call my-dir)
+
+#
+# avinfo
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+	avinfo.c
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.40\"
+
+LOCAL_C_INCLUDES:=\
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src \
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd libbluetooth
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE:=avinfo
+
+include $(BUILD_EXECUTABLE)
+
+#
+# sdptool
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+	sdptool.c
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.40\" -fpermissive
+
+LOCAL_C_INCLUDES:=\
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src \
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd libbluetooth
+
+LOCAL_MODULE:=sdptool
+
+include $(BUILD_EXECUTABLE)
+
+#
+# hciconfig
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+	csr.c \
+	csr_h4.c \
+	hciconfig.c
+
+LOCAL_CFLAGS:= \
+	-DSTORAGEDIR=\"/tmp\" \
+	-DVERSION=\"4.40\"
+
+LOCAL_C_INCLUDES:=\
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src \
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd libbluetooth
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE:=hciconfig
+
+include $(BUILD_EXECUTABLE)
+
+#
+# hcitool
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+	hcitool.c
+
+LOCAL_CFLAGS:= \
+	-DSTORAGEDIR=\"/tmp\" \
+	-DVERSION=\"4.40\"
+
+LOCAL_C_INCLUDES:=\
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src \
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd libbluetooth
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE:=hcitool
+
+include $(BUILD_EXECUTABLE)
+
+#
+# l2ping
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+	l2ping.c
+
+LOCAL_C_INCLUDES:=\
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src \
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd libbluetooth
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE:=l2ping
+
+include $(BUILD_EXECUTABLE)
+
+#
+# hciattach
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+	hciattach.c \
+	hciattach_ath3k.c \
+	hciattach_qualcomm.c \
+	hciattach_st.c \
+	hciattach_ti.c \
+	hciattach_tialt.c \
+
+LOCAL_CFLAGS:= \
+	-DVERSION=\"4.40\" \
+	-D__BSD_VISIBLE=1 \
+	-DCONFIGDIR=\"/etc/bluetooth\" \
+        -DNEED_PPOLL
+
+LOCAL_C_INCLUDES:=\
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../src \
+
+LOCAL_SHARED_LIBRARIES := \
+	libbluetoothd libbluetooth
+
+LOCAL_MODULE:=hciattach
+
+include $(BUILD_EXECUTABLE)
+
+#
+# rfcomm
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+        kword.c \
+        rfcomm.c \
+        parser.c \
+        lexer.c
+
+LOCAL_CFLAGS:= \
+        -DVERSION=\"4.47\" \
+	-DCONFIGDIR=\"/etc/bluetooth\" \
+        -DNEED_PPOLL
+
+LOCAL_C_INCLUDES:= \
+        $(LOCAL_PATH)/../src \
+        $(LOCAL_PATH)/../lib
+
+LOCAL_SHARED_LIBRARIES := \
+        libbluetooth
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE:=rfcomm
+
+include $(BUILD_EXECUTABLE)
+