Skip to content

Commit

Permalink
🐛 Cleanup the Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
hrmhatef committed Apr 3, 2024
1 parent 455c0a8 commit 71e93e7
Showing 1 changed file with 76 additions and 75 deletions.
151 changes: 76 additions & 75 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,87 +14,88 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ****************************************************************************
ifeq ($(BOLOS_SDK),)
$(error Environment variable BOLOS_SDK is not set)
endif
# ifeq ($(BOLOS_SDK),)
# $(error Environment variable BOLOS_SDK is not set)
# endif

include $(BOLOS_SDK)/Makefile.defines
# include $(BOLOS_SDK)/Makefile.defines

APP_LOAD_PARAMS = --curve ed25519
ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX))
APP_LOAD_PARAMS += --appFlags 0x200
else
APP_LOAD_PARAMS += --appFlags 0x000
endif
APP_LOAD_PARAMS += --path "44'/134'"
APP_LOAD_PARAMS += $(COMMON_LOAD_PARAMS)
# APP_LOAD_PARAMS = --curve ed25519
# ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX))
# APP_LOAD_PARAMS += --appFlags 0x200
# else
# APP_LOAD_PARAMS += --appFlags 0x000
# endif
# APP_LOAD_PARAMS += --path "44'/134'"
# APP_LOAD_PARAMS += $(COMMON_LOAD_PARAMS)

APPNAME = "Lisk"

# Application version
APPVERSION_M = 1
APPVERSION_N = 0
APPVERSION_P = 0
APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)"

ifeq ($(TARGET_NAME),TARGET_NANOS)
ICONNAME=icons/nanos_app_lisk.gif
else ifeq ($(TARGET_NAME),TARGET_STAX)
ICONNAME=icons/stax_app_lisk.gif
else
ICONNAME=icons/nanox_app_lisk.gif
endif

all: default

# Compiler
ifneq ($(BOLOS_ENV),)
$(info BOLOS_ENV=$(BOLOS_ENV))
CLANGPATH := $(BOLOS_ENV)/clang-arm-fropi/bin/
GCCPATH := $(BOLOS_ENV)/gcc-arm-none-eabi-5_3-2016q1/bin/
else
$(info BOLOS_ENV is not set: falling back to CLANGPATH and GCCPATH)
endif
ifeq ($(CLANGPATH),)
$(info CLANGPATH is not set: clang will be used from PATH)
endif
ifeq ($(GCCPATH),)
$(info GCCPATH is not set: arm-none-eabi-* will be used from PATH)
endif

CC := $(CLANGPATH)clang
CFLAGS += -O3 -Os
AS := $(GCCPATH)arm-none-eabi-gcc
LD := $(GCCPATH)arm-none-eabi-gcc
LDFLAGS += -O3 -Os
LDLIBS += -lm -lgcc -lc

include $(BOLOS_SDK)/Makefile.glyphs

# Variables required by the makefile.rules of the SDK
APP_SOURCE_PATH += src
SDK_SOURCE_PATH += lib_stusb lib_stusb_impl

ifneq ($(TARGET_NAME),TARGET_STAX)
SDK_SOURCE_PATH += lib_ux
endif

ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX))
SDK_SOURCE_PATH += lib_blewbxx lib_blewbxx_impl
endif

load: all
python3 -m ledgerblue.loadApp $(APP_LOAD_PARAMS)

load-offline: all
python3 -m ledgerblue.loadApp $(APP_LOAD_PARAMS) --offline

delete:
python3 -m ledgerblue.deleteApp $(COMMON_DELETE_PARAMS)

include $(BOLOS_SDK)/Makefile.rules

dep/%.d: %.c Makefile

listvariants:
@echo VARIANTS COIN LSK

include ethereum-plugin-sdk/standard_plugin.mk

# ifeq ($(TARGET_NAME),TARGET_NANOS)
# ICONNAME=icons/nanos_app_lisk.gif
# else ifeq ($(TARGET_NAME),TARGET_STAX)
# ICONNAME=icons/stax_app_lisk.gif
# else
# ICONNAME=icons/nanox_app_lisk.gif
# endif

# all: default

# # Compiler
# ifneq ($(BOLOS_ENV),)
# $(info BOLOS_ENV=$(BOLOS_ENV))
# CLANGPATH := $(BOLOS_ENV)/clang-arm-fropi/bin/
# GCCPATH := $(BOLOS_ENV)/gcc-arm-none-eabi-5_3-2016q1/bin/
# else
# $(info BOLOS_ENV is not set: falling back to CLANGPATH and GCCPATH)
# endif
# ifeq ($(CLANGPATH),)
# $(info CLANGPATH is not set: clang will be used from PATH)
# endif
# ifeq ($(GCCPATH),)
# $(info GCCPATH is not set: arm-none-eabi-* will be used from PATH)
# endif

# CC := $(CLANGPATH)clang
# CFLAGS += -O3 -Os
# AS := $(GCCPATH)arm-none-eabi-gcc
# LD := $(GCCPATH)arm-none-eabi-gcc
# LDFLAGS += -O3 -Os
# LDLIBS += -lm -lgcc -lc

# include $(BOLOS_SDK)/Makefile.glyphs

# # Variables required by the makefile.rules of the SDK
# APP_SOURCE_PATH += src
# SDK_SOURCE_PATH += lib_stusb lib_stusb_impl

# ifneq ($(TARGET_NAME),TARGET_STAX)
# SDK_SOURCE_PATH += lib_ux
# endif

# ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX))
# SDK_SOURCE_PATH += lib_blewbxx lib_blewbxx_impl
# endif

# load: all
# python3 -m ledgerblue.loadApp $(APP_LOAD_PARAMS)

# load-offline: all
# python3 -m ledgerblue.loadApp $(APP_LOAD_PARAMS) --offline

# delete:
# python3 -m ledgerblue.deleteApp $(COMMON_DELETE_PARAMS)

# include $(BOLOS_SDK)/Makefile.rules

# dep/%.d: %.c Makefile

# listvariants:
# @echo VARIANTS COIN LSK

0 comments on commit 71e93e7

Please sign in to comment.