xref: /btstack/port/max32630-fthr/example/template/Makefile (revision f39cc24ddf47ef3b53a6356820670ba18c00d49f)
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
466b7adbe5SMatthias Ringwald
476b7adbe5SMatthias Ringwald# Create Target name variables
486b7adbe5SMatthias RingwaldTARGET_UC:=$(shell echo $(TARGET) | tr a-z A-Z)
496b7adbe5SMatthias RingwaldTARGET_LC:=$(shell echo $(TARGET) | tr A-Z a-z)
506b7adbe5SMatthias Ringwald
516b7adbe5SMatthias RingwaldCC2564B = bluetooth_init_cc2564B_1.6_BT_Spec_4.1.o
526b7adbe5SMatthias Ringwald
536b7adbe5SMatthias Ringwald# Select 'GCC' or 'IAR' compiler
546b7adbe5SMatthias RingwaldCOMPILER=GCC
556b7adbe5SMatthias Ringwald
566b7adbe5SMatthias Ringwaldifeq "$(MAXIM_PATH)" ""
576b7adbe5SMatthias RingwaldLIBS_DIR=/$(subst \,/,$(subst :,,$(HOME))/Maxim/Firmware/$(TARGET_UC)/Libraries)
586b7adbe5SMatthias Ringwald$(warning "MAXIM_PATH need to be set. Please run setenv bash file in the Maxim Toolchain directory.")
596b7adbe5SMatthias Ringwaldelse
606b7adbe5SMatthias RingwaldLIBS_DIR=/$(subst \,/,$(subst :,,$(MAXIM_PATH))/Firmware/$(TARGET_UC)/Libraries)
616b7adbe5SMatthias Ringwaldendif
626b7adbe5SMatthias Ringwald
636b7adbe5SMatthias RingwaldCMSIS_ROOT=$(LIBS_DIR)/CMSIS
646b7adbe5SMatthias Ringwald
656b7adbe5SMatthias Ringwald# Where to find source files for this test
666b7adbe5SMatthias RingwaldVPATH= . ../../src
676b7adbe5SMatthias Ringwald
686b7adbe5SMatthias Ringwald# Where to find header files for this test
696b7adbe5SMatthias RingwaldIPATH= . ../../src
706b7adbe5SMatthias Ringwald
716b7adbe5SMatthias RingwaldBOARD_DIR=$(LIBS_DIR)/Boards
726b7adbe5SMatthias Ringwald
736b7adbe5SMatthias RingwaldIPATH += ../../board/
746b7adbe5SMatthias RingwaldVPATH += ../../board/
756b7adbe5SMatthias Ringwald
766b7adbe5SMatthias Ringwald# Source files for this test (add path to VPATH below)
776b7adbe5SMatthias RingwaldSRCS = main.c
786b7adbe5SMatthias RingwaldSRCS += hal_tick.c
796b7adbe5SMatthias RingwaldSRCS += btstack_port.c
806b7adbe5SMatthias RingwaldSRCS += ${PROJECT}.c
816b7adbe5SMatthias RingwaldSRCS += board.c
826b7adbe5SMatthias RingwaldSRCS += stdio.c
836b7adbe5SMatthias RingwaldSRCS += led.c
846b7adbe5SMatthias RingwaldSRCS += pb.c
856b7adbe5SMatthias RingwaldSRCS += max14690n.c
866b7adbe5SMatthias Ringwald
876b7adbe5SMatthias Ringwald# Where to find BSP source files
886b7adbe5SMatthias RingwaldVPATH += $(BOARD_DIR)/Source
896b7adbe5SMatthias Ringwald
906b7adbe5SMatthias Ringwald# Where to find BSP header files
916b7adbe5SMatthias RingwaldIPATH += $(BOARD_DIR)/Include
926b7adbe5SMatthias Ringwald
936b7adbe5SMatthias Ringwald# BTstack
946b7adbe5SMatthias RingwaldBTSTACK_ROOT = ../../../..
95*f39cc24dSMatthias RingwaldVPATH += $(BTSTACK_ROOT)/chipset/cc256x
96*f39cc24dSMatthias RingwaldVPATH += $(BTSTACK_ROOT)/example
97*f39cc24dSMatthias RingwaldVPATH += $(BTSTACK_ROOT)/port/pegasus-max3263x
986b7adbe5SMatthias RingwaldVPATH += $(BTSTACK_ROOT)/src
996b7adbe5SMatthias RingwaldVPATH += $(BTSTACK_ROOT)/src/ble
1006b7adbe5SMatthias RingwaldVPATH += $(BTSTACK_ROOT)/src/classic
101*f39cc24dSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/srce
102*f39cc24dSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/srce
103*f39cc24dSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/hxcmod-player
104*f39cc24dSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/hxcmod-player/mods
105*f39cc24dSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/micro-ecc
1066b7adbe5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/embedded
1076b7adbe5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src/ble/gatt-service/
1086b7adbe5SMatthias Ringwald
1096b7adbe5SMatthias RingwaldPROJ_CFLAGS += \
1106b7adbe5SMatthias Ringwald    -I$(BTSTACK_ROOT)/src \
1116b7adbe5SMatthias Ringwald    -I$(BTSTACK_ROOT)/src/ble \
1126b7adbe5SMatthias Ringwald    -I$(BTSTACK_ROOT)/src/classic \
1136b7adbe5SMatthias Ringwald    -I$(BTSTACK_ROOT)/chipset/cc256x \
1146b7adbe5SMatthias Ringwald    -I$(BTSTACK_ROOT)/platform/embedded \
1156b7adbe5SMatthias Ringwald    -I${BTSTACK_ROOT}/port/pegasus-max3263x \
1166b7adbe5SMatthias Ringwald    -I${BTSTACK_ROOT}/src/ble/gatt-service/ \
117*f39cc24dSMatthias Ringwald    -I${BTSTACK_ROOT}/example \
118*f39cc24dSMatthias Ringwald    -I${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/include \
119*f39cc24dSMatthias Ringwald	-I${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/include \
120*f39cc24dSMatthias Ringwald	-I${BTSTACK_ROOT}/3rd-party/hxcmod-player \
121*f39cc24dSMatthias Ringwald
1226b7adbe5SMatthias Ringwald
1236b7adbe5SMatthias RingwaldCORE = \
1246b7adbe5SMatthias Ringwald    ad_parser.o \
1256b7adbe5SMatthias Ringwald    btstack_linked_list.o \
1266b7adbe5SMatthias Ringwald    btstack_memory.o \
1276b7adbe5SMatthias Ringwald    btstack_memory_pool.o \
1286b7adbe5SMatthias Ringwald    btstack_run_loop.o \
1296b7adbe5SMatthias Ringwald    btstack_util.o \
1306b7adbe5SMatthias Ringwald    l2cap.o \
1316b7adbe5SMatthias Ringwald    l2cap_signaling.o \
1326b7adbe5SMatthias Ringwald    btstack_run_loop_embedded.o \
1336b7adbe5SMatthias Ringwald	$(CC2564B) \
1346b7adbe5SMatthias Ringwald    hci_transport_h4.o
1356b7adbe5SMatthias Ringwald
1366b7adbe5SMatthias RingwaldCOMMON = \
1376b7adbe5SMatthias Ringwald    btstack_chipset_cc256x.o  \
1386b7adbe5SMatthias Ringwald    hci.o                     \
1396b7adbe5SMatthias Ringwald    hci_cmd.o                 \
1406b7adbe5SMatthias Ringwald    hci_dump.o                \
1416b7adbe5SMatthias Ringwald    btstack_uart_block_embedded.o
1426b7adbe5SMatthias Ringwald
1436b7adbe5SMatthias RingwaldCLASSIC = \
1446b7adbe5SMatthias Ringwald    btstack_link_key_db_memory.o \
1456b7adbe5SMatthias Ringwald    rfcomm.o                  \
1466b7adbe5SMatthias Ringwald    sdp_util.o              \
1476b7adbe5SMatthias Ringwald    spp_server.o            \
1486b7adbe5SMatthias Ringwald    sdp_server.o              \
1496b7adbe5SMatthias Ringwald    sdp_client.o              \
1506b7adbe5SMatthias Ringwald    sdp_client_rfcomm.o
1516b7adbe5SMatthias Ringwald
1526b7adbe5SMatthias RingwaldBLE = \
1536b7adbe5SMatthias Ringwald    att_db.o                      \
1546b7adbe5SMatthias Ringwald    att_server.o              \
1556b7adbe5SMatthias Ringwald    le_device_db_memory.o  \
1566b7adbe5SMatthias Ringwald    att_dispatch.o            \
157*f39cc24dSMatthias Ringwald    sm.o \
158*f39cc24dSMatthias Ringwald    ancs_client.o \
159*f39cc24dSMatthias Ringwald    gatt_client.o \
160*f39cc24dSMatthias Ringwald    hid_device.o \
161*f39cc24dSMatthias Ringwald    battery_service_server.o
162*f39cc24dSMatthias Ringwald
163*f39cc24dSMatthias RingwaldAVDTP += \
164*f39cc24dSMatthias Ringwald	avdtp_util.c  		\
165*f39cc24dSMatthias Ringwald	avdtp.c  			\
166*f39cc24dSMatthias Ringwald	avdtp_initiator.c 	\
167*f39cc24dSMatthias Ringwald	avdtp_acceptor.c  	\
168*f39cc24dSMatthias Ringwald	avdtp_source.c 		\
169*f39cc24dSMatthias Ringwald	avdtp_sink.c  		\
170*f39cc24dSMatthias Ringwald	a2dp_source.c 		\
171*f39cc24dSMatthias Ringwald	a2dp_sink.c  		\
172*f39cc24dSMatthias Ringwald	btstack_ring_buffer.c \
173*f39cc24dSMatthias Ringwald	avrcp.c \
174*f39cc24dSMatthias Ringwald
175*f39cc24dSMatthias RingwaldHFP_OBJ += sco_demo_util.o btstack_ring_buffer.o hfp.o hfp_gsm_model.o hfp_ag.o hfp_hf.o
176*f39cc24dSMatthias Ringwald
177*f39cc24dSMatthias Ringwald# List of files for Bluedroid SBC codec
178*f39cc24dSMatthias Ringwaldinclude ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/Makefile.inc
179*f39cc24dSMatthias Ringwaldinclude ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/Makefile.inc
180*f39cc24dSMatthias Ringwald
181*f39cc24dSMatthias RingwaldSBC_DECODER += \
182*f39cc24dSMatthias Ringwald	btstack_sbc_plc.c \
183*f39cc24dSMatthias Ringwald	btstack_sbc_bludroid.c \
184*f39cc24dSMatthias Ringwald
185*f39cc24dSMatthias RingwaldSBC_ENCODER += \
186*f39cc24dSMatthias Ringwald	btstack_sbc_bludroid.c \
187*f39cc24dSMatthias Ringwald	hfp_msbc.c \
188*f39cc24dSMatthias Ringwald
189*f39cc24dSMatthias RingwaldHXCMOD_PLAYER = \
190*f39cc24dSMatthias Ringwald	hxcmod.c 						\
191*f39cc24dSMatthias Ringwald	nao-deceased_by_disease.c 	\
192*f39cc24dSMatthias Ringwald
1936b7adbe5SMatthias Ringwald
1946b7adbe5SMatthias RingwaldADDITION =
1956b7adbe5SMatthias Ringwald
1966b7adbe5SMatthias RingwaldCORE_OBJ   = $(CORE:.c=.o)
1976b7adbe5SMatthias RingwaldCOMMON_OBJ = $(COMMON:.c=.o)
1986b7adbe5SMatthias RingwaldBLE_OBJ    = $(BLE:.c=.o)
1996b7adbe5SMatthias RingwaldCLASSIC_OBJ = $(CLASSIC:.c=.o)
200*f39cc24dSMatthias RingwaldAVDTP_OBJ   = $(AVDTP:.c=.o)
201*f39cc24dSMatthias RingwaldSBC_DECODER_OBJ  = $(SBC_DECODER:.c=.o)
202*f39cc24dSMatthias RingwaldSBC_ENCODER_OBJ  = $(SBC_ENCODER:.c=.o)
203*f39cc24dSMatthias RingwaldCVSD_PLC_OBJ = $(CVSD_PLC:.c=.o)
204*f39cc24dSMatthias RingwaldHXCMOD_PLAYER_OBJ = $(HXCMOD_PLAYER:.c=.o)
2056b7adbe5SMatthias Ringwald
2066b7adbe5SMatthias RingwaldSRCS += $(CORE_OBJ)
2076b7adbe5SMatthias RingwaldSRCS += $(COMMON_OBJ)
2086b7adbe5SMatthias RingwaldSRCS += $(BLE_OBJ)
2096b7adbe5SMatthias RingwaldSRCS += $(CLASSIC_OBJ)
210*f39cc24dSMatthias RingwaldSRCS += $(AVDTP_OBJ)
211*f39cc24dSMatthias RingwaldSRCS += $(SBC_DECODER_OBJ)
212*f39cc24dSMatthias RingwaldSRCS += $(SBC_ENCODER_OBJ)
213*f39cc24dSMatthias RingwaldSRCS += $(CVSD_PLC_OBJ)
214*f39cc24dSMatthias RingwaldSRCS += $(HXCMOD_PLAYER_OBJ)
215*f39cc24dSMatthias RingwaldSRCS += $(HFP_OBJ)
216*f39cc24dSMatthias RingwaldSRCS += hsp_hs.o hsp_ag.o
217*f39cc24dSMatthias RingwaldSRCS += obex_iterator.o goep_client.o pbap_client.o
2186b7adbe5SMatthias Ringwald
2196b7adbe5SMatthias Ringwald# Enable assertion checking for development
2206b7adbe5SMatthias RingwaldPROJ_CFLAGS+=-DMXC_ASSERT_ENABLE
2216b7adbe5SMatthias Ringwald
2226b7adbe5SMatthias Ringwald# Use this variables to specify and alternate tool path
2236b7adbe5SMatthias Ringwald#TOOL_DIR=/opt/gcc-arm-none-eabi-4_8-2013q4/bin
2246b7adbe5SMatthias Ringwald
2256b7adbe5SMatthias Ringwald# Use these variables to add project specific tool options
2266b7adbe5SMatthias Ringwald#PROJ_CFLAGS+=--specs=nano.specs
2276b7adbe5SMatthias Ringwald#PROJ_LDFLAGS+=--specs=nano.specs
2286b7adbe5SMatthias Ringwald
2296b7adbe5SMatthias Ringwald# Point this variable to a startup file to override the default file
2306b7adbe5SMatthias Ringwald#STARTUPFILE=start.S
2316b7adbe5SMatthias Ringwald
2326b7adbe5SMatthias Ringwald# Point this variable to a linker file to override the default file
2336b7adbe5SMatthias Ringwald# LINKERFILE=$(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/GCC/$(TARGET_LC).ld
2346b7adbe5SMatthias Ringwald
2356b7adbe5SMatthias Ringwald%.h: %.gatt
2366b7adbe5SMatthias Ringwald	python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
2376b7adbe5SMatthias Ringwald
2386b7adbe5SMatthias Ringwaldall: spp_and_le_streamer.h
2396b7adbe5SMatthias Ringwald
2406b7adbe5SMatthias Ringwald# Include the peripheral driver
2416b7adbe5SMatthias RingwaldPERIPH_DRIVER_DIR=$(LIBS_DIR)/$(TARGET_UC)PeriphDriver
2426b7adbe5SMatthias Ringwaldinclude $(PERIPH_DRIVER_DIR)/periphdriver.mk
2436b7adbe5SMatthias Ringwald
2446b7adbe5SMatthias Ringwald################################################################################
2456b7adbe5SMatthias Ringwald# Include the rules for building for this target. All other makefiles should be
2466b7adbe5SMatthias Ringwald# included before this one.
2476b7adbe5SMatthias Ringwaldinclude $(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/$(COMPILER)/$(TARGET_LC).mk
2486b7adbe5SMatthias Ringwald
2496b7adbe5SMatthias Ringwald# fetch and convert init scripts
2506b7adbe5SMatthias Ringwald# use bluetooth_init_cc2564B_1.6_BT_Spec_4.1.c
2516b7adbe5SMatthias Ringwald# include ${BTSTACK_ROOT}/chipset/cc256x/Makefile.inc
2526b7adbe5SMatthias Ringwald
2536b7adbe5SMatthias Ringwald#include ${BTSTACK_ROOT}/example/Makefile.inc
2546b7adbe5SMatthias Ringwald
2556b7adbe5SMatthias Ringwaldrm-compiled-gatt-file:
2566b7adbe5SMatthias Ringwald	rm -f spp_and_le_counter.h
2576b7adbe5SMatthias Ringwald
2586b7adbe5SMatthias Ringwaldclean: rm-compiled-gatt-file
2596b7adbe5SMatthias Ringwald
2606b7adbe5SMatthias Ringwald# The rule to clean out all the build products.
2616b7adbe5SMatthias Ringwalddistclean: clean
2626b7adbe5SMatthias Ringwald	$(MAKE) -C ${PERIPH_DRIVER_DIR} clean
263