1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-12 18:49:07 +00:00

travis: introduce stm32/unix goals

This commit is contained in:
Pavol Rusnak 2017-04-21 16:45:15 +02:00
parent f64330f4eb
commit 998ae134a9
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
4 changed files with 40 additions and 36 deletions

View File

@ -6,6 +6,15 @@ compiler:
- clang
- gcc
env:
- GOAL=stm32
- GOAL=unix
matrix:
exclude:
- compiler: clang
env: GOAL=stm32
addons:
apt:
packages:
@ -18,19 +27,14 @@ install:
- pip3 install ed25519 pyblake2
script:
- test "$CC" = "clang" || make vendorheader
- test "$GOAL" != "stm32" || test "$CC" != "gcc" || make vendorheader
- test "$GOAL" != "stm32" || test "$CC" != "gcc" || make build_cross
- test "$GOAL" != "stm32" || test "$CC" != "gcc" || make build_boardloader
- test "$GOAL" != "stm32" || test "$CC" != "gcc" || make build_bootloader
- test "$GOAL" != "stm32" || test "$CC" != "gcc" || make build_firmware
- test "$CC" = "clang" || make build_cross
- test "$CC" = "clang" || make build_boardloader
- test "$CC" = "clang" || make build_bootloader
- test "$CC" = "clang" || make build_firmware
- make build_unix TREZOR_NOUI=1
- test "$CC" = "clang" || make test
- test "$GOAL" != "unix" || make build_unix TREZOR_NOUI=1
- test "$GOAL" != "unix" || make test
notifications:
webhooks:

View File

@ -3,8 +3,8 @@ SRCDIR_MP = vendor/micropython
SRCDIR_FW = micropython
# target directory
TARGET ?= boardloader
BUILD ?= micropython/$(TARGET)/build
PROJECT ?= boardloader
BUILD ?= micropython/$(PROJECT)/build
# include py core make definitions
include $(SRCDIR_MP)/py/mkenv.mk
@ -93,7 +93,7 @@ OBJ += $(OBJ_BOARDLOADER)
CROSS_COMPILE = arm-none-eabi-
INC += -I.
INC += -I$(SRCDIR_FW)/$(TARGET)
INC += -I$(SRCDIR_FW)/$(PROJECT)
INC += -I$(SRCDIR_FW)/extmod/modtrezorui
INC += -I$(SRCDIR_FW)/trezorhal
INC += -I$(SRCDIR_FW)/trezorhal/hal
@ -119,7 +119,7 @@ CFLAGS += -DTREZOR_STM32
LIBS = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
LDFLAGS = -nostdlib -T $(SRCDIR_FW)/$(TARGET)/memory.ld -Map=$@.map --cref
LDFLAGS = -nostdlib -T $(SRCDIR_FW)/$(PROJECT)/memory.ld -Map=$@.map --cref
# remove uncalled code from the final image
CFLAGS += -fdata-sections -ffunction-sections
@ -128,15 +128,15 @@ LDFLAGS += --gc-sections
# comp rules
# =====================================
all: $(BUILD)/$(TARGET).bin
all: $(BUILD)/$(PROJECT).bin
$(BUILD)/$(TARGET).elf: $(OBJ)
$(BUILD)/$(PROJECT).elf: $(OBJ)
$(ECHO) "LINK $@"
$(Q)$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
$(Q)$(SIZE) $@
$(BUILD)/$(TARGET).bin: $(BUILD)/$(TARGET).elf
$(Q)$(OBJCOPY) -O binary -j .header -j .flash -j .data $^ $(BUILD)/$(TARGET).bin
$(BUILD)/$(PROJECT).bin: $(BUILD)/$(PROJECT).elf
$(Q)$(OBJCOPY) -O binary -j .header -j .flash -j .data $^ $(BUILD)/$(PROJECT).bin
$(BUILD)/%.o: %.S
$(ECHO) "CC $<"

View File

