1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 15:38:11 +00:00

build: brew dropped 32-bit support sdl2, modify macOS stuff to reflect that

This commit is contained in:
Pavol Rusnak 2017-04-19 21:39:44 +02:00
parent d131dc7405
commit f7484fefde
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
3 changed files with 33 additions and 14 deletions

View File

@ -1,15 +1,22 @@
.PHONY: vendor .PHONY: vendor
JOBS=4 JOBS = 4
MAKE=make -j $(JOBS) MAKE = make -j $(JOBS)
BOARDLOADER_BUILD_DIR=micropython/boardloader/build BOARDLOADER_BUILD_DIR = micropython/boardloader/build
BOOTLOADER_BUILD_DIR=micropython/bootloader/build BOOTLOADER_BUILD_DIR = micropython/bootloader/build
FIRMWARE_BUILD_DIR=micropython/firmware/build FIRMWARE_BUILD_DIR = micropython/firmware/build
TREZORHAL_PORT_OPTS=FROZEN_MPY_DIR=src DEBUG=1 TREZORHAL_PORT_OPTS = FROZEN_MPY_DIR=src 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 UNIX_PORT_OPTS = MICROPY_PY_BTREE=0 MICROPY_PY_TERMIOS=0 MICROPY_PY_FFI=0 MICROPY_PY_USSL=0 MICROPY_SSL_AXTLS=0 DEBUG=1
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
UNIX_PORT_OPTS += MICROPY_FORCE_32BIT=0
else
UNIX_PORT_OPTS += MICROPY_FORCE_32BIT=1
endif
## help commands: ## help commands:

View File

@ -39,8 +39,15 @@ make build_unix
### OS X ### OS X
Install SDL2 using DMG installer from [SDL download page](https://www.libsdl.org/download-2.0.php) or run the following if you use Homebrew:
```sh
brew install sdl2 sdl2_image
```
Build the emulator:
```sh ```sh
brew install --universal sdl2 sdl2_image
make build_unix make build_unix
``` ```

15
emu.sh
View File

@ -2,10 +2,15 @@
source emu.config 2>/dev/null source emu.config 2>/dev/null
EXE=vendor/micropython/unix/micropython
OPTLEVEL="${OPTLEVEL:-0}" OPTLEVEL="${OPTLEVEL:-0}"
HEAPSIZE="${HEAPSIZE:-100000}"
MAIN="${MAIN:-main.py}" MAIN="${MAIN:-main.py}"
BROWSER="${BROWSER:-chromium}" BROWSER="${BROWSER:-chromium}"
if file $EXE | grep -q 80386 ; then
HEAPSIZE="${HEAPSIZE:-100000}"
else
HEAPSIZE="${HEAPSIZE:-1000000}"
fi
ARGS="-O${OPTLEVEL} -X heapsize=${HEAPSIZE}" ARGS="-O${OPTLEVEL} -X heapsize=${HEAPSIZE}"
@ -14,12 +19,12 @@ cd `dirname $0`/src
case "$1" in case "$1" in
"-d") "-d")
shift shift
gdb --args ../vendor/micropython/unix/micropython $ARGS $* $MAIN gdb --args ../$EXE $ARGS $* $MAIN
;; ;;
"-r") "-r")
shift shift
while true; do while true; do
../vendor/micropython/unix/micropython $ARGS $* $MAIN & ../$EXE $ARGS $* $MAIN &
UPY_PID=$! UPY_PID=$!
find -name '*.py' | inotifywait -q -e close_write --fromfile - find -name '*.py' | inotifywait -q -e close_write --fromfile -
echo Restarting ... echo Restarting ...
@ -28,12 +33,12 @@ case "$1" in
;; ;;
"-p") "-p")
shift shift
../vendor/micropython/unix/micropython $ARGS $* $MAIN & ../$EXE $ARGS $* $MAIN &
perf record -F 100 -p $! -g -- sleep 600 perf record -F 100 -p $! -g -- sleep 600
perf script > perf.trace perf script > perf.trace
../vendor/flamegraph/stackcollapse-perf.pl perf.trace | ../vendor/flamegraph/flamegraph.pl > perf.svg ../vendor/flamegraph/stackcollapse-perf.pl perf.trace | ../vendor/flamegraph/flamegraph.pl > perf.svg
$BROWSER perf.svg $BROWSER perf.svg
;; ;;
*) *)
../vendor/micropython/unix/micropython $ARGS $* $MAIN ../$EXE $ARGS $* $MAIN
esac esac