2016-05-11 12:39:28 +00:00
|
|
|
.PHONY: vendor
|
|
|
|
|
2016-03-30 14:36:39 +00:00
|
|
|
STMHAL_BUILD_DIR=vendor/micropython/stmhal/build-TREZORV2
|
|
|
|
|
|
|
|
help: ## show this help
|
2016-09-13 14:45:42 +00:00
|
|
|
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {printf "\033[36mmake %-18s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
2016-03-30 14:36:39 +00:00
|
|
|
|
2016-05-11 12:39:28 +00:00
|
|
|
vendor: ## update git submodules
|
|
|
|
git submodule update --init
|
2016-04-01 18:04:59 +00:00
|
|
|
|
2016-05-17 15:17:23 +00:00
|
|
|
build: build_stmhal build_unix ## build both stmhal and 32-bit unix micropython ports
|
2016-03-30 16:30:22 +00:00
|
|
|
|
2016-05-11 12:39:28 +00:00
|
|
|
build_stmhal: vendor ## build stmhal port
|
2016-03-30 14:36:39 +00:00
|
|
|
make -C vendor/micropython/stmhal
|
2016-03-30 16:30:22 +00:00
|
|
|
|
2016-09-13 14:45:42 +00:00
|
|
|
build_stmhal_debug: vendor ## build stmhal port with debug symbols
|
|
|
|
make -C vendor/micropython/stmhal
|
|
|
|
|
2016-05-17 15:17:23 +00:00
|
|
|
build_unix: vendor ## build 32-bit unix port
|
2016-04-29 14:02:18 +00:00
|
|
|
make -C vendor/micropython/unix MICROPY_FORCE_32BIT=1
|
|
|
|
|
2016-09-13 14:45:42 +00:00
|
|
|
build_unix_debug: vendor ## build 32-bit unix port with debug symbols
|
|
|
|
make -C vendor/micropython/unix MICROPY_FORCE_32BIT=1 DEBUG=1
|
|
|
|
|
2016-05-17 15:17:23 +00:00
|
|
|
build_cross: vendor ## build 32-bit mpy-cross port
|
|
|
|
make -C vendor/micropython/mpy-cross MICROPY_FORCE_32BIT=1
|
|
|
|
|
|
|
|
build_frozen: vendor build_cross ## build 32-bit unix port with frozen modules (from vendor/micropython/unix/frozen)
|
|
|
|
make -C vendor/micropython/unix FROZEN_MPY_DIR=frozen MICROPY_FORCE_32BIT=1
|
|
|
|
|
|
|
|
build_unix64: vendor ## build 64-bit unix port
|
2016-03-30 14:36:39 +00:00
|
|
|
make -C vendor/micropython/unix
|
|
|
|
|
2016-09-13 14:45:42 +00:00
|
|
|
build_unix64_debug: vendor ## build 64-bit unix port with debug symbols
|
|
|
|
make -C vendor/micropython/unix
|
|
|
|
|
2016-05-17 15:17:23 +00:00
|
|
|
build_cross64: vendor ## build 64-bit mpy-cross port
|
|
|
|
make -C vendor/micropython/mpy-cross
|
|
|
|
|
|
|
|
build_frozen64: vendor build_cross ## build 64-bit unix port with frozen modules (from vendor/micropython/unix/frozen)
|
|
|
|
make -C vendor/micropython/unix FROZEN_MPY_DIR=frozen
|
|
|
|
|
2016-04-29 19:46:34 +00:00
|
|
|
run: ## run unix port
|
2016-04-11 09:10:43 +00:00
|
|
|
cd src ; ../vendor/micropython/unix/micropython
|
2016-04-08 09:29:15 +00:00
|
|
|
|
2016-04-29 19:46:34 +00:00
|
|
|
emu: ## run emulator
|
|
|
|
./emu.sh
|
|
|
|
|
2016-04-11 15:55:10 +00:00
|
|
|
clean: clean_stmhal clean_unix ## clean all builds
|
|
|
|
|
|
|
|
clean_stmhal: ## clean stmhal build
|
|
|
|
make -C vendor/micropython/stmhal clean
|
|
|
|
|
|
|
|
clean_unix: ## clean unix build
|
|
|
|
make -C vendor/micropython/unix clean
|
|
|
|
|
2016-04-12 16:09:23 +00:00
|
|
|
test: ## run unit tests
|
|
|
|
cd src/tests ; ./run_tests.sh
|
|
|
|
|
2016-03-30 14:36:39 +00:00
|
|
|
flash: ## flash firmware using st-flash
|
|
|
|
st-flash write $(STMHAL_BUILD_DIR)/firmware0.bin 0x8000000
|
|
|
|
sleep 0.1
|
|
|
|
st-flash write $(STMHAL_BUILD_DIR)/firmware1.bin 0x8020000
|
|
|
|
|
|
|
|
openocd: ## start openocd which connects to the device
|
2016-04-27 16:45:00 +00:00
|
|
|
openocd -f interface/stlink-v2.cfg -f target/stm32f4x.cfg
|
2016-03-30 14:36:39 +00:00
|
|
|
|
|
|
|
gdb: ## start remote gdb session which connects to the openocd
|
|
|
|
gdb $(STMHAL_BUILD_DIR)/firmware.elf -ex 'target remote localhost:3333'
|
2016-03-31 14:48:57 +00:00
|
|
|
|
2016-04-03 23:46:46 +00:00
|
|
|
load: ## load contents of src into mass storage of trezor
|
2016-03-31 14:48:57 +00:00
|
|
|
rm -rf /run/media/${USER}/PYBFLASH/*
|
2016-04-29 14:02:18 +00:00
|
|
|
cp -a src/apps /run/media/${USER}/PYBFLASH/
|
2016-04-27 20:44:37 +00:00
|
|
|
cp -a src/lib /run/media/${USER}/PYBFLASH/
|
|
|
|
cp -a src/trezor /run/media/${USER}/PYBFLASH/
|
|
|
|
cp -a src/*.py /run/media/${USER}/PYBFLASH/
|
2016-04-04 11:58:21 +00:00
|
|
|
sync
|