@ -3,8 +3,8 @@ SRCDIR_MP = vendor/micropython
SRCDIR_FW = micropython
# target directory
TARGET ?= bootloader
BUILD ?= micropython/$(TARGET)/build
PROJECT ?= bootloader
BUILD ?= micropython/$(PROJECT)/build
# include py core make definitions
include $(SRCDIR_MP)/py/mkenv.mk
@ -105,7 +105,7 @@ OBJ += $(OBJ_BOOTLOADER)
CROSS_COMPILE = arm-none-eabi-
INC += -I.
INC += -I$(SRCDIR_FW)/$(TARGET)
INC += -I$(SRCDIR_FW)/$(PROJECT)
INC += -I$(SRCDIR_FW)/extmod/modtrezorui
INC += -I$(SRCDIR_FW)/trezorhal
INC += -I$(SRCDIR_FW)/trezorhal/hal
@ -131,7 +131,7 @@ CFLAGS += -DTREZOR_STM32
LIBS = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
LDFLAGS = -nostdlib -T $(SRCDIR_FW)/$(TARGET)/memory.ld -Map=$@.map --cref
LDFLAGS = -nostdlib -T $(SRCDIR_FW)/$(PROJECT)/memory.ld -Map=$@.map --cref
# remove uncalled code from the final image
CFLAGS += -fdata-sections -ffunction-sections
@ -140,15 +140,15 @@ LDFLAGS += --gc-sections
# comp rules
# =====================================
all: $(BUILD)/$(TARGET).bin
all: $(BUILD)/$(PROJECT).bin
$(BUILD)/$(TARGET).elf: $(OBJ)
$(BUILD)/$(PROJECT).elf: $(OBJ)
$(ECHO) "LINK $@"
$(Q)$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
$(Q)$(SIZE) $@
$(BUILD)/$(TARGET).bin: $(BUILD)/$(TARGET).elf
$(Q)$(OBJCOPY) -O binary -j .header -j .flash -j .data $^ $(BUILD)/$(TARGET).bin
$(BUILD)/$(PROJECT).bin: $(BUILD)/$(PROJECT).elf
$(Q)$(OBJCOPY) -O binary -j .header -j .flash -j .data $^ $(BUILD)/$(PROJECT).bin
$(BUILD)/%.o: %.S
$(ECHO) "CC $<"

View File

@ -6,8 +6,8 @@ SRCDIR_FW = micropython
FROZEN_MPY_DIR ?= src
# target directory
TARGET ?= firmware
BUILD ?= micropython/$(TARGET)/build
PROJECT ?= firmware
BUILD ?= micropython/$(PROJECT)/build
# include py core make definitions
include $(SRCDIR_MP)/py/mkenv.mk
@ -348,7 +348,7 @@ SRC_MOD = $(patsubst $(BUILD_FW)%.o, $(SRCDIR_FW)%.c, $(OBJ_MOD))
CROSS_COMPILE = arm-none-eabi-
INC += -I.
INC += -I$(SRCDIR_FW)/$(TARGET)
INC += -I$(SRCDIR_FW)/$(PROJECT)
INC += -I$(SRCDIR_FW)/extmod/modtrezorui
INC += -I$(SRCDIR_FW)/trezorhal
INC += -I$(SRCDIR_FW)/trezorhal/hal
@ -377,7 +377,7 @@ CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
LIBS = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
LDFLAGS = -nostdlib -T $(SRCDIR_FW)/$(TARGET)/memory.ld -Map=$@.map --cref
LDFLAGS = -nostdlib -T $(SRCDIR_FW)/$(PROJECT)/memory.ld -Map=$@.map --cref
# remove uncalled code from the final image
CFLAGS += -fdata-sections -ffunction-sections
@ -402,20 +402,20 @@ QSTR_GEN_EXTRA_CFLAGS += -DNO_QSTR -DN_X64 -DN_X86 -DN_THUMB -DN_ARM -DN_XTENSA
# comp rules
# =====================================
all: $(BUILD)/$(TARGET).bin
all: $(BUILD)/$(PROJECT).bin
$(BUILD_FW)/firmware/vendorheader.o: $(SRCDIR_FW)/firmware/vendorheader.bin
$(Q)$(OBJCOPY) -I binary -O elf32-littlearm -B arm \
--rename-section .data=.vendorheader,alloc,load,readonly,contents \
$< $@
$(BUILD)/$(TARGET).elf: $(OBJ)
$(BUILD)/$(PROJECT).elf: $(OBJ)
$(ECHO) "LINK $@"
$(Q)$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
$(Q)$(SIZE) $@
$(BUILD)/$(TARGET).bin: $(BUILD)/$(TARGET).elf
$(Q)$(OBJCOPY) -O binary -j .header -j .flash -j .data $^ $(BUILD)/$(TARGET).bin
$(BUILD)/$(PROJECT).bin: $(BUILD)/$(PROJECT).elf
$(Q)$(OBJCOPY) -O binary -j .header -j .flash -j .data $^ $(BUILD)/$(PROJECT).bin
$(BUILD)/%.o: %.S
$(ECHO) "CC $<"