2013-06-10 10:43:53 +00:00
|
|
|
BTSTACK_ROOT = ../..
|
2014-09-04 19:24:00 +00:00
|
|
|
POSIX_ROOT= ${BTSTACK_ROOT}/platforms/posix
|
2013-06-10 10:43:53 +00:00
|
|
|
|
2014-06-08 21:47:27 +00:00
|
|
|
CFLAGS = -g -Wall -I. -I${BTSTACK_ROOT}/src -I${BTSTACK_ROOT}/include
|
|
|
|
CFLAGS += -I${BTSTACK_ROOT}/chipset-cc256x
|
|
|
|
CFLAGS += -I${BTSTACK_ROOT}/chipset-csr
|
2014-01-22 14:00:23 +00:00
|
|
|
CFLAGS += -I/usr/local/include -I../../ble -I../.. -I../..
|
|
|
|
LDFLAGS = -L/usr/local/lib -lusb-1.0
|
2014-06-07 10:22:37 +00:00
|
|
|
# needed on OS X with libusb compiled stand alone
|
|
|
|
LDFLAGS += -framework IOKit -framework CoreFoundation -framework Foundation
|
2013-06-10 10:43:53 +00:00
|
|
|
|
|
|
|
CORE = \
|
2014-09-04 19:24:00 +00:00
|
|
|
${BTSTACK_ROOT}/src/btstack_memory.c \
|
|
|
|
${BTSTACK_ROOT}/src/linked_list.c \
|
|
|
|
${BTSTACK_ROOT}/src/memory_pool.c \
|
|
|
|
${BTSTACK_ROOT}/src/run_loop.c \
|
|
|
|
${POSIX_ROOT}/src/run_loop_posix.c \
|
2013-06-10 10:43:53 +00:00
|
|
|
|
|
|
|
COMMON = \
|
2014-01-05 20:45:37 +00:00
|
|
|
${BTSTACK_ROOT}/src/hci.c \
|
|
|
|
${BTSTACK_ROOT}/src/hci_cmds.c \
|
|
|
|
${BTSTACK_ROOT}/src/hci_dump.c \
|
|
|
|
${BTSTACK_ROOT}/src/l2cap.c \
|
|
|
|
${BTSTACK_ROOT}/src/l2cap_signaling.c \
|
|
|
|
${BTSTACK_ROOT}/src/remote_device_db_memory.c \
|
|
|
|
${BTSTACK_ROOT}/src/sdp_util.c \
|
|
|
|
${BTSTACK_ROOT}/src/utils.c \
|
|
|
|
${BTSTACK_ROOT}/src/rfcomm.c \
|
|
|
|
${BTSTACK_ROOT}/src/sdp.c \
|
|
|
|
${BTSTACK_ROOT}/src/sdp_client.c \
|
|
|
|
${BTSTACK_ROOT}/src/sdp_parser.c \
|
|
|
|
${BTSTACK_ROOT}/src/sdp_query_util.c \
|
|
|
|
${BTSTACK_ROOT}/src/sdp_query_rfcomm.c \
|
2014-09-04 19:24:00 +00:00
|
|
|
${POSIX_ROOT}/src/hci_transport_h4.c \
|
|
|
|
${POSIX_ROOT}/src/hci_transport_h2_libusb.c \
|
2014-01-08 12:04:11 +00:00
|
|
|
|
|
|
|
ATT = \
|
2014-04-25 13:23:37 +00:00
|
|
|
${BTSTACK_ROOT}/ble/att_dispatch.c \
|
2014-04-29 19:45:40 +00:00
|
|
|
|
|
|
|
GATT_SERVER = \
|
|
|
|
${BTSTACK_ROOT}/ble/att.c \
|
2014-01-05 21:39:26 +00:00
|
|
|
${BTSTACK_ROOT}/ble/att_server.c \
|
2013-11-28 10:54:41 +00:00
|
|
|
|
2014-04-29 19:45:40 +00:00
|
|
|
GATT_CLIENT = \
|
|
|
|
${BTSTACK_ROOT}/ble/ad_parser.c \
|
|
|
|
${BTSTACK_ROOT}/ble/gatt_client.c \
|
|
|
|
|
2013-11-28 10:54:41 +00:00
|
|
|
CC2564 = \
|
|
|
|
${BTSTACK_ROOT}/chipset-cc256x/bt_control_cc256x.c \
|
2013-12-21 22:31:04 +00:00
|
|
|
${BTSTACK_ROOT}/chipset-cc256x/bluetooth_init_cc2564_2.10.c \
|
2013-06-10 10:43:53 +00:00
|
|
|
|
2014-06-08 21:47:27 +00:00
|
|
|
CSR = ${BTSTACK_ROOT}/chipset-csr/bt_control_csr.c
|
|
|
|
|
2014-01-08 12:04:11 +00:00
|
|
|
SM_REAL = \
|
|
|
|
${BTSTACK_ROOT}/ble/sm.c \
|
|
|
|
${BTSTACK_ROOT}/ble/central_device_db_memory.c \
|
|
|
|
|
|
|
|
SM_MINIMAL = \
|
|
|
|
${BTSTACK_ROOT}/ble/sm_minimal.c \
|
2014-06-08 21:47:27 +00:00
|
|
|
${BTSTACK_ROOT}/ble/central_device_db_dummy.c \
|
2014-01-08 12:04:11 +00:00
|
|
|
|
2014-08-29 21:25:46 +00:00
|
|
|
SDP_DES = \
|
|
|
|
${BTSTACK_ROOT}/test/des_iterator/des_iterator.c \
|
|
|
|
|
2014-06-08 21:47:27 +00:00
|
|
|
CORE_OBJ = $(CORE:.c=.o)
|
|
|
|
COMMON_OBJ = $(COMMON:.c=.o)
|
|
|
|
CC2564_OBJ = $(CC2564:.c=.o)
|
|
|
|
CSR_OBJ = $(CSR:.c=.o)
|
2014-01-08 12:04:11 +00:00
|
|
|
SM_REAL_OBJ = $(SM_REAL:.c=.o)
|
|
|
|
SM_MINIMAL_OBJ = $(SM_MINIMAL:.c=.o)
|
2014-06-08 21:47:27 +00:00
|
|
|
ATT_OBJ = $(ATT:.c=.o)
|
2014-04-29 19:45:40 +00:00
|
|
|
GATT_CLIENT_OBJ = $(GATT_CLIENT:.c=.o)
|
|
|
|
GATT_SERVER_OBJ = $(GATT_SERVER:.c=.o)
|
2013-06-10 10:43:53 +00:00
|
|
|
|
|
|
|
# create firmware image from common objects and example source file
|
|
|
|
|
2014-08-08 13:12:23 +00:00
|
|
|
all: ../../include/btstack/version.h gatt_browser sdp_rfcomm_query sdp_general_query spp_counter ble_peripheral \
|
2014-01-27 19:25:26 +00:00
|
|
|
ble_peripheral_sm_minimal gap_inquiry gap_dedicated_bonding gap_inquiry_and_bond l2cap_test spp_streamer \
|
2014-08-29 21:25:46 +00:00
|
|
|
classic_test ble_peripheral_uart_csr ble_peripheral_uart_cc256x ancs_client spp_and_le_counter \
|
|
|
|
sdp_bnep_query \
|
2013-06-10 10:43:53 +00:00
|
|
|
|
2013-11-06 19:58:48 +00:00
|
|
|
../../include/btstack/version.h:
|
2014-09-04 19:53:39 +00:00
|
|
|
../tools/get_version.sh
|
2013-11-06 19:58:48 +00:00
|
|
|
|
2013-10-17 14:20:23 +00:00
|
|
|
sdp_rfcomm_query: ${CORE_OBJ} ${COMMON_OBJ} sdp_rfcomm_query.c
|
2013-06-10 21:30:25 +00:00
|
|
|
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
|
|
|
|
|
2013-10-17 14:20:23 +00:00
|
|
|
sdp_general_query: ${CORE_OBJ} ${COMMON_OBJ} sdp_general_query.c
|
2013-06-10 10:43:53 +00:00
|
|
|
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
|
|
|
|
|
2014-08-29 21:25:46 +00:00
|
|
|
sdp_bnep_query: ${CORE_OBJ} ${COMMON_OBJ} ${SDP_DES} sdp_bnep_query.c
|
|
|
|
${CC} $^ ${CFLAGS} -I../../test/des_iterator ${LDFLAGS} -o $@
|
|
|
|
|
2013-08-29 20:42:01 +00:00
|
|
|
spp_counter: ${CORE_OBJ} ${COMMON_OBJ} spp_counter.c
|
|
|
|
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
|
2013-06-10 10:43:53 +00:00
|
|
|
|
2014-06-10 20:11:41 +00:00
|
|
|
spp_and_le_counter: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_REAL_OBJ} spp_and_le_counter.c spp_and_le_counter.h
|
2014-09-04 19:24:00 +00:00
|
|
|
${CC} ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_REAL_OBJ} spp_and_le_counter.c ${CFLAGS} ${LDFLAGS} -o $@
|
2014-06-10 20:11:41 +00:00
|
|
|
|
2013-11-01 13:09:54 +00:00
|
|
|
spp_counter_ssp: ${CORE_OBJ} ${COMMON_OBJ} spp_counter_ssp.c
|
|
|
|
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
|
|
|
|
|
2014-01-23 14:56:03 +00:00
|
|
|
spp_streamer: ${CORE_OBJ} ${COMMON_OBJ} spp_streamer.c
|
|
|
|
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
|
|
|
|
|
2014-01-18 20:23:15 +00:00
|
|
|
gap_dedicated_bonding: ${CORE_OBJ} ${COMMON_OBJ} gap_dedicated_bonding.c
|
|
|
|
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
|
|
|
|
|
2014-01-22 22:25:56 +00:00
|
|
|
gap_inquiry: ${CORE_OBJ} ${COMMON_OBJ} gap_inquiry.c
|
|
|
|
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
|
|
|
|
|
2014-01-22 22:38:52 +00:00
|
|
|
gap_inquiry_and_bond: ${CORE_OBJ} ${COMMON_OBJ} gap_inquiry_and_bond.c
|
|
|
|
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
|
|
|
|
|
2014-01-22 23:29:16 +00:00
|
|
|
l2cap_test: ${CORE_OBJ} ${COMMON_OBJ} l2cap_test.c
|
|
|
|
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
|
|
|
|
|
2014-01-27 19:25:26 +00:00
|
|
|
classic_test: ${CORE_OBJ} ${COMMON_OBJ} classic_test.c
|
|
|
|
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
|
|
|
|
|
2013-10-17 12:42:18 +00:00
|
|
|
# compile .ble description
|
|
|
|
profile.h: profile.gatt
|
|
|
|
python ${BTSTACK_ROOT}/ble/compile-gatt.py $< $@
|
2014-06-09 20:33:01 +00:00
|
|
|
ancs_client.h: ancs_client.gatt
|
|
|
|
python ${BTSTACK_ROOT}/ble/compile-gatt.py $< $@
|
2014-06-10 20:11:41 +00:00
|
|
|
spp_and_le_counter.h: spp_and_le_counter.gatt
|
|
|
|
python ${BTSTACK_ROOT}/ble/compile-gatt.py $< $@
|
2013-06-10 10:43:53 +00:00
|
|
|
|
2014-06-09 20:33:01 +00:00
|
|
|
ancs_client: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${GATT_CLIENT_OBJ} ${SM_REAL_OBJ} ancs_client.c ancs_client.h
|
2014-06-08 21:47:27 +00:00
|
|
|
${CC} ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${GATT_CLIENT_OBJ} ${SM_REAL_OBJ} ancs_client.c ${CFLAGS} ${LDFLAGS} -o $@
|
|
|
|
|
2014-04-29 19:45:40 +00:00
|
|
|
ble_peripheral: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_REAL_OBJ} ble_peripheral.c profile.h
|
|
|
|
${CC} ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_REAL_OBJ} ble_peripheral.c ${CFLAGS} ${LDFLAGS} -o $@
|
2014-01-08 12:04:11 +00:00
|
|
|
|
2014-07-31 15:03:04 +00:00
|
|
|
ble_peripheral_uart_csr: ${CORE_OBJ} ${COMMON_OBJ} ${CSR_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_REAL_OBJ} ble_peripheral.c profile.h
|
2014-06-08 21:47:27 +00:00
|
|
|
${CC} $ -DHAVE_UART_CSR ${CORE_OBJ} ${COMMON_OBJ} ${CSR_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_REAL_OBJ} ble_peripheral.c ${CFLAGS} ${LDFLAGS} -o $@
|
2014-07-31 15:03:04 +00:00
|
|
|
|
|
|
|
ble_peripheral_uart_cc256x: ${CORE_OBJ} ${COMMON_OBJ} ${CC2564} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_REAL_OBJ} ble_peripheral.c profile.h
|
|
|
|
${CC} $ -DHAVE_UART_CC256x ${CORE_OBJ} ${COMMON_OBJ} ${CC2564} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_REAL_OBJ} ble_peripheral.c ${CFLAGS} ${LDFLAGS} -o $@
|
2014-06-08 21:47:27 +00:00
|
|
|
|
2014-04-29 19:45:40 +00:00
|
|
|
ble_peripheral_sm_minimal: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_MINIMAL_OBJ} ble_peripheral.c profile.h
|
|
|
|
${CC} ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_MINIMAL_OBJ} ble_peripheral.c ${CFLAGS} ${LDFLAGS} -o $@
|
2013-06-10 10:43:53 +00:00
|
|
|
|
2014-06-19 22:20:43 +00:00
|
|
|
ble_client: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} ${SM_REAL} ble_client.c
|
|
|
|
${CC} ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} ${SM_REAL} ble_client.c ${CFLAGS} ${LDFLAGS} -o $@
|
2013-11-28 10:54:41 +00:00
|
|
|
|
2014-06-19 22:20:43 +00:00
|
|
|
gatt_browser: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} ${SM_REAL_OBJ} gatt_browser.c
|
|
|
|
${CC} ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} ${SM_REAL_OBJ} gatt_browser.c ${CFLAGS} ${LDFLAGS} -o $@
|
2014-05-30 15:14:31 +00:00
|
|
|
|
2013-06-10 10:43:53 +00:00
|
|
|
clean:
|
2014-08-29 21:25:46 +00:00
|
|
|
rm -f spp_counter sdp_rfcomm_query sdp_general_query sdp_bnep_query spp_counter_ssp ble_peripheral ble_client gatt_browser \
|
|
|
|
gatt_client ancs_client ble_peripheral_sm_minimal classic_test ble_peripheral_uart_csr ble_peripheral_uart \
|
|
|
|
gap_dedicated_bonding gap_inquiry gap_inquiry_and_bond l2cap_test spp_and_le_counter spp_streamer
|
2013-11-08 14:36:48 +00:00
|
|
|
rm -f *.o *.out *.hex
|
2013-11-01 15:31:00 +00:00
|
|
|
rm -f ${BTSTACK_ROOT}/src/*.o
|
|
|
|
rm -f ${BTSTACK_ROOT}/ble/*.o
|
2013-06-10 10:43:53 +00:00
|
|
|
rm -f ${BTSTACK_ROOT}/chipset-cc256x/*.o
|
2014-09-02 21:56:37 +00:00
|
|
|
rm -f ${BTSTACK_ROOT}/include/btstack/version.h
|
|
|
|
rm -f ${BTSTACK_ROOT}/example/libusb/ancs_client.h
|
|
|
|
rm -f ${BTSTACK_ROOT}/example/libusb/profile.h
|
|
|
|
rm -f ${BTSTACK_ROOT}/example/libusb/spp_and_le_counter.h
|
2013-06-10 10:43:53 +00:00
|
|
|
rm -rf *.dSYM
|
2014-09-02 21:56:37 +00:00
|
|
|
|