mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-17 13:12:05 +00:00
build: bring makefiles closer
This commit is contained in:
parent
00f566c434
commit
05306ad79d
@ -3,8 +3,8 @@ SRCDIR_MP = vendor/micropython
|
||||
SRCDIR_FW = micropython
|
||||
|
||||
# target directory
|
||||
BUILD ?= micropython/boardloader/build
|
||||
TARGET ?= boardloader
|
||||
BUILD ?= micropython/$(TARGET)/build
|
||||
|
||||
# include py core make definitions
|
||||
include $(SRCDIR_MP)/py/mkenv.mk
|
||||
@ -95,7 +95,7 @@ SRC_MOD = $(patsubst $(BUILD_FW)%.o, $(SRCDIR_FW)%.c, $(OBJ_MOD))
|
||||
CROSS_COMPILE = arm-none-eabi-
|
||||
|
||||
INC += -I.
|
||||
INC += -I$(SRCDIR_FW)/boardloader
|
||||
INC += -I$(SRCDIR_FW)/$(TARGET)
|
||||
INC += -I$(SRCDIR_FW)/extmod/modtrezorui
|
||||
INC += -I$(SRCDIR_FW)/trezorhal
|
||||
INC += -I$(SRCDIR_FW)/trezorhal/hal
|
||||
@ -121,7 +121,7 @@ CFLAGS += -DSTM32_HAL_H='<stm32f4xx_hal.h>'
|
||||
|
||||
LIBS = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
|
||||
|
||||
LDFLAGS = -nostdlib -T $(SRCDIR_FW)/boardloader/memory.ld -Map=$@.map --cref
|
||||
LDFLAGS = -nostdlib -T $(SRCDIR_FW)/$(TARGET)/memory.ld -Map=$@.map --cref
|
||||
|
||||
# remove uncalled code from the final image
|
||||
CFLAGS += -fdata-sections -ffunction-sections
|
||||
@ -138,7 +138,7 @@ $(BUILD)/$(TARGET).elf: $(OBJ)
|
||||
$(Q)$(SIZE) $@
|
||||
|
||||
$(BUILD)/$(TARGET).bin: $(BUILD)/$(TARGET).elf
|
||||
$(Q)$(OBJCOPY) -O binary -j .flash -j .data $^ $(BUILD)/$(TARGET).bin
|
||||
$(Q)$(OBJCOPY) -O binary -j .header -j .flash -j .data $^ $(BUILD)/$(TARGET).bin
|
||||
|
||||
$(BUILD)/%.o: %.S
|
||||
$(ECHO) "CC $<"
|
||||
|
@ -3,8 +3,8 @@ SRCDIR_MP = vendor/micropython
|
||||
SRCDIR_FW = micropython
|
||||
|
||||
# target directory
|
||||
BUILD ?= micropython/bootloader/build
|
||||
TARGET ?= bootloader
|
||||
BUILD ?= micropython/$(TARGET)/build
|
||||
|
||||
# include py core make definitions
|
||||
include $(SRCDIR_MP)/py/mkenv.mk
|
||||
@ -106,7 +106,7 @@ SRC_MOD = $(patsubst $(BUILD_FW)%.o, $(SRCDIR_FW)%.c, $(OBJ_MOD))
|
||||
CROSS_COMPILE = arm-none-eabi-
|
||||
|
||||
INC += -I.
|
||||
INC += -I$(SRCDIR_FW)/bootloader
|
||||
INC += -I$(SRCDIR_FW)/$(TARGET)
|
||||
INC += -I$(SRCDIR_FW)/extmod/modtrezorui
|
||||
INC += -I$(SRCDIR_FW)/trezorhal
|
||||
INC += -I$(SRCDIR_FW)/trezorhal/hal
|
||||
@ -132,7 +132,7 @@ CFLAGS += -DSTM32_HAL_H='<stm32f4xx_hal.h>'
|
||||
|
||||
LIBS = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
|
||||
|
||||
LDFLAGS = -nostdlib -T $(SRCDIR_FW)/bootloader/memory.ld -Map=$@.map --cref
|
||||
LDFLAGS = -nostdlib -T $(SRCDIR_FW)/$(TARGET)/memory.ld -Map=$@.map --cref
|
||||
|
||||
# remove uncalled code from the final image
|
||||
CFLAGS += -fdata-sections -ffunction-sections
|
||||
|
@ -6,8 +6,8 @@ SRCDIR_FW = micropython
|
||||
FROZEN_MPY_DIR ?= src
|
||||
|
||||
# target directory
|
||||
BUILD ?= micropython/firmware/build
|
||||
TARGET ?= firmware
|
||||
BUILD ?= micropython/$(TARGET)/build
|
||||
|
||||
# include py core make definitions
|
||||
include $(SRCDIR_MP)/py/mkenv.mk
|
||||
@ -333,7 +333,7 @@ SRC_MOD = $(patsubst $(BUILD_FW)%.o, $(SRCDIR_FW)%.c, $(OBJ_MOD))
|
||||
CROSS_COMPILE = arm-none-eabi-
|
||||
|
||||
INC += -I.
|
||||
INC += -I$(SRCDIR_FW)/firmware
|
||||
INC += -I$(SRCDIR_FW)/$(TARGET)
|
||||
INC += -I$(SRCDIR_FW)/extmod/modtrezorui
|
||||
INC += -I$(SRCDIR_FW)/trezorhal
|
||||
INC += -I$(SRCDIR_FW)/trezorhal/hal
|
||||
@ -362,7 +362,7 @@ CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
|
||||
|
||||
LIBS = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
|
||||
|
||||
LDFLAGS = -nostdlib -T $(SRCDIR_FW)/firmware/memory.ld -Map=$@.map --cref
|
||||
LDFLAGS = -nostdlib -T $(SRCDIR_FW)/$(TARGET)/memory.ld -Map=$@.map --cref
|
||||
|
||||
# remove uncalled code from the final image
|
||||
CFLAGS += -fdata-sections -ffunction-sections
|
||||
|
Loading…
Reference in New Issue
Block a user