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 107c1bc0b8eSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/md5 1086420389dSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/yxml 109f39cc24dSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/micro-ecc 1106b7adbe5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/embedded 1116b7adbe5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src/ble/gatt-service/ 1126b7adbe5SMatthias Ringwald 1136b7adbe5SMatthias RingwaldPROJ_CFLAGS += \ 1146b7adbe5SMatthias Ringwald -I$(BTSTACK_ROOT)/src \ 1156b7adbe5SMatthias Ringwald -I$(BTSTACK_ROOT)/src/ble \ 1166b7adbe5SMatthias Ringwald -I$(BTSTACK_ROOT)/src/classic \ 1176b7adbe5SMatthias Ringwald -I$(BTSTACK_ROOT)/chipset/cc256x \ 1186b7adbe5SMatthias Ringwald -I$(BTSTACK_ROOT)/platform/embedded \ 1196b7adbe5SMatthias Ringwald -I${BTSTACK_ROOT}/port/pegasus-max3263x \ 1206b7adbe5SMatthias Ringwald -I${BTSTACK_ROOT}/src/ble/gatt-service/ \ 121f39cc24dSMatthias Ringwald -I${BTSTACK_ROOT}/example \ 122f39cc24dSMatthias Ringwald -I${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/include \ 123f39cc24dSMatthias Ringwald -I${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/include \ 124c1bc0b8eSMatthias Ringwald -I${BTSTACK_ROOT}/3rd-party/md5 \ 1256420389dSMatthias Ringwald -I${BTSTACK_ROOT}/3rd-party/yxml \ 12684e26812SMatthias Ringwald -I${BTSTACK_ROOT}/3rd-party/micro-ecc \ 127f39cc24dSMatthias Ringwald -I${BTSTACK_ROOT}/3rd-party/hxcmod-player \ 128f39cc24dSMatthias Ringwald 1296b7adbe5SMatthias Ringwald 1306b7adbe5SMatthias RingwaldCORE = \ 1316b7adbe5SMatthias Ringwald ad_parser.o \ 1326b7adbe5SMatthias Ringwald btstack_linked_list.o \ 1336b7adbe5SMatthias Ringwald btstack_memory.o \ 1346b7adbe5SMatthias Ringwald btstack_memory_pool.o \ 1356b7adbe5SMatthias Ringwald btstack_run_loop.o \ 1366b7adbe5SMatthias Ringwald btstack_util.o \ 1376b7adbe5SMatthias Ringwald l2cap.o \ 1386b7adbe5SMatthias Ringwald l2cap_signaling.o \ 1396b7adbe5SMatthias Ringwald btstack_run_loop_embedded.o \ 1406b7adbe5SMatthias Ringwald $(CC2564B) \ 1416b7adbe5SMatthias Ringwald hci_transport_h4.o 1426b7adbe5SMatthias Ringwald 1436b7adbe5SMatthias RingwaldCOMMON = \ 1446b7adbe5SMatthias Ringwald btstack_chipset_cc256x.o \ 1456b7adbe5SMatthias Ringwald hci.o \ 1466b7adbe5SMatthias Ringwald hci_cmd.o \ 1476b7adbe5SMatthias Ringwald hci_dump.o \ 1485efdcd7dSMatthias Ringwald btstack_uart_block_embedded.o \ 14917ae5bc4SMatthias Ringwald hal_flash_bank_mxc.o \ 150b88bf5bfSMatthias Ringwald btstack_audio.o \ 151e07b53a6SMatthias Ringwald btstack_tlv.o \ 15217ae5bc4SMatthias Ringwald btstack_tlv_flash_bank.o \ 15384e26812SMatthias Ringwald btstack_stdin_embedded.o \ 154631785acSMatthias Ringwald btstack_crypto.o \ 1556b7adbe5SMatthias Ringwald 1566b7adbe5SMatthias RingwaldCLASSIC = \ 1575efdcd7dSMatthias Ringwald btstack_link_key_db_tlv.o \ 1586b7adbe5SMatthias Ringwald rfcomm.o \ 1596b7adbe5SMatthias Ringwald sdp_util.o \ 1606b7adbe5SMatthias Ringwald spp_server.o \ 1616b7adbe5SMatthias Ringwald sdp_server.o \ 1626b7adbe5SMatthias Ringwald sdp_client.o \ 1636b7adbe5SMatthias Ringwald sdp_client_rfcomm.o 1646b7adbe5SMatthias Ringwald 1656b7adbe5SMatthias RingwaldBLE = \ 1666b7adbe5SMatthias Ringwald att_db.o \ 1676b7adbe5SMatthias Ringwald att_server.o \ 1685efdcd7dSMatthias Ringwald le_device_db_tlv.o \ 1696b7adbe5SMatthias Ringwald att_dispatch.o \ 170f39cc24dSMatthias Ringwald sm.o \ 171f39cc24dSMatthias Ringwald ancs_client.o \ 172f39cc24dSMatthias Ringwald gatt_client.o \ 173f39cc24dSMatthias Ringwald hid_device.o \ 17484e26812SMatthias Ringwald battery_service_server.o \ 17584e26812SMatthias Ringwald uECC.o \ 176f39cc24dSMatthias Ringwald 177f39cc24dSMatthias RingwaldAVDTP += \ 178f39cc24dSMatthias Ringwald avdtp_util.c \ 179f39cc24dSMatthias Ringwald avdtp.c \ 180f39cc24dSMatthias Ringwald avdtp_initiator.c \ 181f39cc24dSMatthias Ringwald avdtp_acceptor.c \ 182f39cc24dSMatthias Ringwald avdtp_source.c \ 183f39cc24dSMatthias Ringwald avdtp_sink.c \ 184f39cc24dSMatthias Ringwald a2dp_source.c \ 185f39cc24dSMatthias Ringwald a2dp_sink.c \ 186f39cc24dSMatthias Ringwald btstack_ring_buffer.c \ 187*e9c5f44eSMatthias Ringwald btstack_resample.c \ 188f39cc24dSMatthias Ringwald avrcp.c \ 18984e26812SMatthias Ringwald avrcp_target.c \ 19084e26812SMatthias Ringwald avrcp_controller.c \ 191f39cc24dSMatthias Ringwald 192f39cc24dSMatthias RingwaldHFP_OBJ += sco_demo_util.o btstack_ring_buffer.o hfp.o hfp_gsm_model.o hfp_ag.o hfp_hf.o 193f39cc24dSMatthias Ringwald 194f39cc24dSMatthias Ringwald# List of files for Bluedroid SBC codec 195f39cc24dSMatthias Ringwaldinclude ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/Makefile.inc 196f39cc24dSMatthias Ringwaldinclude ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/Makefile.inc 197f39cc24dSMatthias Ringwald 198f39cc24dSMatthias RingwaldSBC_DECODER += \ 199f39cc24dSMatthias Ringwald btstack_sbc_plc.c \ 200c37cd8f3SMatthias Ringwald btstack_sbc_decoder_bluedroid.c \ 201f39cc24dSMatthias Ringwald 202f39cc24dSMatthias RingwaldSBC_ENCODER += \ 203c37cd8f3SMatthias Ringwald btstack_sbc_encoder_bluedroid.c \ 204f39cc24dSMatthias Ringwald hfp_msbc.c \ 205f39cc24dSMatthias Ringwald 206f39cc24dSMatthias RingwaldHXCMOD_PLAYER = \ 207f39cc24dSMatthias Ringwald hxcmod.c \ 208f39cc24dSMatthias Ringwald nao-deceased_by_disease.c \ 209f39cc24dSMatthias Ringwald 2106b7adbe5SMatthias Ringwald 2116b7adbe5SMatthias RingwaldADDITION = 2126b7adbe5SMatthias Ringwald 2136b7adbe5SMatthias RingwaldCORE_OBJ = $(CORE:.c=.o) 2146b7adbe5SMatthias RingwaldCOMMON_OBJ = $(COMMON:.c=.o) 2156b7adbe5SMatthias RingwaldBLE_OBJ = $(BLE:.c=.o) 2166b7adbe5SMatthias RingwaldCLASSIC_OBJ = $(CLASSIC:.c=.o) 217f39cc24dSMatthias RingwaldAVDTP_OBJ = $(AVDTP:.c=.o) 218f39cc24dSMatthias RingwaldSBC_DECODER_OBJ = $(SBC_DECODER:.c=.o) 219f39cc24dSMatthias RingwaldSBC_ENCODER_OBJ = $(SBC_ENCODER:.c=.o) 220f39cc24dSMatthias RingwaldCVSD_PLC_OBJ = $(CVSD_PLC:.c=.o) 221f39cc24dSMatthias RingwaldHXCMOD_PLAYER_OBJ = $(HXCMOD_PLAYER:.c=.o) 2226b7adbe5SMatthias Ringwald 2236b7adbe5SMatthias RingwaldSRCS += $(CORE_OBJ) 2246b7adbe5SMatthias RingwaldSRCS += $(COMMON_OBJ) 2256b7adbe5SMatthias RingwaldSRCS += $(BLE_OBJ) 2266b7adbe5SMatthias RingwaldSRCS += $(CLASSIC_OBJ) 227f39cc24dSMatthias RingwaldSRCS += $(AVDTP_OBJ) 228f39cc24dSMatthias RingwaldSRCS += $(SBC_DECODER_OBJ) 229f39cc24dSMatthias RingwaldSRCS += $(SBC_ENCODER_OBJ) 230f39cc24dSMatthias RingwaldSRCS += $(CVSD_PLC_OBJ) 231f39cc24dSMatthias RingwaldSRCS += $(HXCMOD_PLAYER_OBJ) 232f39cc24dSMatthias RingwaldSRCS += $(HFP_OBJ) 233f39cc24dSMatthias RingwaldSRCS += hsp_hs.o hsp_ag.o 2346420389dSMatthias RingwaldSRCS += obex_iterator.o goep_client.o pbap_client.o md5.o yxml.o 2356b7adbe5SMatthias Ringwald 2366b7adbe5SMatthias Ringwald# Enable assertion checking for development 2376b7adbe5SMatthias RingwaldPROJ_CFLAGS+=-DMXC_ASSERT_ENABLE 2386b7adbe5SMatthias Ringwald 2396b7adbe5SMatthias Ringwald# Use this variables to specify and alternate tool path 2406b7adbe5SMatthias Ringwald#TOOL_DIR=/opt/gcc-arm-none-eabi-4_8-2013q4/bin 2416b7adbe5SMatthias Ringwald 2426b7adbe5SMatthias Ringwald# Use these variables to add project specific tool options 2436b7adbe5SMatthias Ringwald#PROJ_CFLAGS+=--specs=nano.specs 2446b7adbe5SMatthias Ringwald#PROJ_LDFLAGS+=--specs=nano.specs 2456b7adbe5SMatthias Ringwald 2466b7adbe5SMatthias Ringwald# Point this variable to a startup file to override the default file 2476b7adbe5SMatthias Ringwald#STARTUPFILE=start.S 2486b7adbe5SMatthias Ringwald 2496b7adbe5SMatthias Ringwald# Point this variable to a linker file to override the default file 2506b7adbe5SMatthias Ringwald# LINKERFILE=$(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/GCC/$(TARGET_LC).ld 2516b7adbe5SMatthias Ringwald 2526b7adbe5SMatthias Ringwald%.h: %.gatt 2536b7adbe5SMatthias Ringwald python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ 2546b7adbe5SMatthias Ringwald 2556b7adbe5SMatthias Ringwaldall: spp_and_le_streamer.h 2566b7adbe5SMatthias Ringwald 2576b7adbe5SMatthias Ringwald# Include the peripheral driver 2586b7adbe5SMatthias RingwaldPERIPH_DRIVER_DIR=$(LIBS_DIR)/$(TARGET_UC)PeriphDriver 2596b7adbe5SMatthias Ringwaldinclude $(PERIPH_DRIVER_DIR)/periphdriver.mk 2606b7adbe5SMatthias Ringwald 2616b7adbe5SMatthias Ringwald################################################################################ 2626b7adbe5SMatthias Ringwald# Include the rules for building for this target. All other makefiles should be 2636b7adbe5SMatthias Ringwald# included before this one. 2646b7adbe5SMatthias Ringwaldinclude $(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/$(COMPILER)/$(TARGET_LC).mk 2656b7adbe5SMatthias Ringwald 2666b7adbe5SMatthias Ringwald# fetch and convert init scripts 2676b7adbe5SMatthias Ringwald# use bluetooth_init_cc2564B_1.6_BT_Spec_4.1.c 26864697164SMatthias Ringwaldinclude ${BTSTACK_ROOT}/chipset/cc256x/Makefile.inc 2696b7adbe5SMatthias Ringwald 2706b7adbe5SMatthias Ringwaldrm-compiled-gatt-file: 2716b7adbe5SMatthias Ringwald rm -f spp_and_le_counter.h 2726b7adbe5SMatthias Ringwald 2736b7adbe5SMatthias Ringwaldclean: rm-compiled-gatt-file 2746b7adbe5SMatthias Ringwald 2756b7adbe5SMatthias Ringwald# The rule to clean out all the build products. 2766b7adbe5SMatthias Ringwalddistclean: clean 2776b7adbe5SMatthias Ringwald $(MAKE) -C ${PERIPH_DRIVER_DIR} clean 278