diff --git a/app/Makefile b/app/Makefile index ce05296..b62925c 100755 --- a/app/Makefile +++ b/app/Makefile @@ -33,6 +33,11 @@ include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.app_testing # #{TODO} --> Need for an special mode? # DEFINES += REVIEW_SCREEN_ENABLED APP_BLIND_MODE_ENABLED +ifeq ($(APP_TESTING),1) +DEFINES += APP_TESTING +DEFINES += ZEMU_LOGGING +endif + ifndef COIN COIN=TODO endif @@ -71,19 +76,45 @@ $(error ICONNAME is not set) endif include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.platform +include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.devices + +$(info TARGET_NAME = [$(TARGET_NAME)]) +$(info ICONNAME = [$(ICONNAME)]) + +ifndef ICONNAME +$(error ICONNAME is not set) +endif + +ifeq ($(TARGET_NAME),TARGET_NANOS) +RUST_TARGET:=thumbv6m-none-eabi +endif + +ifeq ($(TARGET_NAME),TARGET_NANOX) +RUST_TARGET:=thumbv6m-none-eabi +endif + +ifeq ($(TARGET_NAME),TARGET_NANOS2) +#RUST_TARGET:=thumbv8m.main-none-eabi +RUST_TARGET:=thumbv6m-none-eabi +endif + +ifeq ($(TARGET_NAME),TARGET_STAX) +RUST_TARGET:=thumbv6m-none-eabi +endif + +$(info ************ RUST_TARGET = [$(RUST_TARGET)]) + CFLAGS += -Wvla -# #{TODO} --> Need Rust? -# LDFLAGS += -z muldefs -# LDLIBS += -Lrust/target/thumbv6m-none-eabi/release -lrslib -# APP_SOURCE_PATH += $(CURDIR)/rust/include +LDFLAGS += -z muldefs +LDLIBS += -lm -lgcc -lc +LDLIBS += -L$(MY_DIR)rust/target/$(RUST_TARGET)/release -lrslib APP_CUSTOM_LINK_DEPENDENCIES = rust -LDLIBS += -Lrust/target/thumbv6m-none-eabi/release -lrslib APP_SOURCE_PATH += $(CURDIR)/rust/include .PHONY: rust rust: - cd rust && CARGO_HOME="$(CURDIR)/rust/.cargo" cargo build --target thumbv6m-none-eabi --release + cd rust && RUSTC_BOOTSTRAP=1 CARGO_HOME="$(CURDIR)/rust/.cargo" cargo build --target $(RUST_TARGET) --release # Before linking, we need to be sure rust lib is there bin/app.elf: rust