2016-11-03 16:05:47 +00:00
|
|
|
#/bin/sh
|
|
|
|
|
|
|
|
ZEPHYR_BASE=../../..
|
|
|
|
|
2016-12-02 11:53:55 +00:00
|
|
|
echo "Integrating BTstack into Zephyr"
|
2016-11-03 16:05:47 +00:00
|
|
|
|
2016-12-02 11:53:55 +00:00
|
|
|
echo "Adding subsys/btstack"
|
2016-11-11 13:11:04 +00:00
|
|
|
|
2016-11-03 16:05:47 +00:00
|
|
|
# add btstack folder to subsys/Makefile
|
|
|
|
MAKEFILE_ADD_ON='obj-$(CONFIG_BTSTACK) += btstack/'
|
|
|
|
NET_MAKEFILE=${ZEPHYR_BASE}/subsys/Makefile
|
|
|
|
grep -q -F btstack ${NET_MAKEFILE} || echo ${MAKEFILE_ADD_ON} >> ${NET_MAKEFILE}
|
|
|
|
|
2016-12-02 11:53:55 +00:00
|
|
|
# add BTstack KConfig to subsys/Kconfig
|
2016-11-03 16:05:47 +00:00
|
|
|
SUBSYS_KCONFIG=${ZEPHYR_BASE}/subsys/Kconfig
|
|
|
|
grep -q -F btstack ${SUBSYS_KCONFIG} || echo 'source "subsys/btstack/Kconfig"' >> ${SUBSYS_KCONFIG}
|
|
|
|
|
2016-11-11 13:11:04 +00:00
|
|
|
# create subsys/btstack
|
2016-11-03 16:05:47 +00:00
|
|
|
mkdir -p ${ZEPHYR_BASE}/subsys/btstack
|
|
|
|
|
|
|
|
# copy sources
|
|
|
|
rsync -a ../../src/ ${ZEPHYR_BASE}/subsys/btstack
|
|
|
|
|
|
|
|
# copy embedded run loop
|
|
|
|
rsync -a ../../platform/embedded/hal_cpu.h ${ZEPHYR_BASE}/subsys/btstack
|
|
|
|
rsync -a ../../platform/embedded/hal_time_ms.h ${ZEPHYR_BASE}/subsys/btstack
|
|
|
|
rsync -a ../../platform/embedded/hal_tick.h ${ZEPHYR_BASE}/subsys/btstack
|
|
|
|
rsync -a ../../platform/embedded/btstack_run_loop_embedded.h ${ZEPHYR_BASE}/subsys/btstack
|
|
|
|
rsync -a ../../platform/embedded/btstack_run_loop_embedded.c ${ZEPHYR_BASE}/subsys/btstack
|
|
|
|
|
2016-11-11 13:11:04 +00:00
|
|
|
# copy bludroid
|
|
|
|
rsync -a ../../3rd-party/bluedroid ${ZEPHYR_BASE}/subsys/btstack
|
|
|
|
|
2016-11-03 16:05:47 +00:00
|
|
|
# copy btstack_config.h
|
|
|
|
rsync -a btstack_config.h ${ZEPHYR_BASE}/subsys/btstack
|
|
|
|
|
|
|
|
# copy Kconfig
|
|
|
|
rsync -a Kconfig ${ZEPHYR_BASE}/subsys/btstack
|
|
|
|
|
|
|
|
# copy Makefiles
|
|
|
|
rsync -a Makefile.src ${ZEPHYR_BASE}/subsys/btstack/Makefile
|
|
|
|
rsync -a Makefile.ble ${ZEPHYR_BASE}/subsys/btstack/ble/Makefile
|
2016-11-11 13:11:04 +00:00
|
|
|
rsync -a Makefile.gatt-service ${ZEPHYR_BASE}/subsys/btstack/ble/gatt-service/Makefile
|
|
|
|
rsync -a Makefile.bluedroid ${ZEPHYR_BASE}/subsys/btstack/bluedroid/Makefile
|
|
|
|
rsync -a Makefile.bluedroid-encoder ${ZEPHYR_BASE}/subsys/btstack/bluedroid/encoder/srce/Makefile
|
|
|
|
rsync -a Makefile.bluedroid-decoder ${ZEPHYR_BASE}/subsys/btstack/bluedroid/decoder/srce/Makefile
|
2016-11-10 20:54:29 +00:00
|
|
|
|
2016-11-03 16:05:47 +00:00
|
|
|
# create samples/btstack
|
|
|
|
./create_examples.py
|