mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-22 14:28:07 +00:00
build: makefile cleanup - part 2
This commit is contained in:
parent
ae6be43ba0
commit
7bb2c63fc4
@ -16,14 +16,23 @@ BUILD_MP = $(BUILD)/$(SRCDIR_MP)
|
||||
BUILD_FW = $(BUILD)/$(SRCDIR_FW)
|
||||
BUILD_HDR = $(BUILD)/genhdr
|
||||
|
||||
CFLAGS_MOD += \
|
||||
-I$(SRCDIR_FW)/extmod/modtrezorcrypto/trezor-crypto \
|
||||
-I$(SRCDIR_FW)/extmod/modtrezorcrypto/trezor-crypto/ed25519-donna \
|
||||
-DAES_128 \
|
||||
-DAES_192 \
|
||||
-DUSE_KECCAK=1 \
|
||||
-DED25519_NO_PRECOMP=1 \
|
||||
-Wno-sequence-point
|
||||
|
||||
# OBJ vendor/micropython
|
||||
OBJ_MP += $(addprefix $(BUILD_MP)/,\
|
||||
OBJ_MICROPYTHON += $(addprefix $(BUILD_MP)/,\
|
||||
lib/libc/string0.o \
|
||||
stmhal/startup_stm32.o \
|
||||
)
|
||||
|
||||
# OBJ vendor/micropython
|
||||
OBJ_HAL += $(addprefix $(BUILD_MP)/,\
|
||||
OBJ_STMHAL += $(addprefix $(BUILD_MP)/,\
|
||||
stmhal/hal/f4/src/stm32f4xx_hal_adc_ex.o \
|
||||
stmhal/hal/f4/src/stm32f4xx_hal_adc.o \
|
||||
stmhal/hal/f4/src/stm32f4xx_hal_can.o \
|
||||
@ -57,6 +66,9 @@ OBJ_HAL += $(addprefix $(BUILD_MP)/,\
|
||||
# OBJ micropython/
|
||||
OBJ_BOARDLOADER += $(addprefix $(BUILD_FW)/, \
|
||||
boardloader/main.o \
|
||||
extmod/modtrezorcrypto/trezor-crypto/ed25519-donna/ed25519.o \
|
||||
extmod/modtrezorcrypto/trezor-crypto/blake2s.o \
|
||||
extmod/modtrezorcrypto/trezor-crypto/sha2.o \
|
||||
extmod/modtrezorui/display.o \
|
||||
extmod/modtrezorui/font_bitmap.o \
|
||||
)
|
||||
@ -72,22 +84,7 @@ OBJ_TREZORHAL += $(addprefix $(BUILD_FW)/, \
|
||||
trezorhal/hal/stm32f4xx_ll_fsmc.o \
|
||||
)
|
||||
|
||||
# OBJ micropython/extmod/modtrezorcrypto
|
||||
CFLAGS_MOD += \
|
||||
-I$(SRCDIR_FW)/extmod/modtrezorcrypto/trezor-crypto \
|
||||
-I$(SRCDIR_FW)/extmod/modtrezorcrypto/trezor-crypto/ed25519-donna \
|
||||
-DAES_128 \
|
||||
-DAES_192 \
|
||||
-DUSE_KECCAK=1 \
|
||||
-DED25519_NO_PRECOMP=1 \
|
||||
-Wno-sequence-point
|
||||
|
||||
OBJ_MOD += \
|
||||
$(BUILD_FW)/extmod/modtrezorcrypto/trezor-crypto/ed25519-donna/ed25519.o \
|
||||
$(BUILD_FW)/extmod/modtrezorcrypto/trezor-crypto/blake2s.o \
|
||||
$(BUILD_FW)/extmod/modtrezorcrypto/trezor-crypto/sha2.o \
|
||||
|
||||
OBJ = $(OBJ_MOD) $(OBJ_MP) $(OBJ_HAL) $(OBJ_TREZORHAL)
|
||||
OBJ = $(OBJ_MICROPYTHON) $(OBJ_STMHAL) $(OBJ_TREZORHAL)
|
||||
OBJ += $(OBJ_BOARDLOADER)
|
||||
|
||||
# comp flags
|
||||
@ -116,7 +113,6 @@ endif
|
||||
CFLAGS += $(INC) $(CFLAGS_MOD) $(CFLAGS_EXTRA)
|
||||
CFLAGS += -std=gnu99 -nostdlib -Wall -Werror -Wdouble-promotion -Wpointer-arith
|
||||
CFLAGS += -mthumb -mtune=cortex-m4 -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant
|
||||
|
||||
CFLAGS += -DSTM32F405xx -DMCU_SERIES_F4
|
||||
CFLAGS += -DSTM32_HAL_H='<stm32f4xx_hal.h>'
|
||||
CFLAGS += -DTREZOR_STM32
|
||||
|
@ -16,14 +16,23 @@ BUILD_MP = $(BUILD)/$(SRCDIR_MP)
|
||||
BUILD_FW = $(BUILD)/$(SRCDIR_FW)
|
||||
BUILD_HDR = $(BUILD)/genhdr
|
||||
|
||||
CFLAGS_MOD += \
|
||||
-I$(SRCDIR_FW)/extmod/modtrezorcrypto/trezor-crypto \
|
||||
-I$(SRCDIR_FW)/extmod/modtrezorcrypto/trezor-crypto/ed25519-donna \
|
||||
-DAES_128 \
|
||||
-DAES_192 \
|
||||
-DUSE_KECCAK=1 \
|
||||
-DED25519_NO_PRECOMP=1 \
|
||||
-Wno-sequence-point
|
||||
|
||||
# OBJ vendor/micropython
|
||||
OBJ_MP += $(addprefix $(BUILD_MP)/,\
|
||||
stmhal/startup_stm32.o \
|
||||
OBJ_MICROPYTHON += $(addprefix $(BUILD_MP)/,\
|
||||
lib/libc/string0.o \
|
||||
stmhal/startup_stm32.o \
|
||||
)
|
||||
|
||||
# OBJ vendor/micropython
|
||||
OBJ_HAL += $(addprefix $(BUILD_MP)/,\
|
||||
OBJ_STMHAL += $(addprefix $(BUILD_MP)/,\
|
||||
stmhal/hal/f4/src/stm32f4xx_hal_adc_ex.o \
|
||||
stmhal/hal/f4/src/stm32f4xx_hal_adc.o \
|
||||
stmhal/hal/f4/src/stm32f4xx_hal_can.o \
|
||||
@ -60,6 +69,9 @@ OBJ_BOOTLOADER += $(addprefix $(BUILD_FW)/, \
|
||||
bootloader/main.o \
|
||||
bootloader/messages.o \
|
||||
bootloader/protobuf.o \
|
||||
extmod/modtrezorcrypto/trezor-crypto/ed25519-donna/ed25519.o \
|
||||
extmod/modtrezorcrypto/trezor-crypto/blake2s.o \
|
||||
extmod/modtrezorcrypto/trezor-crypto/sha2.o \
|
||||
extmod/modtrezorui/display.o \
|
||||
extmod/modtrezorui/inflate.o \
|
||||
extmod/modtrezorui/font_bitmap.o \
|
||||
@ -84,22 +96,7 @@ OBJ_TREZORHAL += $(addprefix $(BUILD_FW)/, \
|
||||
trezorhal/hal/stm32f4xx_ll_fsmc.o \
|
||||
)
|
||||
|
||||
# OBJ micropython/extmod/modtrezorcrypto
|
||||
CFLAGS_MOD += \
|
||||
-I$(SRCDIR_FW)/extmod/modtrezorcrypto/trezor-crypto \
|
||||
-I$(SRCDIR_FW)/extmod/modtrezorcrypto/trezor-crypto/ed25519-donna \
|
||||
-DAES_128 \
|
||||
-DAES_192 \
|
||||
-DUSE_KECCAK=1 \
|
||||
-DED25519_NO_PRECOMP=1 \
|
||||
-Wno-sequence-point
|
||||
|
||||
OBJ_MOD += \
|
||||
$(BUILD_FW)/extmod/modtrezorcrypto/trezor-crypto/ed25519-donna/ed25519.o \
|
||||
$(BUILD_FW)/extmod/modtrezorcrypto/trezor-crypto/blake2s.o \
|
||||
$(BUILD_FW)/extmod/modtrezorcrypto/trezor-crypto/sha2.o \
|
||||
|
||||
OBJ = $(OBJ_MOD) $(OBJ_MP) $(OBJ_HAL) $(OBJ_TREZORHAL)
|
||||
OBJ = $(OBJ_MICROPYTHON) $(OBJ_STMHAL) $(OBJ_TREZORHAL)
|
||||
OBJ += $(OBJ_BOOTLOADER)
|
||||
|
||||
# comp flags
|
||||
@ -128,7 +125,6 @@ endif
|
||||
CFLAGS += $(INC) $(CFLAGS_MOD) $(CFLAGS_EXTRA)
|
||||
CFLAGS += -std=gnu99 -nostdlib -Wall -Werror -Wdouble-promotion -Wpointer-arith
|
||||
CFLAGS += -mthumb -mtune=cortex-m4 -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant
|
||||
|
||||
CFLAGS += -DSTM32F405xx -DMCU_SERIES_F4
|
||||
CFLAGS += -DSTM32_HAL_H='<stm32f4xx_hal.h>'
|
||||
CFLAGS += -DTREZOR_STM32
|
||||
|
@ -120,7 +120,7 @@ OBJ_MOD += $(addprefix $(BUILD_FW)/,\
|
||||
endif
|
||||
|
||||
# OBJ vendor/micropython
|
||||
OBJ_MP += $(addprefix $(BUILD_MP)/,\
|
||||
OBJ_MICROPYTHON += $(addprefix $(BUILD_MP)/,\
|
||||
\
|
||||
extmod/modubinascii.o \
|
||||
extmod/moductypes.o \
|
||||
@ -275,7 +275,7 @@ OBJ_MP += $(addprefix $(BUILD_MP)/,\
|
||||
)
|
||||
|
||||
# OBJ vendor/micropython
|
||||
OBJ_HAL += $(addprefix $(BUILD_MP)/,\
|
||||
OBJ_STMHAL += $(addprefix $(BUILD_MP)/,\
|
||||
stmhal/hal/f4/src/stm32f4xx_hal_adc_ex.o \
|
||||
stmhal/hal/f4/src/stm32f4xx_hal_adc.o \
|
||||
stmhal/hal/f4/src/stm32f4xx_hal_can.o \
|
||||
@ -335,10 +335,11 @@ OBJ_TREZORHAL += $(addprefix $(BUILD_FW)/, \
|
||||
FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR) -type f -name '*.py' | $(SED) -e 's=^$(FROZEN_MPY_DIR)/==')
|
||||
FROZEN_MPY_MPY_FILES := $(addprefix $(BUILD)/frozen_mpy/,$(FROZEN_MPY_PY_FILES:.py=.mpy))
|
||||
|
||||
OBJ = $(OBJ_MOD) $(OBJ_MP) $(OBJ_HAL) $(OBJ_TREZORHAL)
|
||||
OBJ = $(OBJ_MICROPYTHON) $(OBJ_STMHAL) $(OBJ_TREZORHAL)
|
||||
OBJ += $(OBJ_MOD)
|
||||
OBJ += $(OBJ_FIRMWARE)
|
||||
OBJ += $(BUILD)/frozen_mpy.o
|
||||
SRC_MP = $(patsubst $(BUILD_MP)%.o, $(SRCDIR_MP)%.c, $(OBJ_MP))
|
||||
SRC_MP = $(patsubst $(BUILD_MP)%.o, $(SRCDIR_MP)%.c, $(OBJ_MICROPYTHON))
|
||||
SRC_MOD = $(patsubst $(BUILD_FW)%.o, $(SRCDIR_FW)%.c, $(OBJ_MOD))
|
||||
|
||||
# comp flags
|
||||
@ -367,7 +368,6 @@ endif
|
||||
CFLAGS += $(INC) $(CFLAGS_MOD) $(CFLAGS_EXTRA)
|
||||
CFLAGS += -std=gnu99 -nostdlib -Wall -Werror -Wdouble-promotion -Wpointer-arith
|
||||
CFLAGS += -mthumb -mtune=cortex-m4 -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant
|
||||
|
||||
CFLAGS += -DSTM32F405xx -DMCU_SERIES_F4
|
||||
CFLAGS += -DSTM32_HAL_H='<stm32f4xx_hal.h>'
|
||||
CFLAGS += -DTREZOR_STM32
|
||||
|
Loading…
Reference in New Issue
Block a user