xref: /btstack/port/arduino/Makefile (revision 8f2a52f4d99b588685740a7150f314f782cdf947)
18caefee3SMatthias Ringwald#
28caefee3SMatthias Ringwald# Makefile to setup BTstack library in Arduino folder (OS X/Linux only) and create .zip archive
38caefee3SMatthias Ringwald#
48caefee3SMatthias Ringwald
58caefee3SMatthias RingwaldDIR=.
68caefee3SMatthias RingwaldBTSTACK_ROOT=${DIR}/../..
78caefee3SMatthias RingwaldDUMMY=$(shell )
88caefee3SMatthias RingwaldVERSION=`sed -n -e 's/^.*BTSTACK_VERSION \"\(.*\)\"/\1/p' ${BTSTACK_ROOT}/src/version.h`
98caefee3SMatthias RingwaldBTSTACK_PACKAGE=/tmp/btstack
108caefee3SMatthias RingwaldARCHIVE=btstack-arduino-${VERSION}.zip
118caefee3SMatthias Ringwald
12d2e6c4b7SMatthias RingwaldSRC_FILES  = btstack_memory.c btstack_linked_list.c btstack_memory_pool.c run_loop.c
133edc84c5SMatthias RingwaldSRC_FILES += hci_dump.c hci.c hci_cmds.c  utils.c l2cap.c
148caefee3SMatthias RingwaldBLE_FILES  =  ad_parser.c att.c att_server.c att_dispatch.c att_db_util.c le_device_db_memory.c gatt_client.c
153edc84c5SMatthias RingwaldBLE_FILES += sm.c ancs_client_lib.h ancs_client_lib.c
168caefee3SMatthias RingwaldPORT_FILES = btstack-config.h bsp_arduino_em9301.cpp BTstack.cpp BTstack.h
17*8f2a52f4SMatthias RingwaldEMBEDDED_FILES = btstack_run_loop_embedded.c hci_transport_h4_dma.c
188caefee3SMatthias Ringwald
198caefee3SMatthias RingwaldPATHS  = $(addprefix ${BTSTACK_ROOT}/src/, ${SRC_FILES})
208caefee3SMatthias RingwaldPATHS += $(wildcard  ${BTSTACK_ROOT}/src/*.h)
213edc84c5SMatthias RingwaldPATHS += $(addprefix ${BTSTACK_ROOT}/src/ble/, ${BLE_FILES})
223edc84c5SMatthias RingwaldPATHS += $(wildcard  ${BTSTACK_ROOT}/src/ble/*.h)
233edc84c5SMatthias RingwaldPATHS += $(addprefix ${BTSTACK_ROOT}/platform/embedded/, ${EMBEDDED_FILES})
243edc84c5SMatthias RingwaldPATHS += $(wildcard  ${BTSTACK_ROOT}/platform/embedded/*.h)
258caefee3SMatthias RingwaldPATHS += $(wildcard  ${BTSTACK_ROOT}/chipset/em9301/*)
263edc84c5SMatthias RingwaldPATHS += ${BTSTACK_ROOT}/port/arduino/examples
278caefee3SMatthias RingwaldPATHS += $(addprefix ${DIR}/, ${PORT_FILES})
288caefee3SMatthias Ringwald
298caefee3SMatthias RingwaldARDUINO_LIBS=~/Documents/arduino/libraries/BTstack
308caefee3SMatthias Ringwald
318caefee3SMatthias Ringwaldall: release
328caefee3SMatthias Ringwald
338caefee3SMatthias Ringwaldclean:
348caefee3SMatthias Ringwald	rm -rf ${BTSTACK_PACKAGE}
358caefee3SMatthias Ringwald
368caefee3SMatthias Ringwaldupdate_version:
373edc84c5SMatthias Ringwald	${BTSTACK_ROOT}/tool/get_version.sh
388caefee3SMatthias Ringwald
398caefee3SMatthias Ringwaldinstall: update_version
408caefee3SMatthias Ringwald	rm -rf ${ARDUINO_LIBS}
418caefee3SMatthias Ringwald	mkdir ${ARDUINO_LIBS}
428caefee3SMatthias Ringwald	cp -r ${PATHS} ${ARDUINO_LIBS}
438caefee3SMatthias Ringwald
448caefee3SMatthias Ringwaldrelease: update_version
458caefee3SMatthias Ringwald	rm -rf ${BTSTACK_PACKAGE}
468caefee3SMatthias Ringwald	mkdir ${BTSTACK_PACKAGE}
478caefee3SMatthias Ringwald	cp -r ${PATHS} ${BTSTACK_PACKAGE}
488caefee3SMatthias Ringwald	rm -f ${ARCHIVE}
498caefee3SMatthias Ringwald	zip -r ${ARCHIVE} ${BTSTACK_PACKAGE}
508caefee3SMatthias Ringwald	cp ${ARCHIVE} btstack-arduino-latest.zip
51