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

build: use SRCDIR macros where possible

This commit is contained in:
Pavol Rusnak 2017-03-20 18:26:23 +01:00
parent 1c4fbd02b4
commit d23860ed67
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
3 changed files with 55 additions and 52 deletions

View File

@ -1,16 +1,17 @@
# source directories
SRCDIR_MP = vendor/micropython
SRCDIR_FW = micropython
# target directory
BUILD ?= micropython/bootloader/build
TARGET ?= bootloader
# include py core make definitions
include vendor/micropython/py/mkenv.mk
include $(SRCDIR_MP)/py/mkenv.mk
# sources
# =====================================
SRCDIR_MP = vendor/micropython
SRCDIR_FW = micropython
BUILD_MP = $(BUILD)/$(SRCDIR_MP)
BUILD_FW = $(BUILD)/$(SRCDIR_FW)
BUILD_HDR = $(BUILD)/genhdr
@ -99,18 +100,18 @@ SRC_MOD = $(patsubst $(BUILD_FW)%.o, $(SRCDIR_FW)%.c, $(OBJ_MOD))
CROSS_COMPILE = arm-none-eabi-
INC += -I.
INC += -Imicropython/extmod/modtrezorui
INC += -Imicropython/firmware
INC += -Imicropython/trezorhal
INC += -Imicropython/trezorhal/hal
INC += -Ivendor/trezor-crypto
INC += -Ivendor/micropython
INC += -Ivendor/micropython/stmhal
INC += -Ivendor/micropython/stmhal/cmsis
INC += -Ivendor/micropython/stmhal/hal/f4/inc
INC += -Ivendor/micropython/stmhal/usbdev/core/inc
INC += -Ivendor/micropython/stmhal/usbdev/class/inc
INC += -Ivendor/micropython/lib/cmsis/inc
INC += -I$(SRCDIR_FW)/extmod/modtrezorcrypto/trezor-crypto
INC += -I$(SRCDIR_FW)/extmod/modtrezorui
INC += -I$(SRCDIR_FW)/firmware
INC += -I$(SRCDIR_FW)/trezorhal
INC += -I$(SRCDIR_FW)/trezorhal/hal
INC += -I$(SRCDIR_MP)
INC += -I$(SRCDIR_MP)/stmhal
INC += -I$(SRCDIR_MP)/stmhal/cmsis
INC += -I$(SRCDIR_MP)/stmhal/hal/f4/inc
INC += -I$(SRCDIR_MP)/stmhal/usbdev/core/inc
INC += -I$(SRCDIR_MP)/stmhal/usbdev/class/inc
INC += -I$(SRCDIR_MP)/lib/cmsis/inc
INC += -I$(BUILD)
ifeq ($(DEBUG), 1)
@ -128,7 +129,7 @@ CFLAGS += -DSTM32_HAL_H='<stm32f4xx_hal.h>'
LIBS = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
LDFLAGS = -nostdlib -T micropython/trezorhal/memory.ld -Map=$@.map --cref
LDFLAGS = -nostdlib -T $(SRCDIR_FW)/trezorhal/memory.ld -Map=$@.map --cref
# remove uncalled code from the final image
CFLAGS += -fdata-sections -ffunction-sections

View File

