16b7adbe5SMatthias Ringwald################################################################################ 26b7adbe5SMatthias Ringwald # Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. 36b7adbe5SMatthias Ringwald # Ismail H. Kose <[email protected]> 46b7adbe5SMatthias Ringwald # Permission is hereby granted, free of charge, to any person obtaining a 56b7adbe5SMatthias Ringwald # copy of this software and associated documentation files (the "Software"), 66b7adbe5SMatthias Ringwald # to deal in the Software without restriction, including without limitation 76b7adbe5SMatthias Ringwald # the rights to use, copy, modify, merge, publish, distribute, sublicense, 86b7adbe5SMatthias Ringwald # and/or sell copies of the Software, and to permit persons to whom the 96b7adbe5SMatthias Ringwald # Software is furnished to do so, subject to the following conditions: 106b7adbe5SMatthias Ringwald # 116b7adbe5SMatthias Ringwald # The above copyright notice and this permission notice shall be included 126b7adbe5SMatthias Ringwald # in all copies or substantial portions of the Software. 136b7adbe5SMatthias Ringwald # 146b7adbe5SMatthias Ringwald # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 156b7adbe5SMatthias Ringwald # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 166b7adbe5SMatthias Ringwald # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 176b7adbe5SMatthias Ringwald # IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES 186b7adbe5SMatthias Ringwald # OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 196b7adbe5SMatthias Ringwald # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 206b7adbe5SMatthias Ringwald # OTHER DEALINGS IN THE SOFTWARE. 216b7adbe5SMatthias Ringwald # 226b7adbe5SMatthias Ringwald # Except as contained in this notice, the name of Maxim Integrated 236b7adbe5SMatthias Ringwald # Products, Inc. shall not be used except as stated in the Maxim Integrated 246b7adbe5SMatthias Ringwald # Products, Inc. Branding Policy. 256b7adbe5SMatthias Ringwald # 266b7adbe5SMatthias Ringwald # The mere transfer of this software does not imply any licenses 276b7adbe5SMatthias Ringwald # of trade secrets, proprietary technology, copyrights, patents, 286b7adbe5SMatthias Ringwald # trademarks, maskwork rights, or any other form of intellectual 296b7adbe5SMatthias Ringwald # property whatsoever. Maxim Integrated Products, Inc. retains all 306b7adbe5SMatthias Ringwald # ownership rights. 316b7adbe5SMatthias Ringwald # 326b7adbe5SMatthias Ringwald # $Date: 2016-03-23 13:28:53 -0700 (Wed, 23 Mar 2016) $ 336b7adbe5SMatthias Ringwald # $Revision: 22067 $ 346b7adbe5SMatthias Ringwald # 356b7adbe5SMatthias Ringwald ############################################################################### 366b7adbe5SMatthias Ringwald 376b7adbe5SMatthias Ringwald# Maxim ARM Toolchain and Libraries 386b7adbe5SMatthias Ringwald# https://www.maximintegrated.com/en/products/digital/microcontrollers/MAX32630.html 396b7adbe5SMatthias Ringwald 406b7adbe5SMatthias Ringwald# This is the name of the build output file 416b7adbe5SMatthias RingwaldPROJECT=spp_and_le_streamer 426b7adbe5SMatthias Ringwald 436b7adbe5SMatthias Ringwald# Specify the target processor 446b7adbe5SMatthias RingwaldTARGET=MAX3263x 456b7adbe5SMatthias RingwaldPROJ_CFLAGS+=-DRO_FREQ=96000000 4679714be8SMatthias RingwaldPROJ_CFLAGS+=-g3 -ggdb -DDEBUG 4779714be8SMatthias RingwaldCPPFLAGS+=-g3 -ggdb -DDEBUG 486b7adbe5SMatthias Ringwald 496b7adbe5SMatthias Ringwald# Create Target name variables 506b7adbe5SMatthias RingwaldTARGET_UC:=$(shell echo $(TARGET) | tr a-z A-Z) 516b7adbe5SMatthias RingwaldTARGET_LC:=$(shell echo $(TARGET) | tr A-Z a-z) 526b7adbe5SMatthias Ringwald 536b7adbe5SMatthias RingwaldCC2564B = bluetooth_init_cc2564B_1.6_BT_Spec_4.1.o 546b7adbe5SMatthias Ringwald 556b7adbe5SMatthias Ringwald# Select 'GCC' or 'IAR' compiler 566b7adbe5SMatthias RingwaldCOMPILER=GCC 576b7adbe5SMatthias Ringwald 586b7adbe5SMatthias Ringwaldifeq "$(MAXIM_PATH)" "" 596b7adbe5SMatthias RingwaldLIBS_DIR=/$(subst \,/,$(subst :,,$(HOME))/Maxim/Firmware/$(TARGET_UC)/Libraries) 606b7adbe5SMatthias Ringwald$(warning "MAXIM_PATH need to be set. Please run setenv bash file in the Maxim Toolchain directory.") 616b7adbe5SMatthias Ringwaldelse 626b7adbe5SMatthias RingwaldLIBS_DIR=/$(subst \,/,$(subst :,,$(MAXIM_PATH))/Firmware/$(TARGET_UC)/Libraries) 636b7adbe5SMatthias Ringwaldendif 646b7adbe5SMatthias Ringwald 656b7adbe5SMatthias RingwaldCMSIS_ROOT=$(LIBS_DIR)/CMSIS 666b7adbe5SMatthias Ringwald 676b7adbe5SMatthias Ringwald# Where to find source files for this test 686b7adbe5SMatthias RingwaldVPATH= . ../../src 696b7adbe5SMatthias Ringwald 706b7adbe5SMatthias Ringwald# Where to find header files for this test 716b7adbe5SMatthias RingwaldIPATH= . ../../src 726b7adbe5SMatthias Ringwald 736b7adbe5SMatthias RingwaldBOARD_DIR=$(LIBS_DIR)/Boards 746b7adbe5SMatthias Ringwald 756b7adbe5SMatthias RingwaldIPATH += ../../board/ 766b7adbe5SMatthias RingwaldVPATH += ../../board/ 776b7adbe5SMatthias Ringwald 786b7adbe5SMatthias Ringwald# Source files for this test (add path to VPATH below) 796b7adbe5SMatthias RingwaldSRCS = main.c 806b7adbe5SMatthias RingwaldSRCS += hal_tick.c 816b7adbe5SMatthias RingwaldSRCS += btstack_port.c 826b7adbe5SMatthias RingwaldSRCS += ${PROJECT}.c 836b7adbe5SMatthias RingwaldSRCS += board.c 846b7adbe5SMatthias RingwaldSRCS += stdio.c 856b7adbe5SMatthias RingwaldSRCS += led.c 866b7adbe5SMatthias RingwaldSRCS += pb.c 876b7adbe5SMatthias RingwaldSRCS += max14690n.c 886b7adbe5SMatthias Ringwald 896b7adbe5SMatthias Ringwald# Where to find BSP source files 906b7adbe5SMatthias RingwaldVPATH += $(BOARD_DIR)/Source 916b7adbe5SMatthias Ringwald 926b7adbe5SMatthias Ringwald# Where to find BSP header files 936b7adbe5SMatthias RingwaldIPATH += $(BOARD_DIR)/Include 946b7adbe5SMatthias Ringwald 956b7adbe5SMatthias Ringwald# BTstack 966b7adbe5SMatthias RingwaldBTSTACK_ROOT = ../../../.. 97f39cc24dSMatthias RingwaldVPATH += $(BTSTACK_ROOT)/chipset/cc256x 98f39cc24dSMatthias RingwaldVPATH += $(BTSTACK_ROOT)/example 99f39cc24dSMatthias RingwaldVPATH += $(BTSTACK_ROOT)/port/pegasus-max3263x 1006b7adbe5SMatthias RingwaldVPATH += $(BTSTACK_ROOT)/src 1016b7adbe5SMatthias RingwaldVPATH += $(BTSTACK_ROOT)/src/ble 1026b7adbe5SMatthias RingwaldVPATH += $(BTSTACK_ROOT)/src/classic 103f39cc24dSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/srce 104f39cc24dSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/srce 105f39cc24dSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/hxcmod-player 106f39cc24dSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/hxcmod-player/mods 107f39cc24dSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/micro-ecc 1086b7adbe5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/embedded 1096b7adbe5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src/ble/gatt-service/ 1106b7adbe5SMatthias Ringwald 1116b7adbe5SMatthias RingwaldPROJ_CFLAGS += \ 1126b7adbe5SMatthias Ringwald -I$(BTSTACK_ROOT)/src \ 1136b7adbe5SMatthias Ringwald -I$(BTSTACK_ROOT)/src/ble \ 1146b7adbe5SMatthias Ringwald -I$(BTSTACK_ROOT)/src/classic \ 1156b7adbe5SMatthias Ringwald -I$(BTSTACK_ROOT)/chipset/cc256x \ 1166b7adbe5SMatthias Ringwald -I$(BTSTACK_ROOT)/platform/embedded \ 1176b7adbe5SMatthias Ringwald -I${BTSTACK_ROOT}/port/pegasus-max3263x \ 1186b7adbe5SMatthias Ringwald -I${BTSTACK_ROOT}/src/ble/gatt-service/ \ 119f39cc24dSMatthias Ringwald -I${BTSTACK_ROOT}/example \ 120f39cc24dSMatthias Ringwald -I${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/include \ 121f39cc24dSMatthias Ringwald -I${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/include \ 12284e26812SMatthias Ringwald -I${BTSTACK_ROOT}/3rd-party/micro-ecc \ 123f39cc24dSMatthias Ringwald -I${BTSTACK_ROOT}/3rd-party/hxcmod-player \ 124f39cc24dSMatthias Ringwald 1256b7adbe5SMatthias Ringwald 1266b7adbe5SMatthias RingwaldCORE = \ 1276b7adbe5SMatthias Ringwald ad_parser.o \ 1286b7adbe5SMatthias Ringwald btstack_linked_list.o \ 1296b7adbe5SMatthias Ringwald btstack_memory.o \ 1306b7adbe5SMatthias Ringwald btstack_memory_pool.o \ 1316b7adbe5SMatthias Ringwald btstack_run_loop.o \ 1326b7adbe5SMatthias Ringwald btstack_util.o \ 1336b7adbe5SMatthias Ringwald l2cap.o \ 1346b7adbe5SMatthias Ringwald l2cap_signaling.o \ 1356b7adbe5SMatthias Ringwald btstack_run_loop_embedded.o \ 1366b7adbe5SMatthias Ringwald $(CC2564B) \ 1376b7adbe5SMatthias Ringwald hci_transport_h4.o 1386b7adbe5SMatthias Ringwald 1396b7adbe5SMatthias RingwaldCOMMON = \ 1406b7adbe5SMatthias Ringwald btstack_chipset_cc256x.o \ 1416b7adbe5SMatthias Ringwald hci.o \ 1426b7adbe5SMatthias Ringwald hci_cmd.o \ 1436b7adbe5SMatthias Ringwald hci_dump.o \ 1445efdcd7dSMatthias Ringwald btstack_uart_block_embedded.o \ 14517ae5bc4SMatthias Ringwald hal_flash_bank_mxc.o \ 146e07b53a6SMatthias Ringwald btstack_tlv.o \ 14717ae5bc4SMatthias Ringwald btstack_tlv_flash_bank.o \ 14884e26812SMatthias Ringwald btstack_stdin_embedded.o \ 1496b7adbe5SMatthias Ringwald 1506b7adbe5SMatthias RingwaldCLASSIC = \ 1515efdcd7dSMatthias Ringwald btstack_link_key_db_tlv.o \ 1526b7adbe5SMatthias Ringwald rfcomm.o \ 1536b7adbe5SMatthias Ringwald sdp_util.o \ 1546b7adbe5SMatthias Ringwald spp_server.o \ 1556b7adbe5SMatthias Ringwald sdp_server.o \ 1566b7adbe5SMatthias Ringwald sdp_client.o \ 1576b7adbe5SMatthias Ringwald sdp_client_rfcomm.o 1586b7adbe5SMatthias Ringwald 1596b7adbe5SMatthias RingwaldBLE = \ 1606b7adbe5SMatthias Ringwald att_db.o \ 1616b7adbe5SMatthias Ringwald att_server.o \ 1625efdcd7dSMatthias Ringwald le_device_db_tlv.o \ 1636b7adbe5SMatthias Ringwald att_dispatch.o \ 164f39cc24dSMatthias Ringwald sm.o \ 165f39cc24dSMatthias Ringwald ancs_client.o \ 166f39cc24dSMatthias Ringwald gatt_client.o \ 167f39cc24dSMatthias Ringwald hid_device.o \ 16884e26812SMatthias Ringwald battery_service_server.o \ 16984e26812SMatthias Ringwald uECC.o \ 170f39cc24dSMatthias Ringwald 171f39cc24dSMatthias RingwaldAVDTP += \ 172f39cc24dSMatthias Ringwald avdtp_util.c \ 173f39cc24dSMatthias Ringwald avdtp.c \ 174f39cc24dSMatthias Ringwald avdtp_initiator.c \ 175f39cc24dSMatthias Ringwald avdtp_acceptor.c \ 176f39cc24dSMatthias Ringwald avdtp_source.c \ 177f39cc24dSMatthias Ringwald avdtp_sink.c \ 178f39cc24dSMatthias Ringwald a2dp_source.c \ 179f39cc24dSMatthias Ringwald a2dp_sink.c \ 180f39cc24dSMatthias Ringwald btstack_ring_buffer.c \ 181f39cc24dSMatthias Ringwald avrcp.c \ 18284e26812SMatthias Ringwald avrcp_target.c \ 18384e26812SMatthias Ringwald avrcp_controller.c \ 184f39cc24dSMatthias Ringwald 185f39cc24dSMatthias RingwaldHFP_OBJ += sco_demo_util.o btstack_ring_buffer.o hfp.o hfp_gsm_model.o hfp_ag.o hfp_hf.o 186f39cc24dSMatthias Ringwald 187f39cc24dSMatthias Ringwald# List of files for Bluedroid SBC codec 188f39cc24dSMatthias Ringwaldinclude ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/Makefile.inc 189f39cc24dSMatthias Ringwaldinclude ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/Makefile.inc 190f39cc24dSMatthias Ringwald 191f39cc24dSMatthias RingwaldSBC_DECODER += \ 192f39cc24dSMatthias Ringwald btstack_sbc_plc.c \ 193*c37cd8f3SMatthias Ringwald btstack_sbc_decoder_bluedroid.c \ 194f39cc24dSMatthias Ringwald 195f39cc24dSMatthias RingwaldSBC_ENCODER += \ 196*c37cd8f3SMatthias Ringwald btstack_sbc_encoder_bluedroid.c \ 197f39cc24dSMatthias Ringwald hfp_msbc.c \ 198f39cc24dSMatthias Ringwald 199f39cc24dSMatthias RingwaldHXCMOD_PLAYER = \ 200f39cc24dSMatthias Ringwald hxcmod.c \ 201f39cc24dSMatthias Ringwald nao-deceased_by_disease.c \ 202f39cc24dSMatthias Ringwald 2036b7adbe5SMatthias Ringwald 2046b7adbe5SMatthias RingwaldADDITION = 2056b7adbe5SMatthias Ringwald 2066b7adbe5SMatthias RingwaldCORE_OBJ = $(CORE:.c=.o) 2076b7adbe5SMatthias RingwaldCOMMON_OBJ = $(COMMON:.c=.o) 2086b7adbe5SMatthias RingwaldBLE_OBJ = $(BLE:.c=.o) 2096b7adbe5SMatthias RingwaldCLASSIC_OBJ = $(CLASSIC:.c=.o) 210f39cc24dSMatthias RingwaldAVDTP_OBJ = $(AVDTP:.c=.o) 211f39cc24dSMatthias RingwaldSBC_DECODER_OBJ = $(SBC_DECODER:.c=.o) 212f39cc24dSMatthias RingwaldSBC_ENCODER_OBJ = $(SBC_ENCODER:.c=.o) 213f39cc24dSMatthias RingwaldCVSD_PLC_OBJ = $(CVSD_PLC:.c=.o) 214f39cc24dSMatthias RingwaldHXCMOD_PLAYER_OBJ = $(HXCMOD_PLAYER:.c=.o) 2156b7adbe5SMatthias Ringwald 2166b7adbe5SMatthias RingwaldSRCS += $(CORE_OBJ) 2176b7adbe5SMatthias RingwaldSRCS += $(COMMON_OBJ) 2186b7adbe5SMatthias RingwaldSRCS += $(BLE_OBJ) 2196b7adbe5SMatthias RingwaldSRCS += $(CLASSIC_OBJ) 220f39cc24dSMatthias RingwaldSRCS += $(AVDTP_OBJ) 221f39cc24dSMatthias RingwaldSRCS += $(SBC_DECODER_OBJ) 222f39cc24dSMatthias RingwaldSRCS += $(SBC_ENCODER_OBJ) 223f39cc24dSMatthias RingwaldSRCS += $(CVSD_PLC_OBJ) 224f39cc24dSMatthias RingwaldSRCS += $(HXCMOD_PLAYER_OBJ) 225f39cc24dSMatthias RingwaldSRCS += $(HFP_OBJ) 226f39cc24dSMatthias RingwaldSRCS += hsp_hs.o hsp_ag.o 227f39cc24dSMatthias RingwaldSRCS += obex_iterator.o goep_client.o pbap_client.o 2286b7adbe5SMatthias Ringwald 2296b7adbe5SMatthias Ringwald# Enable assertion checking for development 2306b7adbe5SMatthias RingwaldPROJ_CFLAGS+=-DMXC_ASSERT_ENABLE 2316b7adbe5SMatthias Ringwald 2326b7adbe5SMatthias Ringwald# Use this variables to specify and alternate tool path 2336b7adbe5SMatthias Ringwald#TOOL_DIR=/opt/gcc-arm-none-eabi-4_8-2013q4/bin 2346b7adbe5SMatthias Ringwald 2356b7adbe5SMatthias Ringwald# Use these variables to add project specific tool options 2366b7adbe5SMatthias Ringwald#PROJ_CFLAGS+=--specs=nano.specs 2376b7adbe5SMatthias Ringwald#PROJ_LDFLAGS+=--specs=nano.specs 2386b7adbe5SMatthias Ringwald 2396b7adbe5SMatthias Ringwald# Point this variable to a startup file to override the default file 2406b7adbe5SMatthias Ringwald#STARTUPFILE=start.S 2416b7adbe5SMatthias Ringwald 2426b7adbe5SMatthias Ringwald# Point this variable to a linker file to override the default file 2436b7adbe5SMatthias Ringwald# LINKERFILE=$(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/GCC/$(TARGET_LC).ld 2446b7adbe5SMatthias Ringwald 2456b7adbe5SMatthias Ringwald%.h: %.gatt 2466b7adbe5SMatthias Ringwald python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ 2476b7adbe5SMatthias Ringwald 2486b7adbe5SMatthias Ringwaldall: spp_and_le_streamer.h 2496b7adbe5SMatthias Ringwald 2506b7adbe5SMatthias Ringwald# Include the peripheral driver 2516b7adbe5SMatthias RingwaldPERIPH_DRIVER_DIR=$(LIBS_DIR)/$(TARGET_UC)PeriphDriver 2526b7adbe5SMatthias Ringwaldinclude $(PERIPH_DRIVER_DIR)/periphdriver.mk 2536b7adbe5SMatthias Ringwald 2546b7adbe5SMatthias Ringwald################################################################################ 2556b7adbe5SMatthias Ringwald# Include the rules for building for this target. All other makefiles should be 2566b7adbe5SMatthias Ringwald# included before this one. 2576b7adbe5SMatthias Ringwaldinclude $(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/$(COMPILER)/$(TARGET_LC).mk 2586b7adbe5SMatthias Ringwald 2596b7adbe5SMatthias Ringwald# fetch and convert init scripts 2606b7adbe5SMatthias Ringwald# use bluetooth_init_cc2564B_1.6_BT_Spec_4.1.c 2616b7adbe5SMatthias Ringwald# include ${BTSTACK_ROOT}/chipset/cc256x/Makefile.inc 2626b7adbe5SMatthias Ringwald 2636b7adbe5SMatthias Ringwald#include ${BTSTACK_ROOT}/example/Makefile.inc 2646b7adbe5SMatthias Ringwald 2656b7adbe5SMatthias Ringwaldrm-compiled-gatt-file: 2666b7adbe5SMatthias Ringwald rm -f spp_and_le_counter.h 2676b7adbe5SMatthias Ringwald 2686b7adbe5SMatthias Ringwaldclean: rm-compiled-gatt-file 2696b7adbe5SMatthias Ringwald 2706b7adbe5SMatthias Ringwald# The rule to clean out all the build products. 2716b7adbe5SMatthias Ringwalddistclean: clean 2726b7adbe5SMatthias Ringwald $(MAKE) -C ${PERIPH_DRIVER_DIR} clean 273