xref: /btstack/port/arduino/Makefile (revision 8caefee39d444df6d8908a96a844825f10fbdaa4)
1*8caefee3SMatthias Ringwald#
2*8caefee3SMatthias Ringwald# Makefile to setup BTstack library in Arduino folder (OS X/Linux only) and create .zip archive
3*8caefee3SMatthias Ringwald#
4*8caefee3SMatthias Ringwald
5*8caefee3SMatthias RingwaldDIR=.
6*8caefee3SMatthias RingwaldBTSTACK_ROOT=${DIR}/../..
7*8caefee3SMatthias RingwaldDUMMY=$(shell )
8*8caefee3SMatthias RingwaldVERSION=`sed -n -e 's/^.*BTSTACK_VERSION \"\(.*\)\"/\1/p' ${BTSTACK_ROOT}/src/version.h`
9*8caefee3SMatthias RingwaldBTSTACK_PACKAGE=/tmp/btstack
10*8caefee3SMatthias RingwaldARCHIVE=btstack-arduino-${VERSION}.zip
11*8caefee3SMatthias Ringwald
12*8caefee3SMatthias RingwaldSRC_FILES  =btstack_memory.c linked_list.c memory_pool.c run_loop.c run_loop_embedded.c
13*8caefee3SMatthias RingwaldSRC_FILES +=hci_dump.c hci.c hci_cmds.c hci_transport_h4_dma.c sdp_util.c utils.c
14*8caefee3SMatthias 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
15*8caefee3SMatthias RingwaldBLE_FILES  += sm.c l2cap_le.c ancs_client_lib.h ancs_client_lib.c
16*8caefee3SMatthias RingwaldPORT_FILES = btstack-config.h bsp_arduino_em9301.cpp BTstack.cpp BTstack.h
17*8caefee3SMatthias Ringwald
18*8caefee3SMatthias RingwaldPATHS  = $(addprefix ${BTSTACK_ROOT}/src/, ${SRC_FILES})
19*8caefee3SMatthias RingwaldPATHS += $(wildcard  ${BTSTACK_ROOT}/src/*.h)
20*8caefee3SMatthias RingwaldPATHS += $(addprefix ${BTSTACK_ROOT}/ble/, ${BLE_FILES})
21*8caefee3SMatthias RingwaldPATHS += $(wildcard  ${BTSTACK_ROOT}/ble/*.h)
22*8caefee3SMatthias RingwaldPATHS += $(wildcard  ${BTSTACK_ROOT}/chipset/em9301/*)
23*8caefee3SMatthias RingwaldPATHS += ${BTSTACK_ROOT}/include/btstack
24*8caefee3SMatthias RingwaldPATHS += ${BTSTACK_ROOT}/platforms/arduino/examples
25*8caefee3SMatthias RingwaldPATHS += $(addprefix ${DIR}/, ${PORT_FILES})
26*8caefee3SMatthias Ringwald
27*8caefee3SMatthias RingwaldARDUINO_LIBS=~/Documents/arduino/libraries/BTstack
28*8caefee3SMatthias Ringwald
29*8caefee3SMatthias Ringwaldall: release
30*8caefee3SMatthias Ringwald
31*8caefee3SMatthias Ringwaldclean:
32*8caefee3SMatthias Ringwald	rm -rf ${BTSTACK_PACKAGE}
33*8caefee3SMatthias Ringwald
34*8caefee3SMatthias Ringwaldupdate_version:
35*8caefee3SMatthias Ringwald	${BTSTACK_ROOT}/tools/get_version.sh
36*8caefee3SMatthias Ringwald
37*8caefee3SMatthias Ringwaldinstall: update_version
38*8caefee3SMatthias Ringwald	rm -rf ${ARDUINO_LIBS}
39*8caefee3SMatthias Ringwald	mkdir ${ARDUINO_LIBS}
40*8caefee3SMatthias Ringwald	cp -r ${PATHS} ${ARDUINO_LIBS}
41*8caefee3SMatthias Ringwald
42*8caefee3SMatthias Ringwaldrelease: update_version
43*8caefee3SMatthias Ringwald	rm -rf ${BTSTACK_PACKAGE}
44*8caefee3SMatthias Ringwald	mkdir ${BTSTACK_PACKAGE}
45*8caefee3SMatthias Ringwald	cp -r ${PATHS} ${BTSTACK_PACKAGE}
46*8caefee3SMatthias Ringwald	rm -f ${ARCHIVE}
47*8caefee3SMatthias Ringwald	zip -r ${ARCHIVE} ${BTSTACK_PACKAGE}
48*8caefee3SMatthias Ringwald	cp ${ARCHIVE} btstack-arduino-latest.zip
49