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

build: add sections to makefile

This commit is contained in:
Pavol Rusnak 2017-03-25 14:46:38 +01:00
parent b6b8873e9a
commit 2a32975977
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -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
CROSS_PORT_OPTS=MICROPY_FORCE_32BIT=1
## help commands:
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
# git submodule update --init
@ -20,18 +24,24 @@ vendor: ## update git submodules
res: ## update resources
./tools/res_collect
## emulator commands:
run: ## run unix port
cd src ; ../vendor/micropython/unix/micropython
emu: ## run emulator
./emu.sh
## test commands:
test: ## run unit tests
cd tests ; ./run_tests.sh
testpy: ## run selected unit tests from python-trezor
cd tests ; ./run_tests_python_trezor.sh
## build commands:
build: build_firmware build_bootloader build_loader build_unix build_cross ## build all
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
$(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_firmware: ## clean firmware build
@ -71,6 +83,8 @@ clean_unix: ## clean unix build
clean_cross: ## clean mpy-cross build
$(MAKE) -C vendor/micropython/mpy-cross clean $(CROSS_PORT_OPTS)
## flash commands:
flash_firmware: ## flash firmware using st-flash
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
st-flash write $(LOADER_BUILD_DIR)/loader.bin 0x8000000
## openocd debug commands:
openocd: ## start openocd which connects to the device
openocd -f interface/stlink-v2.cfg -f target/stm32f4x.cfg