stm32-l053r8-em9304: build all examples with Makefile

This commit is contained in:
Matthias Ringwald 2017-07-04 22:38:29 +02:00
parent c31a3132ee
commit 2b0ffcfe23
3 changed files with 52 additions and 26 deletions

View File

@ -11,7 +11,7 @@
// BTstack features that can be enabled
#define ENABLE_BLE
#define ENABLE_LE_PERIPHERAL
// #define ENABLE_LE_CENTRAL
#define ENABLE_LE_CENTRAL
#define ENABLE_LOG_INFO
#define ENABLE_LOG_ERROR

View File

@ -0,0 +1 @@
build

View File

@ -1,5 +1,5 @@
##########################################################################################################################
# File automatically-generated by tool: [projectgenerator] version: [2.23.0] date: [Mon Jun 26 11:13:36 CEST 2017]
# File automatically-generated by tool: [projectgenerator] version: [2.23.0] date: [Tue Jul 04 21:25:03 CEST 2017]
##########################################################################################################################
# ------------------------------------------------
@ -80,30 +80,31 @@ Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal.c \
Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_rcc_ex.c \
Src/stm32l0xx_it.c \
../port.c \
btstack_memory.c \
btstack_linked_list.c \
btstack_ring_buffer.c \
btstack_memory_pool.c \
btstack_run_loop.c \
btstack_util.c \
ad_parser.c \
ancs_client.c \
att_db.c \
att_dispatch.c \
att_server.c \
battery_service_server.c \
btstack_linked_list.c \
btstack_memory.c \
btstack_memory_pool.c \
btstack_ring_buffer.c \
btstack_run_loop.c \
btstack_run_loop_embedded.c \
btstack_uart_block_embedded.c \
btstack_util.c \
device_information_service_server.c \
gatt_client.c \
hci.c \
hci_cmd.c \
hci_dump.c \
hci_transport_h4.c \
l2cap.c \
l2cap_signaling.c \
att_dispatch.c \
att_db.c \
att_server.c \
gatt_client.c \
le_device_db_memory.c \
sm.c \
uECC.c \
le_streamer.c \
btstack_run_loop_embedded.c \
hci_transport_h4.c \
btstack_uart_block_embedded.c \
le_device_db_memory.c \
battery_service_server.c
# ASM sources
ASM_SOURCES = \
@ -167,7 +168,9 @@ C_INCLUDES = \
-I..
C_INCLUDES += -I.
C_INCLUDES += -I$(BUILD_DIR)
C_INCLUDES += -I${BTSTACK_ROOT}/src/ble
C_INCLUDES += -I${BTSTACK_ROOT}/src/ble/gatt-service
C_INCLUDES += -I${BTSTACK_ROOT}/src/classic
C_INCLUDES += -I${BTSTACK_ROOT}/src
C_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/micro-ecc
@ -196,16 +199,28 @@ LDSCRIPT = STM32L053R8Tx_FLASH.ld
# libraries
LIBS = -lc -lm -lnosys
LIBDIR =
LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections
LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/le_streamer.map,--cref -Wl,--gc-sections
# default action: build all
all: le_counter.h le_streamer.h $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
LE_EXAMPLES = \
ancs_client_demo \
gap_le_advertisements \
gatt_battery_query \
gatt_browser \
le_counter \
le_streamer \
le_streamer_client \
sm_pairing_peripheral \
sm_pairing_central
le_counter.h: le_counter.gatt
python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
GATT_FILES = \
ancs_client_demo.gatt \
le_counter.gatt \
le_streamer.gatt \
gatt_browser.gatt \
gatt_battery_query.gatt \
sm_pairing_peripheral.gatt \
le_streamer.h: le_streamer.gatt
python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
#######################################
# build the application
@ -217,14 +232,24 @@ vpath %.c $(sort $(dir $(C_SOURCES)))
OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
vpath %.s $(sort $(dir $(ASM_SOURCES)))
all: \
$(OBJECTS) \
$(addprefix $(BUILD_DIR)/,$(GATT_FILES:.gatt=.h)) \
$(addprefix $(BUILD_DIR)/,$(LE_EXAMPLES:=.elf)) \
$(addprefix $(BUILD_DIR)/,$(LE_EXAMPLES:=.hex)) \
$(addprefix $(BUILD_DIR)/,$(LE_EXAMPLES:=.bin))
$(BUILD_DIR)/%.h: %.gatt
python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR)
$(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
$(AS) -c $(CFLAGS) $< -o $@
$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
$(CC) $(OBJECTS) $(LDFLAGS) -o $@
$(BUILD_DIR)/%.elf: $(OBJECTS) $(BUILD_DIR)/%.o Makefile
$(CC) $(filter-out Makefile,$^) $(LDFLAGS) -o $@
$(SZ) $@
$(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR)