mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-27 00:28:10 +00:00
build: add sections to makefile
This commit is contained in:
parent
b6b8873e9a
commit
2a32975977
18
Makefile
18
Makefile
@ -11,8 +11,12 @@ TREZORHAL_PORT_OPTS=FROZEN_MPY_DIR=src
|
|||||||
UNIX_PORT_OPTS=MICROPY_FORCE_32BIT=1 MICROPY_PY_BTREE=0 MICROPY_PY_TERMIOS=0 MICROPY_PY_FFI=0 MICROPY_PY_USSL=0 MICROPY_SSL_AXTLS=0 DEBUG=1
|
UNIX_PORT_OPTS=MICROPY_FORCE_32BIT=1 MICROPY_PY_BTREE=0 MICROPY_PY_TERMIOS=0 MICROPY_PY_FFI=0 MICROPY_PY_USSL=0 MICROPY_SSL_AXTLS=0 DEBUG=1
|
||||||
CROSS_PORT_OPTS=MICROPY_FORCE_32BIT=1
|
CROSS_PORT_OPTS=MICROPY_FORCE_32BIT=1
|
||||||
|
|
||||||
|
## help commands:
|
||||||
|
|
||||||
help: ## show this help
|
help: ## show this help
|
||||||
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {printf "\033[36mmake %-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {printf "\033[36m make %-20s\033[0m %s\n", $$1, $$2} /^##(.*)/ {printf "\033[33m%s\n", substr($$0, 4)}' $(MAKEFILE_LIST)
|
||||||
|
|
||||||
|
## dependencies commands:
|
||||||
|
|
||||||
vendor: ## update git submodules
|
vendor: ## update git submodules
|
||||||
# git submodule update --init
|
# git submodule update --init
|
||||||
@ -20,18 +24,24 @@ vendor: ## update git submodules
|
|||||||
res: ## update resources
|
res: ## update resources
|
||||||
./tools/res_collect
|
./tools/res_collect
|
||||||
|
|
||||||
|
## emulator commands:
|
||||||
|
|
||||||
run: ## run unix port
|
run: ## run unix port
|
||||||
cd src ; ../vendor/micropython/unix/micropython
|
cd src ; ../vendor/micropython/unix/micropython
|
||||||
|
|
||||||
emu: ## run emulator
|
emu: ## run emulator
|
||||||
./emu.sh
|
./emu.sh
|
||||||
|
|
||||||
|
## test commands:
|
||||||
|
|
||||||
test: ## run unit tests
|
test: ## run unit tests
|
||||||
cd tests ; ./run_tests.sh
|
cd tests ; ./run_tests.sh
|
||||||
|
|
||||||
testpy: ## run selected unit tests from python-trezor
|
testpy: ## run selected unit tests from python-trezor
|
||||||
cd tests ; ./run_tests_python_trezor.sh
|
cd tests ; ./run_tests_python_trezor.sh
|
||||||
|
|
||||||
|
## build commands:
|
||||||
|
|
||||||
build: build_firmware build_bootloader build_loader build_unix build_cross ## build all
|
build: build_firmware build_bootloader build_loader build_unix build_cross ## build all
|
||||||
|
|
||||||
build_firmware: vendor res build_cross ## build firmware with frozen modules
|
build_firmware: vendor res build_cross ## build firmware with frozen modules
|
||||||
@ -52,6 +62,8 @@ build_unix: vendor ## build unix port
|
|||||||
build_cross: vendor ## build mpy-cross port
|
build_cross: vendor ## build mpy-cross port
|
||||||
$(MAKE) -C vendor/micropython/mpy-cross $(CROSS_PORT_OPTS)
|
$(MAKE) -C vendor/micropython/mpy-cross $(CROSS_PORT_OPTS)
|
||||||
|
|
||||||
|
## clean commands:
|
||||||
|
|
||||||
clean: clean_firmware clean_bootloader clean_loader clean_unix clean_cross ## clean all
|
clean: clean_firmware clean_bootloader clean_loader clean_unix clean_cross ## clean all
|
||||||
|
|
||||||
clean_firmware: ## clean firmware build
|
clean_firmware: ## clean firmware build
|
||||||
@ -71,6 +83,8 @@ clean_unix: ## clean unix build
|
|||||||
clean_cross: ## clean mpy-cross build
|
clean_cross: ## clean mpy-cross build
|
||||||
$(MAKE) -C vendor/micropython/mpy-cross clean $(CROSS_PORT_OPTS)
|
$(MAKE) -C vendor/micropython/mpy-cross clean $(CROSS_PORT_OPTS)
|
||||||
|
|
||||||
|
## flash commands:
|
||||||
|
|
||||||
flash_firmware: ## flash firmware using st-flash
|
flash_firmware: ## flash firmware using st-flash
|
||||||
st-flash write $(FIRMWARE_BUILD_DIR)/firmware.bin 0x8000000
|
st-flash write $(FIRMWARE_BUILD_DIR)/firmware.bin 0x8000000
|
||||||
|
|
||||||
@ -80,6 +94,8 @@ flash_bootloader: ## flash bootloader using st-flash
|
|||||||
flash_loader: ## flash loader using st-flash
|
flash_loader: ## flash loader using st-flash
|
||||||
st-flash write $(LOADER_BUILD_DIR)/loader.bin 0x8000000
|
st-flash write $(LOADER_BUILD_DIR)/loader.bin 0x8000000
|
||||||
|
|
||||||
|
## openocd debug commands:
|
||||||
|
|
||||||
openocd: ## start openocd which connects to the device
|
openocd: ## start openocd which connects to the device
|
||||||
openocd -f interface/stlink-v2.cfg -f target/stm32f4x.cfg
|
openocd -f interface/stlink-v2.cfg -f target/stm32f4x.cfg
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user