1################################################################################ 2 # Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. 3 # Ismail H. Kose <[email protected]> 4 # Permission is hereby granted, free of charge, to any person obtaining a 5 # copy of this software and associated documentation files (the "Software"), 6 # to deal in the Software without restriction, including without limitation 7 # the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 # and/or sell copies of the Software, and to permit persons to whom the 9 # Software is furnished to do so, subject to the following conditions: 10 # 11 # The above copyright notice and this permission notice shall be included 12 # in all copies or substantial portions of the Software. 13 # 14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 # IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES 18 # OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 # OTHER DEALINGS IN THE SOFTWARE. 21 # 22 # Except as contained in this notice, the name of Maxim Integrated 23 # Products, Inc. shall not be used except as stated in the Maxim Integrated 24 # Products, Inc. Branding Policy. 25 # 26 # The mere transfer of this software does not imply any licenses 27 # of trade secrets, proprietary technology, copyrights, patents, 28 # trademarks, maskwork rights, or any other form of intellectual 29 # property whatsoever. Maxim Integrated Products, Inc. retains all 30 # ownership rights. 31 # 32 # $Date: 2016-03-23 13:28:53 -0700 (Wed, 23 Mar 2016) $ 33 # $Revision: 22067 $ 34 # 35 ############################################################################### 36 37# Maxim ARM Toolchain and Libraries 38# https://www.maximintegrated.com/en/products/digital/microcontrollers/MAX32630.html 39 40# This is the name of the build output file 41PROJECT=spp_and_le_streamer 42 43# Specify the target processor 44TARGET=MAX3263x 45PROJ_CFLAGS+=-DRO_FREQ=96000000 46 47# Create Target name variables 48TARGET_UC:=$(shell echo $(TARGET) | tr a-z A-Z) 49TARGET_LC:=$(shell echo $(TARGET) | tr A-Z a-z) 50 51CC2564B = bluetooth_init_cc2564B_1.6_BT_Spec_4.1.o 52 53# Select 'GCC' or 'IAR' compiler 54COMPILER=GCC 55 56ifeq "$(MAXIM_PATH)" "" 57LIBS_DIR=/$(subst \,/,$(subst :,,$(HOME))/Maxim/Firmware/$(TARGET_UC)/Libraries) 58$(warning "MAXIM_PATH need to be set. Please run setenv bash file in the Maxim Toolchain directory.") 59else 60LIBS_DIR=/$(subst \,/,$(subst :,,$(MAXIM_PATH))/Firmware/$(TARGET_UC)/Libraries) 61endif 62 63CMSIS_ROOT=$(LIBS_DIR)/CMSIS 64 65# Where to find source files for this test 66VPATH= . ../../src 67 68# Where to find header files for this test 69IPATH= . ../../src 70 71BOARD_DIR=$(LIBS_DIR)/Boards 72 73IPATH += ../../board/ 74VPATH += ../../board/ 75 76# Source files for this test (add path to VPATH below) 77SRCS = main.c 78SRCS += hal_tick.c 79SRCS += btstack_port.c 80SRCS += ${PROJECT}.c 81SRCS += board.c 82SRCS += stdio.c 83SRCS += led.c 84SRCS += pb.c 85SRCS += max14690n.c 86 87# Where to find BSP source files 88VPATH += $(BOARD_DIR)/Source 89 90# Where to find BSP header files 91IPATH += $(BOARD_DIR)/Include 92 93# BTstack 94BTSTACK_ROOT = ../../../.. 95VPATH += $(BTSTACK_ROOT)/chipset/cc256x 96VPATH += $(BTSTACK_ROOT)/example 97VPATH += $(BTSTACK_ROOT)/port/pegasus-max3263x 98VPATH += $(BTSTACK_ROOT)/src 99VPATH += $(BTSTACK_ROOT)/src/ble 100VPATH += $(BTSTACK_ROOT)/src/classic 101VPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/srce 102VPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/srce 103VPATH += ${BTSTACK_ROOT}/3rd-party/hxcmod-player 104VPATH += ${BTSTACK_ROOT}/3rd-party/hxcmod-player/mods 105VPATH += ${BTSTACK_ROOT}/3rd-party/micro-ecc 106VPATH += ${BTSTACK_ROOT}/platform/embedded 107VPATH += ${BTSTACK_ROOT}/src/ble/gatt-service/ 108 109PROJ_CFLAGS += \ 110 -I$(BTSTACK_ROOT)/src \ 111 -I$(BTSTACK_ROOT)/src/ble \ 112 -I$(BTSTACK_ROOT)/src/classic \ 113 -I$(BTSTACK_ROOT)/chipset/cc256x \ 114 -I$(BTSTACK_ROOT)/platform/embedded \ 115 -I${BTSTACK_ROOT}/port/pegasus-max3263x \ 116 -I${BTSTACK_ROOT}/src/ble/gatt-service/ \ 117 -I${BTSTACK_ROOT}/example \ 118 -I${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/include \ 119 -I${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/include \ 120 -I${BTSTACK_ROOT}/3rd-party/hxcmod-player \ 121 122 123CORE = \ 124 ad_parser.o \ 125 btstack_linked_list.o \ 126 btstack_memory.o \ 127 btstack_memory_pool.o \ 128 btstack_run_loop.o \ 129 btstack_util.o \ 130 l2cap.o \ 131 l2cap_signaling.o \ 132 btstack_run_loop_embedded.o \ 133 $(CC2564B) \ 134 hci_transport_h4.o 135 136COMMON = \ 137 btstack_chipset_cc256x.o \ 138 hci.o \ 139 hci_cmd.o \ 140 hci_dump.o \ 141 btstack_uart_block_embedded.o 142 143CLASSIC = \ 144 btstack_link_key_db_memory.o \ 145 rfcomm.o \ 146 sdp_util.o \ 147 spp_server.o \ 148 sdp_server.o \ 149 sdp_client.o \ 150 sdp_client_rfcomm.o 151 152BLE = \ 153 att_db.o \ 154 att_server.o \ 155 le_device_db_memory.o \ 156 att_dispatch.o \ 157 sm.o \ 158 ancs_client.o \ 159 gatt_client.o \ 160 hid_device.o \ 161 battery_service_server.o 162 163AVDTP += \ 164 avdtp_util.c \ 165 avdtp.c \ 166 avdtp_initiator.c \ 167 avdtp_acceptor.c \ 168 avdtp_source.c \ 169 avdtp_sink.c \ 170 a2dp_source.c \ 171 a2dp_sink.c \ 172 btstack_ring_buffer.c \ 173 avrcp.c \ 174 175HFP_OBJ += sco_demo_util.o btstack_ring_buffer.o hfp.o hfp_gsm_model.o hfp_ag.o hfp_hf.o 176 177# List of files for Bluedroid SBC codec 178include ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/Makefile.inc 179include ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/Makefile.inc 180 181SBC_DECODER += \ 182 btstack_sbc_plc.c \ 183 btstack_sbc_bludroid.c \ 184 185SBC_ENCODER += \ 186 btstack_sbc_bludroid.c \ 187 hfp_msbc.c \ 188 189HXCMOD_PLAYER = \ 190 hxcmod.c \ 191 nao-deceased_by_disease.c \ 192 193 194ADDITION = 195 196CORE_OBJ = $(CORE:.c=.o) 197COMMON_OBJ = $(COMMON:.c=.o) 198BLE_OBJ = $(BLE:.c=.o) 199CLASSIC_OBJ = $(CLASSIC:.c=.o) 200AVDTP_OBJ = $(AVDTP:.c=.o) 201SBC_DECODER_OBJ = $(SBC_DECODER:.c=.o) 202SBC_ENCODER_OBJ = $(SBC_ENCODER:.c=.o) 203CVSD_PLC_OBJ = $(CVSD_PLC:.c=.o) 204HXCMOD_PLAYER_OBJ = $(HXCMOD_PLAYER:.c=.o) 205 206SRCS += $(CORE_OBJ) 207SRCS += $(COMMON_OBJ) 208SRCS += $(BLE_OBJ) 209SRCS += $(CLASSIC_OBJ) 210SRCS += $(AVDTP_OBJ) 211SRCS += $(SBC_DECODER_OBJ) 212SRCS += $(SBC_ENCODER_OBJ) 213SRCS += $(CVSD_PLC_OBJ) 214SRCS += $(HXCMOD_PLAYER_OBJ) 215SRCS += $(HFP_OBJ) 216SRCS += hsp_hs.o hsp_ag.o 217SRCS += obex_iterator.o goep_client.o pbap_client.o 218 219# Enable assertion checking for development 220PROJ_CFLAGS+=-DMXC_ASSERT_ENABLE 221 222# Use this variables to specify and alternate tool path 223#TOOL_DIR=/opt/gcc-arm-none-eabi-4_8-2013q4/bin 224 225# Use these variables to add project specific tool options 226#PROJ_CFLAGS+=--specs=nano.specs 227#PROJ_LDFLAGS+=--specs=nano.specs 228 229# Point this variable to a startup file to override the default file 230#STARTUPFILE=start.S 231 232# Point this variable to a linker file to override the default file 233# LINKERFILE=$(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/GCC/$(TARGET_LC).ld 234 235%.h: %.gatt 236 python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ 237 238all: spp_and_le_streamer.h 239 240# Include the peripheral driver 241PERIPH_DRIVER_DIR=$(LIBS_DIR)/$(TARGET_UC)PeriphDriver 242include $(PERIPH_DRIVER_DIR)/periphdriver.mk 243 244################################################################################ 245# Include the rules for building for this target. All other makefiles should be 246# included before this one. 247include $(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/$(COMPILER)/$(TARGET_LC).mk 248 249# fetch and convert init scripts 250# use bluetooth_init_cc2564B_1.6_BT_Spec_4.1.c 251# include ${BTSTACK_ROOT}/chipset/cc256x/Makefile.inc 252 253#include ${BTSTACK_ROOT}/example/Makefile.inc 254 255rm-compiled-gatt-file: 256 rm -f spp_and_le_counter.h 257 258clean: rm-compiled-gatt-file 259 260# The rule to clean out all the build products. 261distclean: clean 262 $(MAKE) -C ${PERIPH_DRIVER_DIR} clean 263