diff options
-rw-r--r-- | bta/Android.mk | 5 | ||||
-rw-r--r-- | gki/Android.mk | 5 | ||||
-rw-r--r-- | include/buildcfg.mk | 21 | ||||
-rwxr-xr-x | main/Android.mk | 4 | ||||
-rw-r--r-- | stack/Android.mk | 5 | ||||
-rwxr-xr-x | tools/gen-buildcfg.sh | 26 | ||||
-rw-r--r-- | vendor/libvendor/Android.mk | 16 | ||||
-rw-r--r-- | vendor/libvendor/vnd_buildcfg.mk | 12 |
8 files changed, 62 insertions, 32 deletions
diff --git a/bta/Android.mk b/bta/Android.mk index 79d8677..f5ab5e1 100644 --- a/bta/Android.mk +++ b/bta/Android.mk @@ -2,8 +2,6 @@ ifneq ($(TARGET_SIMULATOR),true) LOCAL_PATH:= $(call my-dir) -include $(LOCAL_PATH)/../include/buildcfg.mk - include $(CLEAR_VARS) ifeq ($(BOARD_HAVE_BLUETOOTH_BCM),true) @@ -127,6 +125,7 @@ LOCAL_SRC_FILES:= \ ./jv/bta_jv_api.c LOCAL_MODULE := libbt-brcm_bta +LOCAL_MODULE_CLASS := STATIC_LIBRARIES LOCAL_MODULE_TAGS := optional LOCAL_SHARED_LIBRARIES := libcutils libc @@ -144,6 +143,8 @@ LOCAL_C_INCLUDES+= . \ $(LOCAL_PATH)/../udrv/include \ $(LOCAL_PATH)/../brcm/include \ +include $(LOCAL_PATH)/../include/buildcfg.mk + include $(BUILD_STATIC_LIBRARY) endif # TARGET_SIMULATOR != true diff --git a/gki/Android.mk b/gki/Android.mk index 13681ea..c8d8923 100644 --- a/gki/Android.mk +++ b/gki/Android.mk @@ -2,8 +2,6 @@ ifneq ($(TARGET_SIMULATOR),true) LOCAL_PATH:= $(call my-dir) -include $(LOCAL_PATH)/../include/buildcfg.mk - include $(CLEAR_VARS) LOCAL_C_INCLUDES:= $(LOCAL_PATH)/common \ @@ -29,6 +27,9 @@ LOCAL_SRC_FILES:= \ LOCAL_MODULE := libbt-brcm_gki LOCAL_MODULE_TAGS := optional LOCAL_SHARED_LIBRARIES := libcutils libc +LOCAL_MODULE_CLASS := STATIC_LIBRARIES + +include $(LOCAL_PATH)/../include/buildcfg.mk include $(BUILD_STATIC_LIBRARY) diff --git a/include/buildcfg.mk b/include/buildcfg.mk index 8d53748..1623c95 100644 --- a/include/buildcfg.mk +++ b/include/buildcfg.mk @@ -1,13 +1,12 @@ -#bt_targetfile = $(TARGET_DEVICE_DIR)/$(addprefix bdroid_, $(addsuffix .txt,$(basename $(TARGET_DEVICE)))) -bt_targetfile = $(call my-dir)/$(addprefix bdroid_, $(addsuffix .txt,$(basename $(TARGET_DEVICE)))) -bt_cfgfile = $(call my-dir)/buildcfg.h +intermediates := $(local-intermediates-dir) -bt_build_cfg = $(shell if [ -f $(bt_cfgfile) ] && [ `stat -c %Y $(bt_targetfile)` -lt `stat -c %Y $(bt_cfgfile)` ]; then echo 0; else echo 1; fi) +SRC := $(call my-dir)/$(addprefix bdroid_, $(addsuffix .txt,$(basename $(TARGET_DEVICE)))) +GEN := $(intermediates)/buildcfg.h +TOOL := $(call my-dir)/../tools/gen-buildcfg.sh -ifeq ($(bt_build_cfg),1) -$(info "Creating $(bt_cfgfile) from $(bt_targetfile)") -$(shell echo "#ifndef BUILDCFG_H" > $(bt_cfgfile)) -$(shell echo "#define BUILDCFG_H" >> $(bt_cfgfile)) -$(shell sed -e '/^#/d' -e '/^$$/d' -e '/# Makefile only$$/d' -e 's/^/#define /' -e 's/=/ /' $(bt_targetfile) >> $(bt_cfgfile)) -$(shell echo "#endif" >> $(bt_cfgfile)) -endif +$(GEN): PRIVATE_PATH := $(call my-dir) +$(GEN): PRIVATE_CUSTOM_TOOL = $(TOOL) $< $@ +$(GEN): $(SRC) $(TOOL) + $(transform-generated-source) + +LOCAL_GENERATED_SOURCES += $(GEN) diff --git a/main/Android.mk b/main/Android.mk index cc19aa8..d235f80 100755 --- a/main/Android.mk +++ b/main/Android.mk @@ -1,7 +1,5 @@ LOCAL_PATH:= $(call my-dir) -include $(LOCAL_PATH)/../include/buildcfg.mk - # # Bluetooth HW module # @@ -120,6 +118,8 @@ LOCAL_STATIC_LIBRARIES := libbt-brcm_gki libbt-brcm_bta libbt-brcm_stack LOCAL_MODULE := bluetooth.default LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := SHARED_LIBRARIES +include $(LOCAL_PATH)/../include/buildcfg.mk include $(BUILD_SHARED_LIBRARY) diff --git a/stack/Android.mk b/stack/Android.mk index f280b5d..0d7a17e 100644 --- a/stack/Android.mk +++ b/stack/Android.mk @@ -2,8 +2,6 @@ ifneq ($(TARGET_SIMULATOR),true) LOCAL_PATH:= $(call my-dir) -include $(LOCAL_PATH)/../include/buildcfg.mk - include $(CLEAR_VARS) LOCAL_C_INCLUDES:= . \ @@ -184,8 +182,11 @@ LOCAL_SRC_FILES:= \ LOCAL_MODULE := libbt-brcm_stack LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := STATIC_LIBRARIES LOCAL_SHARED_LIBRARIES := libcutils libc +include $(LOCAL_PATH)/../include/buildcfg.mk + include $(BUILD_STATIC_LIBRARY) endif # TARGET_SIMULATOR != true diff --git a/tools/gen-buildcfg.sh b/tools/gen-buildcfg.sh new file mode 100755 index 0000000..a09cb20 --- /dev/null +++ b/tools/gen-buildcfg.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +if [[ "" == "$2" ]] +then + echo "Usage: $0 <in-file> <out-file>" + exit 1 +fi + +if [ ! -f "$1" ] +then + echo "Error: Can't find input file $1..." + exit 2 +fi + +DATE=`/usr/bin/env date` +BASE=`basename $2` +BASE=`echo ${BASE} | tr "[:lower:]" "[:upper:]"` +BASE=`echo ${BASE} | sed -e "s/\\./_/"` +PROTECT="_${BASE}" + +echo "/* Auto-generated from $1 on ${DATE} */" > $2 +echo "#ifndef ${PROTECT}" >> $2 +echo "#define ${PROTECT}" >> $2 +sed -e '/^#/d' -e '/^$$/d' -e '/# Makefile only$$/d' -e 's/^/#define /' -e 's/=/ /' $1 >> $2 +echo "#endif" >> $2 + diff --git a/vendor/libvendor/Android.mk b/vendor/libvendor/Android.mk index 808990d..7d68356 100644 --- a/vendor/libvendor/Android.mk +++ b/vendor/libvendor/Android.mk @@ -2,19 +2,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -vnd_targetfile = $(LOCAL_PATH)/include/$(addprefix vnd_, $(addsuffix .txt,$(basename $(TARGET_DEVICE)))) -vnd_cfgfile = $(LOCAL_PATH)/include/vnd_buildcfg.h - -vnd_build_cfg = $(shell if [ -f $(vnd_cfgfile) ] && [ `stat -c %Y $(vnd_targetfile)` -lt `stat -c %Y $(vnd_cfgfile)` ]; then echo 0; else echo 1; fi) - -ifeq ($(vnd_build_cfg),1) -$(info "Creating $(vnd_cfgfile) from $(vnd_targetfile)") -$(shell echo "#ifndef VND_BUILDCFG_H" > $(vnd_cfgfile)) -$(shell echo "#define VND_BUILDCFG_H" >> $(vnd_cfgfile)) -$(shell sed -e '/^#/d' -e '/^$$/d' -e '/# Makefile only$$/d' -e 's/^/#define /' -e 's/=/ /' $(vnd_targetfile) >> $(vnd_cfgfile)) -$(shell echo "#endif" >> $(vnd_cfgfile)) -endif - LOCAL_SRC_FILES := \ src/bt_vendor_brcm.c \ src/hci_h4.c \ @@ -33,5 +20,8 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_MODULE := libbt-vendor LOCAL_MODULE_TAGS := eng +LOCAL_MODULE_CLASS := SHARED_LIBRARIES + +include $(LOCAL_PATH)/vnd_buildcfg.mk include $(BUILD_SHARED_LIBRARY) diff --git a/vendor/libvendor/vnd_buildcfg.mk b/vendor/libvendor/vnd_buildcfg.mk new file mode 100644 index 0000000..ea4b0e5 --- /dev/null +++ b/vendor/libvendor/vnd_buildcfg.mk @@ -0,0 +1,12 @@ +intermediates := $(local-intermediates-dir) + +SRC := $(call my-dir)/include/$(addprefix vnd_, $(addsuffix .txt,$(basename $(TARGET_DEVICE)))) +GEN := $(intermediates)/vnd_buildcfg.h +TOOL := $(call my-dir)/../../tools/gen-buildcfg.sh + +$(GEN): PRIVATE_PATH := $(call my-dir) +$(GEN): PRIVATE_CUSTOM_TOOL = $(TOOL) $< $@ +$(GEN): $(SRC) $(TOOL) + $(transform-generated-source) + +LOCAL_GENERATED_SOURCES += $(GEN) |