@ -1,3 +1,7 @@
# source directories
SRCDIR_MP = vendor/micropython
SRCDIR_FW = micropython
# directory containing scripts to be frozen as bytecode
FROZEN_MPY_DIR ?= src
@ -6,18 +10,15 @@ BUILD ?= micropython/firmware/build
TARGET ?= firmware
# include py core make definitions
include vendor/micropython/py/mkenv.mk
include $(SRCDIR_MP)/py/mkenv.mk
MAKE_FROZEN = vendor/micropython/tools/make-frozen.py
MPY_CROSS = vendor/micropython/mpy-cross/mpy-cross
MPY_TOOL = vendor/micropython/tools/mpy-tool.py
MAKE_FROZEN = $(SRCDIR_MP)/tools/make-frozen.py
MPY_CROSS = $(SRCDIR_MP)/mpy-cross/mpy-cross
MPY_TOOL = $(SRCDIR_MP)/tools/mpy-tool.py
# sources
# =====================================
SRCDIR_MP = vendor/micropython
SRCDIR_FW = micropython
BUILD_MP = $(BUILD)/$(SRCDIR_MP)
BUILD_FW = $(BUILD)/$(SRCDIR_FW)
BUILD_HDR = $(BUILD)/genhdr
@ -340,16 +341,16 @@ SRC_MOD = $(patsubst $(BUILD_FW)%.o, $(SRCDIR_FW)%.c, $(OBJ_MOD))
CROSS_COMPILE = arm-none-eabi-
INC += -I.
INC += -Imicropython/firmware
INC += -Imicropython/trezorhal
INC += -Imicropython/trezorhal/hal
INC += -Ivendor/micropython
INC += -Ivendor/micropython/stmhal
INC += -Ivendor/micropython/stmhal/cmsis
INC += -Ivendor/micropython/stmhal/hal/f4/inc
INC += -Ivendor/micropython/stmhal/usbdev/core/inc
INC += -Ivendor/micropython/stmhal/usbdev/class/inc
INC += -Ivendor/micropython/lib/cmsis/inc
INC += -I$(SRCDIR_FW)/firmware
INC += -I$(SRCDIR_FW)/trezorhal
INC += -I$(SRCDIR_FW)/trezorhal/hal
INC += -I$(SRCDIR_MP)
INC += -I$(SRCDIR_MP)/stmhal
INC += -I$(SRCDIR_MP)/stmhal/cmsis
INC += -I$(SRCDIR_MP)/stmhal/hal/f4/inc
INC += -I$(SRCDIR_MP)/stmhal/usbdev/core/inc
INC += -I$(SRCDIR_MP)/stmhal/usbdev/class/inc
INC += -I$(SRCDIR_MP)/lib/cmsis/inc
INC += -I$(BUILD)
ifeq ($(DEBUG), 1)
@ -370,7 +371,7 @@ CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
LIBS = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
LDFLAGS = -nostdlib -T micropython/trezorhal/memory.ld -Map=$@.map --cref
LDFLAGS = -nostdlib -T $(SRCDIR_FW)/trezorhal/memory.ld -Map=$@.map --cref
# remove uncalled code from the final image
CFLAGS += -fdata-sections -ffunction-sections

View File

@ -1,16 +1,17 @@
# source directories
SRCDIR_MP = vendor/micropython
SRCDIR_FW = micropython
# target directory
BUILD ?= micropython/loader/build
TARGET ?= loader
# include py core make definitions
include vendor/micropython/py/mkenv.mk
include $(SRCDIR_MP)/py/mkenv.mk
# sources
# =====================================
SRCDIR_MP = vendor/micropython
SRCDIR_FW = micropython
BUILD_MP = $(BUILD)/$(SRCDIR_MP)
BUILD_FW = $(BUILD)/$(SRCDIR_FW)
BUILD_HDR = $(BUILD)/genhdr
@ -97,18 +98,18 @@ SRC_MOD = $(patsubst $(BUILD_FW)%.o, $(SRCDIR_FW)%.c, $(OBJ_MOD))
CROSS_COMPILE = arm-none-eabi-
INC += -I.
INC += -Imicropython/extmod/modtrezorui
INC += -Imicropython/firmware
INC += -Imicropython/trezorhal
INC += -Imicropython/trezorhal/hal
INC += -Ivendor/trezor-crypto
INC += -Ivendor/micropython
INC += -Ivendor/micropython/stmhal
INC += -Ivendor/micropython/stmhal/cmsis
INC += -Ivendor/micropython/stmhal/hal/f4/inc
INC += -Ivendor/micropython/stmhal/usbdev/core/inc
INC += -Ivendor/micropython/stmhal/usbdev/class/inc
INC += -Ivendor/micropython/lib/cmsis/inc
INC += -I$(SRCDIR_FW)/extmod/modtrezorcrypto/trezor-crypto
INC += -I$(SRCDIR_FW)/extmod/modtrezorui
INC += -I$(SRCDIR_FW)/firmware
INC += -I$(SRCDIR_FW)/trezorhal
INC += -I$(SRCDIR_FW)/trezorhal/hal
INC += -I$(SRCDIR_MP)
INC += -I$(SRCDIR_MP)/stmhal
INC += -I$(SRCDIR_MP)/stmhal/cmsis
INC += -I$(SRCDIR_MP)/stmhal/hal/f4/inc
INC += -I$(SRCDIR_MP)/stmhal/usbdev/core/inc
INC += -I$(SRCDIR_MP)/stmhal/usbdev/class/inc
INC += -I$(SRCDIR_MP)/lib/cmsis/inc
INC += -I$(BUILD)
ifeq ($(DEBUG), 1)
@ -126,7 +127,7 @@ CFLAGS += -DSTM32_HAL_H='<stm32f4xx_hal.h>'
LIBS = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
LDFLAGS = -nostdlib -T micropython/trezorhal/memory.ld -Map=$@.map --cref
LDFLAGS = -nostdlib -T $(SRCDIR_FW)/trezorhal/memory.ld -Map=$@.map --cref
# remove uncalled code from the final image
CFLAGS += -fdata-sections -ffunction-sections