xref: /btstack/port/arduino/Makefile (revision c7747faaecd536055fd01520084f110826db2bc0)
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=.
6b149c1b9SMatthias RingwaldBTSTACK_ROOT=${realpath ../..}
7*c7747faaSMatthias RingwaldVERSION=$(shell ${BTSTACK_ROOT}/tool/get_git_version.sh)
8b149c1b9SMatthias RingwaldARCHIVE=$(BTSTACK_ROOT)/btstack-arduino-${VERSION}.zip
98caefee3SMatthias Ringwald
10b149c1b9SMatthias RingwaldSRC_C_FILES  = btstack_memory.c btstack_linked_list.c btstack_memory_pool.c btstack_run_loop.c btstack_crypto.c
11b149c1b9SMatthias RingwaldSRC_C_FILES += hci_dump.c hci.c hci_cmd.c  btstack_util.c l2cap.c l2cap_signaling.c ad_parser.c hci_transport_h4.c btstack_tlv.c
12b149c1b9SMatthias RingwaldBLE_C_FILES  = att_db.c att_server.c att_dispatch.c att_db_util.c le_device_db_memory.c gatt_client.c
13b149c1b9SMatthias RingwaldBLE_C_FILES += sm.c att_db_util.c
14b149c1b9SMatthias RingwaldBLE_GATT_C_FILES = ancs_client.c
15b149c1b9SMatthias RingwaldPORT_C_FILES = bsp_arduino_em9301.cpp BTstack.cpp
16b149c1b9SMatthias RingwaldEMBEDDED_C_FILES = btstack_run_loop_embedded.c btstack_uart_block_embedded.c hci_dump_embedded_stdout.c
17b149c1b9SMatthias RingwaldEM9301_C_FILES = btstack_chipset_em9301.c
188caefee3SMatthias Ringwald
19b149c1b9SMatthias RingwaldPATHS  = $(addprefix ${BTSTACK_ROOT}/src/,     ${SRC_C_FILES})
20b149c1b9SMatthias RingwaldPATHS += $(addprefix ${BTSTACK_ROOT}/src/ble/, ${BLE_C_FILES})
21690999b0SMatthias RingwaldPATHS += $(addprefix ${BTSTACK_ROOT}/src/ble/gatt-service/, ${BLE_GATT_C_FILES})
22b149c1b9SMatthias RingwaldPATHS += $(addprefix ${BTSTACK_ROOT}/platform/embedded/,    ${EMBEDDED_C_FILES})
23b149c1b9SMatthias RingwaldPATHS += $(addprefix ${BTSTACK_ROOT}/chipset/em9301/,       ${EM9301_C_FILES})
248caefee3SMatthias RingwaldPATHS += $(addprefix ${DIR}/, ${PORT_FILES})
25b149c1b9SMatthias RingwaldPATHS += ${BTSTACK_ROOT}/port/arduino/examples
268caefee3SMatthias Ringwald
278caefee3SMatthias RingwaldARDUINO_LIBS=~/Documents/arduino/libraries/BTstack
288caefee3SMatthias Ringwald
298caefee3SMatthias Ringwaldall: release
308caefee3SMatthias Ringwald
318caefee3SMatthias Ringwaldupdate_version:
323edc84c5SMatthias Ringwald	${BTSTACK_ROOT}/tool/get_version.sh
338caefee3SMatthias Ringwald
348caefee3SMatthias Ringwaldinstall: update_version
358caefee3SMatthias Ringwald	rm -rf ${ARDUINO_LIBS}
368caefee3SMatthias Ringwald	mkdir ${ARDUINO_LIBS}
37b149c1b9SMatthias Ringwald	cd ${ARDUINO_LIBS} && unzip ${ARCHIVE}
388caefee3SMatthias Ringwald
398caefee3SMatthias Ringwaldrelease: update_version
408caefee3SMatthias Ringwald	rm -f ${ARCHIVE}
41b149c1b9SMatthias Ringwald	cd ${BTSTACK_ROOT}/chipset/em9301    && zip    $(ARCHIVE) *.h
42b149c1b9SMatthias Ringwald	cd ${BTSTACK_ROOT}/platform/embedded && zip    $(ARCHIVE) *.h
43b149c1b9SMatthias Ringwald	cd ${BTSTACK_ROOT}/src 				 && zip    $(ARCHIVE) *.h ble/*.h ble/gatt-service/*.h
44b149c1b9SMatthias Ringwald	# remove the duplicate BTstack.h
45b149c1b9SMatthias Ringwald	zip -d ${ARCHIVE} btstack.h
46b149c1b9SMatthias Ringwald	# port specific files
47b149c1b9SMatthias Ringwald	zip ${ARCHIVE} *.h *.cpp
48b149c1b9SMatthias Ringwald	cd ${BTSTACK_ROOT}/port/arduino      && zip -r $(ARCHIVE) examples
49b149c1b9SMatthias Ringwald	# all c files
50b149c1b9SMatthias Ringwald	zip --junk-paths ${ARCHIVE} ${PATHS}
518caefee3SMatthias Ringwald	cp ${ARCHIVE} btstack-arduino-latest.zip
52