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 ?= ../.. 354317f7c8SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/example 36a8f7f3fcSMatthias Ringwald 37a8f7f3fcSMatthias Ringwald###################################### 38a8f7f3fcSMatthias Ringwald# source 39a8f7f3fcSMatthias Ringwald###################################### 40a8f7f3fcSMatthias Ringwald# C sources 41a8f7f3fcSMatthias RingwaldC_SOURCES = \ 424317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/hxcmod-player/hxcmod.c \ 434317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/hxcmod-player/mods/nao-deceased_by_disease.c \ 444317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/micro-ecc/uECC.c \ 454317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT.c \ 464317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_printf.c \ 474317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_Syscalls_GCC.c \ 484317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/yxml/yxml.c \ 494317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/md5/md5.c \ 504317f7c8SMatthias Ringwald${BTSTACK_ROOT}/chipset/cc256x/btstack_chipset_cc256x.c \ 514317f7c8SMatthias Ringwald${BTSTACK_ROOT}/example/sco_demo_util.c \ 524317f7c8SMatthias Ringwald${BTSTACK_ROOT}/platform/embedded/btstack_audio_embedded.c \ 534317f7c8SMatthias Ringwald${BTSTACK_ROOT}/platform/embedded/btstack_run_loop_embedded.c \ 544317f7c8SMatthias Ringwald${BTSTACK_ROOT}/platform/embedded/btstack_stdin_embedded.c \ 554317f7c8SMatthias Ringwald${BTSTACK_ROOT}/platform/embedded/btstack_tlv_flash_bank.c \ 564317f7c8SMatthias Ringwald${BTSTACK_ROOT}/platform/embedded/btstack_uart_block_embedded.c \ 5709df40bdSMatthias Ringwald${BTSTACK_ROOT}/platform/embedded/hci_dump_embedded_stdout.c \ 5809df40bdSMatthias Ringwald${BTSTACK_ROOT}/platform/embedded/hci_dump_segger_rtt_stdout.c \ 594317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ad_parser.c \ 604317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/att_db.c \ 614317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/att_dispatch.c \ 624317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/att_server.c \ 6302a896b6SMatthias Ringwald${BTSTACK_ROOT}/src/ble/gatt-service/ancs_client.c \ 646bdecec7SMatthias Ringwald${BTSTACK_ROOT}/src/ble/gatt-service/battery_service_client.c \ 654317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/gatt-service/battery_service_server.c \ 666bdecec7SMatthias Ringwald${BTSTACK_ROOT}/src/ble/gatt-service/device_information_service_client.c \ 674317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/gatt-service/device_information_service_server.c \ 684317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/gatt-service/hids_device.c \ 694317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/gatt_client.c \ 704317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/le_device_db_memory.c \ 714317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/le_device_db_tlv.c \ 724317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/ble/sm.c \ 734317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_audio.c \ 74e0a94143SDirk Helbig${BTSTACK_ROOT}/src/btstack_sample_rate_compensation.c \ 754317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_crypto.c \ 764317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_hid_parser.c \ 774317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_linked_list.c \ 784317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_memory.c \ 794317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_memory_pool.c \ 804317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_resample.c \ 814317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_ring_buffer.c \ 824317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_run_loop.c \ 834317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_tlv.c \ 844317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/btstack_util.c \ 851fd701e0SMatthias Ringwald${BTSTACK_ROOT}/src/classic/a2dp.c \ 864317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/a2dp_sink.c \ 874317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/a2dp_source.c \ 884317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avdtp.c \ 894317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avdtp_acceptor.c \ 904317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avdtp_initiator.c \ 914317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avdtp_sink.c \ 924317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avdtp_source.c \ 934317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avdtp_util.c \ 944317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avrcp.c \ 954317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avrcp_browsing_controller.c \ 964317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avrcp_controller.c \ 974317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avrcp_media_item_iterator.c \ 984317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/avrcp_target.c \ 994317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/bnep.c \ 1004317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/btstack_cvsd_plc.c \ 1014317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/btstack_link_key_db_tlv.c \ 102c2cab3feSMatthias Ringwald${BTSTACK_ROOT}/src/classic/btstack_sbc_bluedroid.c \ 1034317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/btstack_sbc_decoder_bluedroid.c \ 1044317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/btstack_sbc_encoder_bluedroid.c \ 1054317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/btstack_sbc_plc.c \ 1064317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/device_id_server.c \ 1074317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/goep_client.c \ 1084317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/hfp.c \ 1094317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/hfp_ag.c \ 1104317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/hfp_gsm_model.c \ 1114317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/hfp_hf.c \ 112360d44f6SMatthias Ringwald${BTSTACK_ROOT}/src/classic/hfp_codec.c \ 1134317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/hfp_msbc.c \ 1144317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/hid_device.c \ 115a813c6afSMatthias Ringwald${BTSTACK_ROOT}/src/classic/hid_host.c \ 1164317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/hsp_ag.c \ 1174317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/hsp_hs.c \ 118884d3c56SMatthias Ringwald${BTSTACK_ROOT}/src/classic/obex_parser.c \ 1194317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/obex_message_builder.c \ 1204317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/pan.c \ 1214317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/pbap_client.c \ 1224317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/rfcomm.c \ 1234317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/sdp_client.c \ 1244317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/sdp_client_rfcomm.c \ 1254317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/sdp_server.c \ 1264317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/sdp_util.c \ 1274317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/classic/spp_server.c \ 1284317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/hci.c \ 1294317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/hci_cmd.c \ 1304317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/hci_dump.c \ 131*06816492SMatthias Ringwald${BTSTACK_ROOT}/src/hci_event_builder.c \ 1324317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/hci_transport_h4.c \ 1334317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/l2cap.c \ 1344317f7c8SMatthias Ringwald${BTSTACK_ROOT}/src/l2cap_signaling.c \ 1354317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/def.c \ 1364317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/inet_chksum.c \ 1374317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/init.c \ 1384317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ip.c \ 1394317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/mem.c \ 1404317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/memp.c \ 1414317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/netif.c \ 1424317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/pbuf.c \ 1434317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/tcp.c \ 1444317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/tcp_in.c \ 1454317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/tcp_out.c \ 1464317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/timeouts.c \ 1474317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/udp.c \ 1484317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/acd.c \ 1494317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/dhcp.c \ 1504317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/etharp.c \ 1514317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/icmp.c \ 1524317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/ip4.c \ 1534317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/ip4_addr.c \ 1544317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/ip4_frag.c \ 1554317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/netif/ethernet.c \ 1564317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/apps/http/altcp_proxyconnect.c \ 1574317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/apps/http/fs.c \ 1584317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/core/src/apps/http/httpd.c \ 1594317f7c8SMatthias Ringwald${BTSTACK_ROOT}/3rd-party/lwip/dhcp-server/dhserver.c \ 1604317f7c8SMatthias Ringwald${BTSTACK_ROOT}/platform/lwip/port/sys_arch.c \ 1614317f7c8SMatthias Ringwald${BTSTACK_ROOT}/platform/lwip/bnep_lwip.c \ 162f763b8ceSMatthias Ringwaldbsp/audio.c \ 163f763b8ceSMatthias Ringwaldbsp/cs43l22.c \ 164f763b8ceSMatthias Ringwaldbsp/stm32f4_discovery.c \ 165f763b8ceSMatthias Ringwaldbsp/stm32f4_discovery_audio.c \ 1664317f7c8SMatthias Ringwaldport/port.c \ 167f763b8ceSMatthias Ringwaldport/hal_audio_f4discovery.c \ 16840bec0daSMatthias Ringwaldport/usbh_bluetooth.c \ 1694317f7c8SMatthias Ringwaldport/hci_transport_h2_stm32.c \ 1704317f7c8SMatthias Ringwaldport/hal_flash_bank_stm32.c \ 171a8f7f3fcSMatthias RingwaldCore/Src/main.c \ 172a8f7f3fcSMatthias RingwaldCore/Src/stm32f4xx_it.c \ 173a8f7f3fcSMatthias RingwaldCore/Src/stm32f4xx_hal_msp.c \ 1744317f7c8SMatthias RingwaldCore/Src/system_stm32f4xx.c \ 1754317f7c8SMatthias RingwaldUSB_HOST/App/usb_host.c \ 176a8f7f3fcSMatthias RingwaldUSB_HOST/Target/usbh_conf.c \ 177a8f7f3fcSMatthias RingwaldUSB_HOST/Target/usbh_platform.c \ 1784317f7c8SMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c \ 1794317f7c8SMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c \ 1804317f7c8SMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c \ 181a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c \ 182a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c \ 183a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c \ 184a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c \ 185a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c \ 186a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c \ 187a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c \ 188a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c \ 189f763b8ceSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c \ 190f763b8ceSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c \ 191f763b8ceSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s.c \ 192f763b8ceSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s_ex.c \ 193a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c \ 194a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c \ 195f763b8ceSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c \ 196a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c \ 197a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c \ 198a8f7f3fcSMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c \ 1994317f7c8SMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hcd.c \ 2004317f7c8SMatthias RingwaldDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c \ 201f763b8ceSMatthias RingwaldSrc/system_stm32f4xx.c \ 202a8f7f3fcSMatthias RingwaldMiddlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c \ 203a8f7f3fcSMatthias RingwaldMiddlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ctlreq.c \ 204a8f7f3fcSMatthias RingwaldMiddlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ioreq.c \ 205a8f7f3fcSMatthias RingwaldMiddlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_pipes.c \ 206a8f7f3fcSMatthias Ringwald 207a8f7f3fcSMatthias Ringwald# ASM sources 208a8f7f3fcSMatthias RingwaldASM_SOURCES = \ 209a8f7f3fcSMatthias Ringwaldstartup_stm32f407xx.s 210a8f7f3fcSMatthias Ringwald 211a8f7f3fcSMatthias Ringwald 212a8f7f3fcSMatthias Ringwald####################################### 213a8f7f3fcSMatthias Ringwald# binaries 214a8f7f3fcSMatthias Ringwald####################################### 215a8f7f3fcSMatthias RingwaldPREFIX = arm-none-eabi- 216a8f7f3fcSMatthias Ringwald# The gcc compiler bin path can be either defined in make command via GCC_PATH variable (> make GCC_PATH=xxx) 217a8f7f3fcSMatthias Ringwald# either it can be added to the PATH environment variable. 218a8f7f3fcSMatthias Ringwaldifdef GCC_PATH 219a8f7f3fcSMatthias RingwaldCC = $(GCC_PATH)/$(PREFIX)gcc 220a8f7f3fcSMatthias RingwaldAS = $(GCC_PATH)/$(PREFIX)gcc -x assembler-with-cpp 221a8f7f3fcSMatthias RingwaldCP = $(GCC_PATH)/$(PREFIX)objcopy 222a8f7f3fcSMatthias RingwaldSZ = $(GCC_PATH)/$(PREFIX)size 223a8f7f3fcSMatthias Ringwaldelse 224a8f7f3fcSMatthias RingwaldCC = $(PREFIX)gcc 225a8f7f3fcSMatthias RingwaldAS = $(PREFIX)gcc -x assembler-with-cpp 226a8f7f3fcSMatthias RingwaldCP = $(PREFIX)objcopy 227a8f7f3fcSMatthias RingwaldSZ = $(PREFIX)size 228a8f7f3fcSMatthias Ringwaldendif 229a8f7f3fcSMatthias RingwaldHEX = $(CP) -O ihex 230a8f7f3fcSMatthias RingwaldBIN = $(CP) -O binary -S 231a8f7f3fcSMatthias Ringwald 232a8f7f3fcSMatthias Ringwald####################################### 233a8f7f3fcSMatthias Ringwald# CFLAGS 234a8f7f3fcSMatthias Ringwald####################################### 235a8f7f3fcSMatthias Ringwald# cpu 236a8f7f3fcSMatthias RingwaldCPU = -mcpu=cortex-m4 237a8f7f3fcSMatthias Ringwald 238a8f7f3fcSMatthias Ringwald# fpu 239a8f7f3fcSMatthias RingwaldFPU = -mfpu=fpv4-sp-d16 240a8f7f3fcSMatthias Ringwald 241a8f7f3fcSMatthias Ringwald# float-abi 242f763b8ceSMatthias RingwaldFLOAT-ABI = -mfloat-abi=softfp 243a8f7f3fcSMatthias Ringwald 244a8f7f3fcSMatthias Ringwald# mcu 245a8f7f3fcSMatthias RingwaldMCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI) 246a8f7f3fcSMatthias Ringwald 247a8f7f3fcSMatthias Ringwald# macros for gcc 248a8f7f3fcSMatthias Ringwald# AS defines 249a8f7f3fcSMatthias RingwaldAS_DEFS = 250a8f7f3fcSMatthias Ringwald 251a8f7f3fcSMatthias Ringwald# C defines 252a8f7f3fcSMatthias RingwaldC_DEFS = \ 253a8f7f3fcSMatthias Ringwald-DUSE_HAL_DRIVER \ 254a8f7f3fcSMatthias Ringwald-DSTM32F407xx 255a8f7f3fcSMatthias Ringwald 256a8f7f3fcSMatthias Ringwald 257a8f7f3fcSMatthias Ringwald# AS includes 258a8f7f3fcSMatthias RingwaldAS_INCLUDES = 259a8f7f3fcSMatthias Ringwald 260a8f7f3fcSMatthias Ringwald# C includes 261a8f7f3fcSMatthias RingwaldC_INCLUDES = \ 262a8f7f3fcSMatthias Ringwald-ICore/Inc \ 263a8f7f3fcSMatthias Ringwald-IDrivers/STM32F4xx_HAL_Driver/Inc \ 264a8f7f3fcSMatthias Ringwald-IDrivers/STM32F4xx_HAL_Driver/Inc/Legacy \ 265a8f7f3fcSMatthias Ringwald-IDrivers/CMSIS/Device/ST/STM32F4xx/Include \ 266a8f7f3fcSMatthias Ringwald-IDrivers/CMSIS/Include \ 2674317f7c8SMatthias Ringwald-IMiddlewares/ST/STM32_USB_Host_Library/Core/Inc \ 2684317f7c8SMatthias Ringwald-IMiddlewares/ST/STM32_USB_Host_Library/Class/HID/Inc \ 269a8f7f3fcSMatthias Ringwald 2704317f7c8SMatthias RingwaldC_INCLUDES += -I$(BUILD_DIR) 2714317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/src/ble 2724317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/src/ble/gatt-service 2734317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/src/classic 2744317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/src 2754317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/micro-ecc 2764317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/include 2774317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/include 2784317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/hxcmod-player 2794317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/hxcmod-player/mods 2804317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/lwip/core/src/include 2814317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/lwip/dhcp-server 2824317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/md5 2834317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/yxml 2844317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/segger-rtt 2854317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/platform/embedded 2864317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/platform/lwip 2874317f7c8SMatthias RingwaldC_INCLUDES += -I${BTSTACK_ROOT}/platform/lwip/port 2884317f7c8SMatthias Ringwald 2894317f7c8SMatthias RingwaldC_INCLUDES += -I bsp 2904317f7c8SMatthias RingwaldC_INCLUDES += -I pdm 2914317f7c8SMatthias RingwaldC_INCLUDES += -I port 2924317f7c8SMatthias RingwaldC_INCLUDES += -I Core/Src 2934317f7c8SMatthias RingwaldC_INCLUDES += -I USB_HOST/Target 2944317f7c8SMatthias RingwaldC_INCLUDES += -I USB_HOST/App 295a8f7f3fcSMatthias Ringwald 296a8f7f3fcSMatthias Ringwald# compile gcc flags 297a8f7f3fcSMatthias RingwaldASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections 298a8f7f3fcSMatthias Ringwald 299a8f7f3fcSMatthias RingwaldCFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections 300a8f7f3fcSMatthias Ringwald 301a8f7f3fcSMatthias Ringwaldifeq ($(DEBUG), 1) 302a8f7f3fcSMatthias RingwaldCFLAGS += -g -gdwarf-2 303a8f7f3fcSMatthias Ringwaldendif 304a8f7f3fcSMatthias Ringwald 305a8f7f3fcSMatthias Ringwald 306a8f7f3fcSMatthias Ringwald# Generate dependency information 307a8f7f3fcSMatthias RingwaldCFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" 308a8f7f3fcSMatthias Ringwald 309a8f7f3fcSMatthias Ringwald 310a8f7f3fcSMatthias Ringwald####################################### 311a8f7f3fcSMatthias Ringwald# LDFLAGS 312a8f7f3fcSMatthias Ringwald####################################### 313a8f7f3fcSMatthias Ringwald# link script 314a8f7f3fcSMatthias RingwaldLDSCRIPT = STM32F407VGTx_FLASH.ld 315a8f7f3fcSMatthias Ringwald 316f763b8ceSMatthias RingwaldLIBS = -lPDMFilter_CM4_GCC -lc -lm -lnosys 317f763b8ceSMatthias RingwaldLIBDIR = -Lpdm 318a8f7f3fcSMatthias RingwaldLDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections 319e0a94143SDirk Helbig# this is required for libc based compiler if printf support for floating point is needed 320e0a94143SDirk Helbig#LDFLAGS += -u_printf_float 321a8f7f3fcSMatthias Ringwald 322a8f7f3fcSMatthias Ringwald# default action: build all 3234317f7c8SMatthias RingwaldEXAMPLES = \ 3244317f7c8SMatthias Ringwald audio_duplex \ 3254317f7c8SMatthias Ringwald a2dp_sink_demo \ 3264317f7c8SMatthias Ringwald a2dp_source_demo \ 3274317f7c8SMatthias Ringwald ancs_client_demo \ 3284317f7c8SMatthias Ringwald dut_mode_classic \ 3294317f7c8SMatthias Ringwald gap_dedicated_bonding \ 3304317f7c8SMatthias Ringwald gap_inquiry \ 3314317f7c8SMatthias Ringwald gap_le_advertisements \ 3324317f7c8SMatthias Ringwald gatt_battery_query \ 3334317f7c8SMatthias Ringwald gatt_browser \ 3344317f7c8SMatthias Ringwald gatt_counter \ 3354317f7c8SMatthias Ringwald gatt_streamer_server \ 3364317f7c8SMatthias Ringwald hfp_ag_demo \ 3374317f7c8SMatthias Ringwald hfp_hf_demo \ 3384317f7c8SMatthias Ringwald hid_host_demo \ 3394317f7c8SMatthias Ringwald hid_keyboard_demo \ 3404317f7c8SMatthias Ringwald hid_mouse_demo \ 3414317f7c8SMatthias Ringwald hog_keyboard_demo \ 3424317f7c8SMatthias Ringwald hog_mouse_demo \ 3434317f7c8SMatthias Ringwald hsp_ag_demo \ 3444317f7c8SMatthias Ringwald hsp_hs_demo \ 3454317f7c8SMatthias Ringwald mod_player \ 3464317f7c8SMatthias Ringwald le_streamer_client \ 3474317f7c8SMatthias Ringwald pan_lwip_http_server \ 3484317f7c8SMatthias Ringwald pbap_client_demo \ 3494317f7c8SMatthias Ringwald sdp_bnep_query \ 3504317f7c8SMatthias Ringwald sdp_general_query \ 3514317f7c8SMatthias Ringwald sdp_rfcomm_query \ 3524317f7c8SMatthias Ringwald sine_player \ 3534317f7c8SMatthias Ringwald sm_pairing_central \ 3544317f7c8SMatthias Ringwald sm_pairing_peripheral \ 3554317f7c8SMatthias Ringwald spp_and_gatt_counter \ 3564317f7c8SMatthias Ringwald spp_and_gatt_streamer \ 3574317f7c8SMatthias Ringwald spp_counter \ 3584317f7c8SMatthias Ringwald spp_streamer \ 3594317f7c8SMatthias Ringwald spp_streamer_client \ 3604317f7c8SMatthias Ringwald 3614317f7c8SMatthias RingwaldGATT_FILES = \ 3624317f7c8SMatthias Ringwald ancs_client_demo.gatt \ 3634317f7c8SMatthias Ringwald gatt_counter.gatt \ 3644317f7c8SMatthias Ringwald gatt_streamer_server.gatt \ 3654317f7c8SMatthias Ringwald gatt_browser.gatt \ 3664317f7c8SMatthias Ringwald gatt_battery_query.gatt \ 3674317f7c8SMatthias Ringwald hog_keyboard_demo.gatt \ 3684317f7c8SMatthias Ringwald hog_mouse_demo.gatt \ 3694317f7c8SMatthias Ringwald sm_pairing_peripheral.gatt \ 3704317f7c8SMatthias Ringwald sm_pairing_central.gatt \ 3714317f7c8SMatthias Ringwald spp_and_gatt_counter.gatt \ 3724317f7c8SMatthias Ringwald spp_and_gatt_streamer.gatt \ 3734317f7c8SMatthias Ringwald 3744317f7c8SMatthias Ringwald# SBC codec 3754317f7c8SMatthias Ringwaldinclude ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/Makefile.inc 3764317f7c8SMatthias Ringwaldinclude ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/Makefile.inc 3774317f7c8SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/srce 3784317f7c8SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/srce 3794317f7c8SMatthias RingwaldC_SOURCES += ${SBC_ENCODER} 3804317f7c8SMatthias RingwaldC_SOURCES += ${SBC_DECODER} 381a8f7f3fcSMatthias Ringwald 382a8f7f3fcSMatthias Ringwald 383a8f7f3fcSMatthias Ringwald####################################### 384a8f7f3fcSMatthias Ringwald# build the application 385a8f7f3fcSMatthias Ringwald####################################### 386a8f7f3fcSMatthias Ringwald# list of objects 387a8f7f3fcSMatthias RingwaldOBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o))) 388a8f7f3fcSMatthias Ringwaldvpath %.c $(sort $(dir $(C_SOURCES))) 389a8f7f3fcSMatthias Ringwald# list of ASM program objects 390a8f7f3fcSMatthias RingwaldOBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o))) 391a8f7f3fcSMatthias Ringwaldvpath %.s $(sort $(dir $(ASM_SOURCES))) 3924317f7c8SMatthias Ringwaldall: \ 3934317f7c8SMatthias Ringwald $(OBJECTS) \ 3944317f7c8SMatthias Ringwald $(addprefix $(BUILD_DIR)/,$(GATT_FILES:.gatt=.h)) \ 3954317f7c8SMatthias Ringwald $(addprefix $(BUILD_DIR)/,$(EXAMPLES:=.elf)) \ 3964317f7c8SMatthias Ringwald $(addprefix $(BUILD_DIR)/,$(EXAMPLES:=.hex)) \ 3974317f7c8SMatthias Ringwald $(addprefix $(BUILD_DIR)/,$(EXAMPLES:=.bin)) \ 3984317f7c8SMatthias Ringwald $(addprefix $(BUILD_DIR)/,$(EXAMPLES:=.jdebug)) \ 3994317f7c8SMatthias Ringwald 4004317f7c8SMatthias Ringwald 4014317f7c8SMatthias Ringwald$(BUILD_DIR)/%.h: %.gatt 4024317f7c8SMatthias Ringwald python3 ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ 4034317f7c8SMatthias Ringwald 404a8f7f3fcSMatthias Ringwald 405a8f7f3fcSMatthias Ringwald$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) 406a8f7f3fcSMatthias Ringwald $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@ 407a8f7f3fcSMatthias Ringwald 408a8f7f3fcSMatthias Ringwald$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR) 409a8f7f3fcSMatthias Ringwald $(AS) -c $(CFLAGS) $< -o $@ 4104317f7c8SMatthias Ringwald$(BUILD_DIR)/%.elf: Makefile $(OBJECTS) $(BUILD_DIR)/%.o 4114317f7c8SMatthias Ringwald $(CC) $(filter-out Makefile,$^) $(LDFLAGS) -o $@ 412a8f7f3fcSMatthias Ringwald $(SZ) $@ 413a8f7f3fcSMatthias Ringwald 414a8f7f3fcSMatthias Ringwald$(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR) 415a8f7f3fcSMatthias Ringwald $(HEX) $< $@ 416a8f7f3fcSMatthias Ringwald 417a8f7f3fcSMatthias Ringwald$(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR) 418a8f7f3fcSMatthias Ringwald $(BIN) $< $@ 419a8f7f3fcSMatthias Ringwald 4204317f7c8SMatthias Ringwald$(BUILD_DIR)/%.jdebug: ozone.jdebug | $(BUILD_DIR) 4214317f7c8SMatthias Ringwald sed -e "s|EXAMPLE|$(basename $(notdir $@))|" $< > $@ 4224317f7c8SMatthias Ringwald 423a8f7f3fcSMatthias Ringwald$(BUILD_DIR): 424a8f7f3fcSMatthias Ringwald mkdir $@ 425a8f7f3fcSMatthias Ringwald 426a8f7f3fcSMatthias Ringwald####################################### 427a8f7f3fcSMatthias Ringwald# clean up 428a8f7f3fcSMatthias Ringwald####################################### 429a8f7f3fcSMatthias Ringwaldclean: 430a8f7f3fcSMatthias Ringwald -rm -fR $(BUILD_DIR) 431a8f7f3fcSMatthias Ringwald 432a8f7f3fcSMatthias Ringwald####################################### 433a8f7f3fcSMatthias Ringwald# dependencies 434a8f7f3fcSMatthias Ringwald####################################### 435a8f7f3fcSMatthias Ringwald-include $(wildcard $(BUILD_DIR)/*.d) 436a8f7f3fcSMatthias Ringwald 437a8f7f3fcSMatthias Ringwald# *** EOF *** 438