1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 22:38:08 +00:00

build: bring makefiles closer

This commit is contained in:
Pavol Rusnak 2017-04-13 23:30:32 +02:00
parent 00f566c434
commit 05306ad79d
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
3 changed files with 10 additions and 10 deletions

View File

@ -3,8 +3,8 @@ SRCDIR_MP = vendor/micropython
SRCDIR_FW = micropython SRCDIR_FW = micropython
# target directory # target directory
BUILD ?= micropython/boardloader/build
TARGET ?= boardloader TARGET ?= boardloader
BUILD ?= micropython/$(TARGET)/build
# include py core make definitions # include py core make definitions
include $(SRCDIR_MP)/py/mkenv.mk 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- CROSS_COMPILE = arm-none-eabi-
INC += -I. INC += -I.
INC += -I$(SRCDIR_FW)/boardloader INC += -I$(SRCDIR_FW)/$(TARGET)
INC += -I$(SRCDIR_FW)/extmod/modtrezorui INC += -I$(SRCDIR_FW)/extmod/modtrezorui
INC += -I$(SRCDIR_FW)/trezorhal INC += -I$(SRCDIR_FW)/trezorhal
INC += -I$(SRCDIR_FW)/trezorhal/hal 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) 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 # remove uncalled code from the final image
CFLAGS += -fdata-sections -ffunction-sections CFLAGS += -fdata-sections -ffunction-sections
@ -138,7 +138,7 @@ $(BUILD)/$(TARGET).elf: $(OBJ)
$(Q)$(SIZE) $@ $(Q)$(SIZE) $@
$(BUILD)/$(TARGET).bin: $(BUILD)/$(TARGET).elf $(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 $(BUILD)/%.o: %.S
$(ECHO) "CC $<" $(ECHO) "CC $<"

View File

@ -3,8 +3,8 @@ SRCDIR_MP = vendor/micropython
SRCDIR_FW = micropython SRCDIR_FW = micropython
# target directory # target directory
BUILD ?= micropython/bootloader/build
TARGET ?= bootloader TARGET ?= bootloader
BUILD ?= micropython/$(TARGET)/build
# include py core make definitions # include py core make definitions
include $(SRCDIR_MP)/py/mkenv.mk 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- CROSS_COMPILE = arm-none-eabi-
INC += -I. INC += -I.
INC += -I$(SRCDIR_FW)/bootloader INC += -I$(SRCDIR_FW)/$(TARGET)
INC += -I$(SRCDIR_FW)/extmod/modtrezorui INC += -I$(SRCDIR_FW)/extmod/modtrezorui
INC += -I$(SRCDIR_FW)/trezorhal INC += -I$(SRCDIR_FW)/trezorhal
INC += -I$(SRCDIR_FW)/trezorhal/hal 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) 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 # remove uncalled code from the final image
CFLAGS += -fdata-sections -ffunction-sections CFLAGS += -fdata-sections -ffunction-sections

View File

@ -6,8 +6,8 @@ SRCDIR_FW = micropython
FROZEN_MPY_DIR ?= src FROZEN_MPY_DIR ?= src
# target directory # target directory
BUILD ?= micropython/firmware/build
TARGET ?= firmware TARGET ?= firmware
BUILD ?= micropython/$(TARGET)/build
# include py core make definitions # include py core make definitions
include $(SRCDIR_MP)/py/mkenv.mk 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- CROSS_COMPILE = arm-none-eabi-
INC += -I. INC += -I.
INC += -I$(SRCDIR_FW)/firmware INC += -I$(SRCDIR_FW)/$(TARGET)
INC += -I$(SRCDIR_FW)/extmod/modtrezorui INC += -I$(SRCDIR_FW)/extmod/modtrezorui
INC += -I$(SRCDIR_FW)/trezorhal INC += -I$(SRCDIR_FW)/trezorhal
INC += -I$(SRCDIR_FW)/trezorhal/hal INC += -I$(SRCDIR_FW)/trezorhal/hal
@ -362,7 +362,7 @@ CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
LIBS = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) 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 # remove uncalled code from the final image
CFLAGS += -fdata-sections -ffunction-sections CFLAGS += -fdata-sections -ffunction-sections