1########################################################################################################################## 2# File automatically-generated by tool: [projectgenerator] version: [3.7.1] date: [Mon Jun 29 18:40:02 CEST 2020] 3########################################################################################################################## 4 5# ------------------------------------------------ 6# Generic Makefile (based on gcc) 7# 8# ChangeLog : 9# 2017-02-10 - Several enhancements + project update mode 10# 2015-07-22 - first version 11# ------------------------------------------------ 12 13###################################### 14# target 15###################################### 16TARGET = sx1280-ble 17 18 19###################################### 20# building variables 21###################################### 22# debug build? 23DEBUG = 1 24# optimization 25OPT = -Og 26 27 28####################################### 29# paths 30####################################### 31# Build path 32BUILD_DIR = build 33 34# BTstack Repo 35BTSTACK_ROOT ?= ../.. 36 37# VPATH to find .gatt files 38VPATH += ${BTSTACK_ROOT}/example 39 40###################################### 41# source 42###################################### 43# C sources 44C_SOURCES = \ 45${BTSTACK_ROOT}/3rd-party/micro-ecc/uECC.c \ 46${BTSTACK_ROOT}/3rd-party/rijndael/rijndael.c \ 47${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT.c \ 48${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_printf.c \ 49${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_Syscalls_GCC.c \ 50${BTSTACK_ROOT}/platform/embedded/btstack_run_loop_embedded.c \ 51${BTSTACK_ROOT}/src/ad_parser.c \ 52${BTSTACK_ROOT}/src/ble/ancs_client.c \ 53${BTSTACK_ROOT}/src/ble/att_db.c \ 54${BTSTACK_ROOT}/src/ble/att_dispatch.c \ 55${BTSTACK_ROOT}/src/ble/att_server.c \ 56${BTSTACK_ROOT}/src/ble/gatt-service/battery_service_server.c \ 57${BTSTACK_ROOT}/src/ble/gatt-service/device_information_service_server.c \ 58${BTSTACK_ROOT}/src/ble/gatt-service/hids_device.c \ 59${BTSTACK_ROOT}/src/ble/gatt_client.c \ 60${BTSTACK_ROOT}/src/ble/le_device_db_memory.c \ 61${BTSTACK_ROOT}/src/ble/le_device_db_tlv.c \ 62${BTSTACK_ROOT}/src/ble/sm.c \ 63${BTSTACK_ROOT}/src/btstack_audio.c \ 64${BTSTACK_ROOT}/src/btstack_crypto.c \ 65${BTSTACK_ROOT}/src/btstack_hid_parser.c \ 66${BTSTACK_ROOT}/src/btstack_linked_list.c \ 67${BTSTACK_ROOT}/src/btstack_linked_queue.c \ 68${BTSTACK_ROOT}/src/btstack_memory.c \ 69${BTSTACK_ROOT}/src/btstack_memory_pool.c \ 70${BTSTACK_ROOT}/src/btstack_resample.c \ 71${BTSTACK_ROOT}/src/btstack_ring_buffer.c \ 72${BTSTACK_ROOT}/src/btstack_run_loop.c \ 73${BTSTACK_ROOT}/src/btstack_tlv.c \ 74${BTSTACK_ROOT}/src/btstack_tlv_none.c \ 75${BTSTACK_ROOT}/src/btstack_util.c \ 76${BTSTACK_ROOT}/src/hci.c \ 77${BTSTACK_ROOT}/src/hci_cmd.c \ 78${BTSTACK_ROOT}/src/hci_dump.c \ 79${BTSTACK_ROOT}/src/hci_transport_h4.c \ 80${BTSTACK_ROOT}/src/l2cap.c \ 81${BTSTACK_ROOT}/src/l2cap_signaling.c \ 82${BTSTACK_ROOT}/chipset/sx128x/controller.c \ 83${BTSTACK_ROOT}/chipset/sx128x/hci_event.c \ 84${BTSTACK_ROOT}/chipset/sx128x//hopping.c \ 85${BTSTACK_ROOT}/chipset/sx128x//ll_sx1280.c \ 86${BTSTACK_ROOT}/chipset/sx128x/SMTC_Drivers/sx1280-driver-c/sx1280-hal.c \ 87${BTSTACK_ROOT}/chipset/sx128x/SMTC_Drivers/sx1280-driver-c/sx1280.c \ 88Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c \ 89Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c \ 90Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c \ 91Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.c \ 92Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c \ 93Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c \ 94Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c \ 95Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.c \ 96Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c \ 97Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c \ 98Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c \ 99Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_lptim.c \ 100Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c \ 101Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c \ 102Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c \ 103Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c \ 104Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi.c \ 105Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi_ex.c \ 106Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c \ 107Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c \ 108port/hal_timer.c \ 109port/btstack_port.c \ 110Src/main.c \ 111Src/stm32l4xx_hal_msp.c \ 112Src/stm32l4xx_it.c \ 113Src/system_stm32l4xx.c \ 114 115# ${BTSTACK_ROOT}/platform/embedded/hal_flash_bank_memory.c \ 116# ${BTSTACK_ROOT}/platform/embedded/btstack_tlv_flash_bank.c \ 117 118 119# ASM sources 120ASM_SOURCES = \ 121startup_stm32l451xx.s 122 123 124####################################### 125# binaries 126####################################### 127PREFIX = arm-none-eabi- 128# The gcc compiler bin path can be either defined in make command via GCC_PATH variable (> make GCC_PATH=xxx) 129# either it can be added to the PATH environment variable. 130ifdef GCC_PATH 131CC = $(GCC_PATH)/$(PREFIX)gcc 132AS = $(GCC_PATH)/$(PREFIX)gcc -x assembler-with-cpp 133CP = $(GCC_PATH)/$(PREFIX)objcopy 134SZ = $(GCC_PATH)/$(PREFIX)size 135else 136CC = $(PREFIX)gcc 137AS = $(PREFIX)gcc -x assembler-with-cpp 138CP = $(PREFIX)objcopy 139SZ = $(PREFIX)size 140endif 141HEX = $(CP) -O ihex 142BIN = $(CP) -O binary -S 143 144####################################### 145# CFLAGS 146####################################### 147# cpu 148CPU = -mcpu=cortex-m4 149 150# fpu 151FPU = -mfpu=fpv4-sp-d16 152 153# float-abi 154FLOAT-ABI = -mfloat-abi=hard 155 156# mcu 157MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI) 158 159# macros for gcc 160# AS defines 161AS_DEFS = 162 163# C defines 164C_DEFS = \ 165-DUSE_HAL_DRIVER \ 166-DSTM32L451xx 167 168 169# AS includes 170AS_INCLUDES = 171 172# C includes 173C_INCLUDES = \ 174-I $(BUILD_DIR) \ 175-I ${BTSTACK_ROOT}/3rd-party/micro-ecc \ 176-I ${BTSTACK_ROOT}/3rd-party/rijndael \ 177-I ${BTSTACK_ROOT}/3rd-party/segger-rtt \ 178-I ${BTSTACK_ROOT}/platform/embedded \ 179-I ${BTSTACK_ROOT}/src \ 180-I ${BTSTACK_ROOT}/src/ble \ 181-I ${BTSTACK_ROOT}/src/ble/gatt-service \ 182-I ${BTSTACK_ROOT}/chipset/sx128x \ 183-I ${BTSTACK_ROOT}/chipset/sx128x/SMTC_Drivers/ \ 184-I ${BTSTACK_ROOT}/chipset/sx128x/SMTC_Drivers/sx1280-driver-c/ \ 185-I controller \ 186-I Drivers/CMSIS/Device/ST/STM32L4xx/Include \ 187-I Drivers/CMSIS/Include \ 188-I Drivers/STM32L4xx_HAL_Driver/Inc \ 189-I Drivers/STM32L4xx_HAL_Driver/Inc/Legacy \ 190-I Inc \ 191-I port \ 192-I . 193 194# compile gcc flags 195ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections 196 197CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections 198 199ifeq ($(DEBUG), 1) 200CFLAGS += -g -gdwarf-2 201endif 202 203 204# Generate dependency information 205CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" 206 207 208####################################### 209# LDFLAGS 210####################################### 211# link script 212LDSCRIPT = STM32L451REIx_FLASH.ld 213 214# libraries 215LIBS = -lc -lm -lnosys 216LIBDIR = 217LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections 218 219# default action: build all 220EXAMPLES = \ 221 gatt_counter \ 222 gatt_streamer_server \ 223# hog_keyboard_demo \ 224# hog_mouse_demo \ 225 226GATT_FILES = \ 227 gatt_counter.gatt \ 228 gatt_streamer_server.gatt \ 229 hog_keyboard_demo.gatt \ 230 hog_mouse_demo.gatt \ 231 232# default action: build all 233all: \ 234 $(OBJECTS) \ 235 $(addprefix $(BUILD_DIR)/,$(GATT_FILES:.gatt=.h)) \ 236 $(addprefix $(BUILD_DIR)/,$(EXAMPLES:=.elf)) \ 237 $(addprefix $(BUILD_DIR)/,$(EXAMPLES:=.hex)) \ 238 $(addprefix $(BUILD_DIR)/,$(EXAMPLES:=.bin)) \ 239 $(addprefix $(BUILD_DIR)/,$(EXAMPLES:=.jdebug)) \ 240 241####################################### 242# build the application 243####################################### 244# list of objects 245OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o))) 246vpath %.c $(sort $(dir $(C_SOURCES))) 247# list of ASM program objects 248OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o))) 249vpath %.s $(sort $(dir $(ASM_SOURCES))) 250 251$(BUILD_DIR)/%.h: %.gatt | $(BUILD_DIR) 252 python3 ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ 253 254$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) 255 $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@ 256 257$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR) 258 $(AS) -c $(CFLAGS) $< -o $@ 259 260$(BUILD_DIR)/%.elf: Makefile $(OBJECTS) $(BUILD_DIR)/%.o 261 $(CC) $(filter-out Makefile,$^) $(LDFLAGS) -o $@ 262 $(SZ) $@ 263 264$(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR) 265 $(HEX) $< $@ 266 267$(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR) 268 $(BIN) $< $@ 269 270$(BUILD_DIR)/%.jdebug: ozone.jdebug | $(BUILD_DIR) 271 sed -e "s|EXAMPLE|$(basename $(notdir $@))|" $< > $@ 272 273$(BUILD_DIR): 274 mkdir $@ 275 276####################################### 277# clean up 278####################################### 279clean: 280 -rm -fR $(BUILD_DIR) 281 282####################################### 283# dependencies 284####################################### 285-include $(wildcard $(BUILD_DIR)/*.d) 286 287# *** EOF *** 288