1a8f7f3fcSMatthias Ringwald########################################################################################################################## 2a8f7f3fcSMatthias Ringwald# File automatically-generated by tool: [projectgenerator] version: [3.11.0-B13] date: [Sun Jan 17 23:15:13 CET 2021] 3a8f7f3fcSMatthias Ringwald########################################################################################################################## 4a8f7f3fcSMatthias Ringwald 5a8f7f3fcSMatthias Ringwald# ------------------------------------------------ 6a8f7f3fcSMatthias Ringwald# Generic Makefile (based on gcc) 7a8f7f3fcSMatthias Ringwald# 8a8f7f3fcSMatthias Ringwald# ChangeLog : 9a8f7f3fcSMatthias Ringwald# 2017-02-10 - Several enhancements + project update mode 10a8f7f3fcSMatthias Ringwald# 2015-07-22 - first version 11a8f7f3fcSMatthias Ringwald# ------------------------------------------------ 12a8f7f3fcSMatthias Ringwald 13a8f7f3fcSMatthias Ringwald###################################### 14a8f7f3fcSMatthias Ringwald# target 15a8f7f3fcSMatthias Ringwald###################################### 16a8f7f3fcSMatthias RingwaldTARGET = stm32-f4discovery-usb-blog 17a8f7f3fcSMatthias Ringwald 18a8f7f3fcSMatthias Ringwald 19a8f7f3fcSMatthias Ringwald###################################### 20a8f7f3fcSMatthias Ringwald# building variables 21a8f7f3fcSMatthias Ringwald###################################### 22a8f7f3fcSMatthias Ringwald# debug build? 23a8f7f3fcSMatthias RingwaldDEBUG = 1 24a8f7f3fcSMatthias Ringwald# optimization 25a8f7f3fcSMatthias RingwaldOPT = -Og 26a8f7f3fcSMatthias Ringwald 27a8f7f3fcSMatthias Ringwald 28a8f7f3fcSMatthias Ringwald####################################### 29a8f7f3fcSMatthias Ringwald# paths 30a8f7f3fcSMatthias Ringwald####################################### 31a8f7f3fcSMatthias Ringwald# Build path 32a8f7f3fcSMatthias RingwaldBUILD_DIR = build 33a8f7f3fcSMatthias Ringwald 34a8f7f3fcSMatthias RingwaldBTSTACK_ROOT ?= ../.. 35*4317f7c8SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/example 36a8f7f3fcSMatthias Ringwald 37a8f7f3fcSMatthias Ringwald###################################### 38a8f7f3fcSMatthias Ringwald# source 39a8f7f3fcSMatthias Ringwald###################################### 40a8f7f3fcSMatthias Ringwald# C sources 41a8f7f3fcSMatthias RingwaldC_SOURCES = \ 42*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/hxcmod-player/hxcmod.c \ 43*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/hxcmod-player/mods/nao-deceased_by_disease.c \ 44*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/micro-ecc/uECC.c \ 45*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT.c \ 46*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_printf.c \ 47*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_Syscalls_GCC.c \ 48*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/yxml/yxml.c \ 49*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/md5/md5.c \ 50*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/chipset/cc256x/btstack_chipset_cc256x.c \ 51*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/example/sco_demo_util.c \ 52*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/platform/embedded/btstack_audio_embedded.c \ 53*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/platform/embedded/btstack_run_loop_embedded.c \ 54*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/platform/embedded/btstack_stdin_embedded.c \ 55*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/platform/embedded/btstack_tlv_flash_bank.c \ 56*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/platform/embedded/btstack_uart_block_embedded.c \ 57*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ad_parser.c \ 58*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/ancs_client.c \ 59*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/att_db.c \ 60*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/att_dispatch.c \ 61*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/att_server.c \ 62*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/gatt-service/battery_service_server.c \ 63*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/gatt-service/device_information_service_server.c \ 64*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/gatt-service/hids_device.c \ 65*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/gatt_client.c \ 66*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/le_device_db_memory.c \ 67*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/le_device_db_tlv.c \ 68*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/sm.c \ 69*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_audio.c \ 70*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_crypto.c \ 71*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_hid_parser.c \ 72*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_linked_list.c \ 73*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_memory.c \ 74*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_memory_pool.c \ 75*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_resample.c \ 76*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_ring_buffer.c \ 77*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_run_loop.c \ 78*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_tlv.c \ 79*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_util.c \ 80*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/a2dp_sink.c \ 81*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/a2dp_source.c \ 82*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avdtp.c \ 83*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avdtp_acceptor.c \ 84*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avdtp_initiator.c \ 85*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avdtp_sink.c \ 86*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avdtp_source.c \ 87*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avdtp_util.c \ 88*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avrcp.c \ 89*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avrcp_browsing_controller.c \ 90*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avrcp_controller.c \ 91*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avrcp_media_item_iterator.c \ 92*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avrcp_target.c \ 93*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/bnep.c \ 94*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/btstack_cvsd_plc.c \ 95*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/btstack_link_key_db_tlv.c \ 96*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/btstack_sbc_decoder_bluedroid.c \ 97*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/btstack_sbc_encoder_bluedroid.c \ 98*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/btstack_sbc_plc.c \ 99*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/device_id_server.c \ 100*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/goep_client.c \ 101*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/hfp.c \ 102*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/hfp_ag.c \ 103*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/hfp_gsm_model.c \ 104*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/hfp_hf.c \ 105*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/hfp_msbc.c \ 106*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/hid_device.c \ 107*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/hsp_ag.c \ 108*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/hsp_hs.c \ 109*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/obex_iterator.c \ 110*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/obex_message_builder.c \ 111*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/pan.c \ 112*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/pbap_client.c \ 113*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/rfcomm.c \ 114*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/sdp_client.c \ 115*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/sdp_client_rfcomm.c \ 116*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/sdp_server.c \ 117*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/sdp_util.c \ 118*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/spp_server.c \ 119*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/hci.c \ 120*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/hci_cmd.c \ 121*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/hci_dump.c \ 122*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/hci_transport_h4.c \ 123*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/l2cap.c \ 124*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/l2cap_signaling.c \ 125*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/def.c \ 126*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/inet_chksum.c \ 127*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/init.c \ 128*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ip.c \ 129*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/mem.c \ 130*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/memp.c \ 131*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/netif.c \ 132*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/pbuf.c \ 133*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/tcp.c \ 134*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/tcp_in.c \ 135*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/tcp_out.c \ 136*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/timeouts.c \ 137*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/udp.c \ 138*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/acd.c \ 139*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/dhcp.c \ 140*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/etharp.c \ 141*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/icmp.c \ 142*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/ip4.c \ 143*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/ip4_addr.c \ 144*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/ip4_frag.c \ 145*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/netif/ethernet.c \ 146*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/apps/http/altcp_proxyconnect.c \ 147*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/apps/http/fs.c \ 148*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/apps/http/httpd.c \ 149*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/dhcp-server/dhserver.c \ 150*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/platform/lwip/port/sys_arch.c \ 151*4317f7c8SMatthias Ringwald${BTSTACK_ROOT}/platform/lwip/bnep_lwip.c \ 152*4317f7c8SMatthias Ringwaldport/port.c \ 15340bec0daSMatthias Ringwaldport/usbh_bluetooth.c \ 154*4317f7c8SMatthias Ringwaldport/hci_transport_h2_stm32.c \ 155*4317f7c8SMatthias Ringwaldport/hal_flash_bank_stm32.c \ 156a8f7f3fcSMatthias RingwaldCore/Src/main.c \ 157a8f7f3fcSMatthias RingwaldCore/Src/stm32f4xx_it.c \ 158a8f7f3fcSMatthias RingwaldCore/Src/stm32f4xx_hal_msp.c \ 159*4317f7c8SMatthias RingwaldCore/Src/system_stm32f4xx.c \ 160*4317f7c8SMatthias RingwaldUSB_HOST/App/usb_host.c \ 161a8f7f3fcSMatthias RingwaldUSB_HOST/Target/usbh_conf.c \ 162a8f7f3fcSMatthias RingwaldUSB_HOST/Target/usbh_platform.c \ 163*4317f7c8SMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c \ 164*4317f7c8SMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c \ 165*4317f7c8SMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c \ 166a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c \ 167a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c \ 168a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c \ 169a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c \ 170a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c \ 171a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c \ 172a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c \ 173a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c \ 174a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c \ 175a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c \ 176a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c \ 177a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c \ 178a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c \ 179*4317f7c8SMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hcd.c \ 180*4317f7c8SMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c \ 181a8f7f3fcSMatthias RingwaldMiddlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c \ 182a8f7f3fcSMatthias RingwaldMiddlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ctlreq.c \ 183a8f7f3fcSMatthias RingwaldMiddlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ioreq.c \ 184a8f7f3fcSMatthias RingwaldMiddlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_pipes.c \ 185a8f7f3fcSMatthias Ringwald 186a8f7f3fcSMatthias Ringwald# ASM sources 187a8f7f3fcSMatthias RingwaldASM_SOURCES = \ 188a8f7f3fcSMatthias Ringwaldstartup_stm32f407xx.s 189a8f7f3fcSMatthias Ringwald 190a8f7f3fcSMatthias Ringwald 191a8f7f3fcSMatthias Ringwald####################################### 192a8f7f3fcSMatthias Ringwald# binaries 193a8f7f3fcSMatthias Ringwald####################################### 194a8f7f3fcSMatthias RingwaldPREFIX = arm-none-eabi- 195a8f7f3fcSMatthias Ringwald# The gcc compiler bin path can be either defined in make command via GCC_PATH variable (> make GCC_PATH=xxx) 196a8f7f3fcSMatthias Ringwald# either it can be added to the PATH environment variable. 197a8f7f3fcSMatthias Ringwaldifdef GCC_PATH 198a8f7f3fcSMatthias RingwaldCC = $(GCC_PATH)/$(PREFIX)gcc 199a8f7f3fcSMatthias RingwaldAS = $(GCC_PATH)/$(PREFIX)gcc -x assembler-with-cpp 200a8f7f3fcSMatthias RingwaldCP = $(GCC_PATH)/$(PREFIX)objcopy 201a8f7f3fcSMatthias RingwaldSZ = $(GCC_PATH)/$(PREFIX)size 202a8f7f3fcSMatthias Ringwaldelse 203a8f7f3fcSMatthias RingwaldCC = $(PREFIX)gcc 204a8f7f3fcSMatthias RingwaldAS = $(PREFIX)gcc -x assembler-with-cpp 205a8f7f3fcSMatthias RingwaldCP = $(PREFIX)objcopy 206a8f7f3fcSMatthias RingwaldSZ = $(PREFIX)size 207a8f7f3fcSMatthias Ringwaldendif 208a8f7f3fcSMatthias RingwaldHEX = $(CP) -O ihex 209a8f7f3fcSMatthias RingwaldBIN = $(CP) -O binary -S 210a8f7f3fcSMatthias Ringwald 211a8f7f3fcSMatthias Ringwald####################################### 212a8f7f3fcSMatthias Ringwald# CFLAGS 213a8f7f3fcSMatthias Ringwald####################################### 214a8f7f3fcSMatthias Ringwald# cpu 215a8f7f3fcSMatthias RingwaldCPU = -mcpu=cortex-m4 216a8f7f3fcSMatthias Ringwald 217a8f7f3fcSMatthias Ringwald# fpu 218a8f7f3fcSMatthias RingwaldFPU = -mfpu=fpv4-sp-d16 219a8f7f3fcSMatthias Ringwald 220a8f7f3fcSMatthias Ringwald# float-abi 221a8f7f3fcSMatthias RingwaldFLOAT-ABI = -mfloat-abi=hard 222a8f7f3fcSMatthias Ringwald 223a8f7f3fcSMatthias Ringwald# mcu 224a8f7f3fcSMatthias RingwaldMCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI) 225a8f7f3fcSMatthias Ringwald 226a8f7f3fcSMatthias Ringwald# macros for gcc 227a8f7f3fcSMatthias Ringwald# AS defines 228a8f7f3fcSMatthias RingwaldAS_DEFS = 229a8f7f3fcSMatthias Ringwald 230a8f7f3fcSMatthias Ringwald# C defines 231a8f7f3fcSMatthias RingwaldC_DEFS = \ 232a8f7f3fcSMatthias Ringwald-DUSE_HAL_DRIVER \ 233a8f7f3fcSMatthias Ringwald-DSTM32F407xx 234a8f7f3fcSMatthias Ringwald 235a8f7f3fcSMatthias Ringwald 236a8f7f3fcSMatthias Ringwald# AS includes 237a8f7f3fcSMatthias RingwaldAS_INCLUDES = 238a8f7f3fcSMatthias Ringwald 239a8f7f3fcSMatthias Ringwald# C includes 240a8f7f3fcSMatthias RingwaldC_INCLUDES = \ 241a8f7f3fcSMatthias Ringwald-ICore/Inc \ 242a8f7f3fcSMatthias Ringwald-IDrivers/STM32F4xx_HAL_Driver/Inc \ 243a8f7f3fcSMatthias Ringwald-IDrivers/STM32F4xx_HAL_Driver/Inc/Legacy \ 244a8f7f3fcSMatthias Ringwald-IDrivers/CMSIS/Device/ST/STM32F4xx/Include \ 245a8f7f3fcSMatthias Ringwald-IDrivers/CMSIS/Include \ 246*4317f7c8SMatthias Ringwald-IMiddlewares/ST/STM32_USB_Host_Library/Core/Inc \ 247*4317f7c8SMatthias Ringwald-IMiddlewares/ST/STM32_USB_Host_Library/Class/HID/Inc \ 248a8f7f3fcSMatthias Ringwald 249*4317f7c8SMatthias RingwaldC_INCLUDES += -I$(BUILD_DIR) 250*4317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/src/ble 251*4317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/src/ble/gatt-service 252*4317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/src/classic 253*4317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/src 254*4317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/micro-ecc 255*4317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/include 256*4317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/include 257*4317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/hxcmod-player 258*4317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/hxcmod-player/mods 259*4317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/lwip/core/src/include 260*4317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/lwip/dhcp-server 261*4317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/md5 262*4317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/yxml 263*4317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/segger-rtt 264*4317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/platform/embedded 265*4317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/platform/lwip 266*4317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/platform/lwip/port 267*4317f7c8SMatthias Ringwald 268*4317f7c8SMatthias RingwaldC_INCLUDES += -I bsp 269*4317f7c8SMatthias RingwaldC_INCLUDES += -I pdm 270*4317f7c8SMatthias RingwaldC_INCLUDES += -I port 271*4317f7c8SMatthias RingwaldC_INCLUDES += -I Core/Src 272*4317f7c8SMatthias RingwaldC_INCLUDES += -I USB_HOST/Target 273*4317f7c8SMatthias RingwaldC_INCLUDES += -I USB_HOST/App 274a8f7f3fcSMatthias Ringwald 275a8f7f3fcSMatthias Ringwald# compile gcc flags 276a8f7f3fcSMatthias RingwaldASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections 277a8f7f3fcSMatthias Ringwald 278a8f7f3fcSMatthias RingwaldCFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections 279a8f7f3fcSMatthias Ringwald 280a8f7f3fcSMatthias Ringwaldifeq ($(DEBUG), 1) 281a8f7f3fcSMatthias RingwaldCFLAGS += -g -gdwarf-2 282a8f7f3fcSMatthias Ringwaldendif 283a8f7f3fcSMatthias Ringwald 284a8f7f3fcSMatthias Ringwald 285a8f7f3fcSMatthias Ringwald# Generate dependency information 286a8f7f3fcSMatthias RingwaldCFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" 287a8f7f3fcSMatthias Ringwald 288a8f7f3fcSMatthias Ringwald 289a8f7f3fcSMatthias Ringwald####################################### 290a8f7f3fcSMatthias Ringwald# LDFLAGS 291a8f7f3fcSMatthias Ringwald####################################### 292a8f7f3fcSMatthias Ringwald# link script 293a8f7f3fcSMatthias RingwaldLDSCRIPT = STM32F407VGTx_FLASH.ld 294a8f7f3fcSMatthias Ringwald 295a8f7f3fcSMatthias Ringwald# libraries 296a8f7f3fcSMatthias RingwaldLIBS = -lc -lm -lnosys 297a8f7f3fcSMatthias RingwaldLIBDIR = 298a8f7f3fcSMatthias RingwaldLDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections 299a8f7f3fcSMatthias Ringwald 300a8f7f3fcSMatthias Ringwald# default action: build all 301*4317f7c8SMatthias RingwaldEXAMPLES = \ 302*4317f7c8SMatthias Ringwald audio_duplex \ 303*4317f7c8SMatthias Ringwald a2dp_sink_demo \ 304*4317f7c8SMatthias Ringwald a2dp_source_demo \ 305*4317f7c8SMatthias Ringwald ancs_client_demo \ 306*4317f7c8SMatthias Ringwald dut_mode_classic \ 307*4317f7c8SMatthias Ringwald gap_dedicated_bonding \ 308*4317f7c8SMatthias Ringwald gap_inquiry \ 309*4317f7c8SMatthias Ringwald gap_le_advertisements \ 310*4317f7c8SMatthias Ringwald gatt_battery_query \ 311*4317f7c8SMatthias Ringwald gatt_browser \ 312*4317f7c8SMatthias Ringwald gatt_counter \ 313*4317f7c8SMatthias Ringwald gatt_streamer_server \ 314*4317f7c8SMatthias Ringwald hfp_ag_demo \ 315*4317f7c8SMatthias Ringwald hfp_hf_demo \ 316*4317f7c8SMatthias Ringwald hid_host_demo \ 317*4317f7c8SMatthias Ringwald hid_keyboard_demo \ 318*4317f7c8SMatthias Ringwald hid_mouse_demo \ 319*4317f7c8SMatthias Ringwald hog_keyboard_demo \ 320*4317f7c8SMatthias Ringwald hog_mouse_demo \ 321*4317f7c8SMatthias Ringwald hsp_ag_demo \ 322*4317f7c8SMatthias Ringwald hsp_hs_demo \ 323*4317f7c8SMatthias Ringwald mod_player \ 324*4317f7c8SMatthias Ringwald le_streamer_client \ 325*4317f7c8SMatthias Ringwald pan_lwip_http_server \ 326*4317f7c8SMatthias Ringwald pbap_client_demo \ 327*4317f7c8SMatthias Ringwald sdp_bnep_query \ 328*4317f7c8SMatthias Ringwald sdp_general_query \ 329*4317f7c8SMatthias Ringwald sdp_rfcomm_query \ 330*4317f7c8SMatthias Ringwald sine_player \ 331*4317f7c8SMatthias Ringwald sm_pairing_central \ 332*4317f7c8SMatthias Ringwald sm_pairing_peripheral \ 333*4317f7c8SMatthias Ringwald spp_and_gatt_counter \ 334*4317f7c8SMatthias Ringwald spp_and_gatt_streamer \ 335*4317f7c8SMatthias Ringwald spp_counter \ 336*4317f7c8SMatthias Ringwald spp_streamer \ 337*4317f7c8SMatthias Ringwald spp_streamer_client \ 338*4317f7c8SMatthias Ringwald 339*4317f7c8SMatthias RingwaldGATT_FILES = \ 340*4317f7c8SMatthias Ringwald ancs_client_demo.gatt \ 341*4317f7c8SMatthias Ringwald gatt_counter.gatt \ 342*4317f7c8SMatthias Ringwald gatt_streamer_server.gatt \ 343*4317f7c8SMatthias Ringwald gatt_browser.gatt \ 344*4317f7c8SMatthias Ringwald gatt_battery_query.gatt \ 345*4317f7c8SMatthias Ringwald hog_keyboard_demo.gatt \ 346*4317f7c8SMatthias Ringwald hog_mouse_demo.gatt \ 347*4317f7c8SMatthias Ringwald sm_pairing_peripheral.gatt \ 348*4317f7c8SMatthias Ringwald sm_pairing_central.gatt \ 349*4317f7c8SMatthias Ringwald spp_and_gatt_counter.gatt \ 350*4317f7c8SMatthias Ringwald spp_and_gatt_streamer.gatt \ 351*4317f7c8SMatthias Ringwald 352*4317f7c8SMatthias Ringwald# SBC codec 353*4317f7c8SMatthias Ringwaldinclude ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/Makefile.inc 354*4317f7c8SMatthias Ringwaldinclude ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/Makefile.inc 355*4317f7c8SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/srce 356*4317f7c8SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/srce 357*4317f7c8SMatthias RingwaldC_SOURCES += ${SBC_ENCODER} 358*4317f7c8SMatthias RingwaldC_SOURCES += ${SBC_DECODER} 359a8f7f3fcSMatthias Ringwald 360a8f7f3fcSMatthias Ringwald 361a8f7f3fcSMatthias Ringwald####################################### 362a8f7f3fcSMatthias Ringwald# build the application 363a8f7f3fcSMatthias Ringwald####################################### 364a8f7f3fcSMatthias Ringwald# list of objects 365a8f7f3fcSMatthias RingwaldOBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o))) 366a8f7f3fcSMatthias Ringwaldvpath %.c $(sort $(dir $(C_SOURCES))) 367a8f7f3fcSMatthias Ringwald# list of ASM program objects 368a8f7f3fcSMatthias RingwaldOBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o))) 369a8f7f3fcSMatthias Ringwaldvpath %.s $(sort $(dir $(ASM_SOURCES))) 370*4317f7c8SMatthias Ringwaldall: \ 371*4317f7c8SMatthias Ringwald $(OBJECTS) \ 372*4317f7c8SMatthias Ringwald $(addprefix $(BUILD_DIR)/,$(GATT_FILES:.gatt=.h)) \ 373*4317f7c8SMatthias Ringwald $(addprefix $(BUILD_DIR)/,$(EXAMPLES:=.elf)) \ 374*4317f7c8SMatthias Ringwald $(addprefix $(BUILD_DIR)/,$(EXAMPLES:=.hex)) \ 375*4317f7c8SMatthias Ringwald $(addprefix $(BUILD_DIR)/,$(EXAMPLES:=.bin)) \ 376*4317f7c8SMatthias Ringwald $(addprefix $(BUILD_DIR)/,$(EXAMPLES:=.jdebug)) \ 377*4317f7c8SMatthias Ringwald 378*4317f7c8SMatthias Ringwald 379*4317f7c8SMatthias Ringwald$(BUILD_DIR)/%.h: %.gatt 380*4317f7c8SMatthias Ringwald python3 ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ 381*4317f7c8SMatthias Ringwald 382a8f7f3fcSMatthias Ringwald 383a8f7f3fcSMatthias Ringwald$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) 384a8f7f3fcSMatthias Ringwald $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@ 385a8f7f3fcSMatthias Ringwald 386a8f7f3fcSMatthias Ringwald$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR) 387a8f7f3fcSMatthias Ringwald $(AS) -c $(CFLAGS) $< -o $@ 388*4317f7c8SMatthias Ringwald$(BUILD_DIR)/%.elf: Makefile $(OBJECTS) $(BUILD_DIR)/%.o 389*4317f7c8SMatthias Ringwald $(CC) $(filter-out Makefile,$^) $(LDFLAGS) -o $@ 390a8f7f3fcSMatthias Ringwald $(SZ) $@ 391a8f7f3fcSMatthias Ringwald 392a8f7f3fcSMatthias Ringwald$(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR) 393a8f7f3fcSMatthias Ringwald $(HEX) $< $@ 394a8f7f3fcSMatthias Ringwald 395a8f7f3fcSMatthias Ringwald$(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR) 396a8f7f3fcSMatthias Ringwald $(BIN) $< $@ 397a8f7f3fcSMatthias Ringwald 398*4317f7c8SMatthias Ringwald$(BUILD_DIR)/%.jdebug: ozone.jdebug | $(BUILD_DIR) 399*4317f7c8SMatthias Ringwald sed -e "s|EXAMPLE|$(basename $(notdir $@))|" $< > $@ 400*4317f7c8SMatthias Ringwald 401a8f7f3fcSMatthias Ringwald$(BUILD_DIR): 402a8f7f3fcSMatthias Ringwald mkdir $@ 403a8f7f3fcSMatthias Ringwald 404a8f7f3fcSMatthias Ringwald####################################### 405a8f7f3fcSMatthias Ringwald# clean up 406a8f7f3fcSMatthias Ringwald####################################### 407a8f7f3fcSMatthias Ringwaldclean: 408a8f7f3fcSMatthias Ringwald -rm -fR $(BUILD_DIR) 409a8f7f3fcSMatthias Ringwald 410a8f7f3fcSMatthias Ringwald####################################### 411a8f7f3fcSMatthias Ringwald# dependencies 412a8f7f3fcSMatthias Ringwald####################################### 413a8f7f3fcSMatthias Ringwald-include $(wildcard $(BUILD_DIR)/*.d) 414a8f7f3fcSMatthias Ringwald 415a8f7f3fcSMatthias Ringwald# *** EOF *** 416