Skip to content

Commit

Permalink
update Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
janmazak committed May 11, 2021
1 parent 2d9d9ca commit ea3983f
Showing 1 changed file with 57 additions and 59 deletions.
116 changes: 57 additions & 59 deletions Makefile
Expand Up @@ -18,37 +18,43 @@
ifeq ($(BOLOS_SDK),)
$(error Environment variable BOLOS_SDK is not set)
endif
include $(BOLOS_SDK)/Makefile.defines

SIGNKEY = `cat sign.key`
APPSIG = `cat bin/app.sig`
NANOS_ID = 1
WORDS = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
PIN = 5555
include $(BOLOS_SDK)/Makefile.defines

APPNAME = "Cardano ADA"
APPVERSION_M = 2
APPVERSION_N = 3
APPVERSION_P = 2
APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)"

APP_LOAD_PARAMS =--appFlags 0x240 --curve ed25519 --path "44'/1815'" --path "1852'/1815'"
APP_LOAD_PARAMS += $(COMMON_LOAD_PARAMS)

##############
# Compiler #
##############

ifeq ($(TARGET_NAME),TARGET_NANOX)
ICONNAME=icon_ada_nanox.gif
WERROR := -Werror=return-type
else
ICONNAME=icon_ada_nanos.gif
WERROR := -Werror=incompatible-pointer-types -Werror=return-type
endif

################
# Default rule #
################
all: default
CC := $(CLANGPATH)clang
CFLAGS += -std=gnu11 -Wall -Wextra -Wuninitialized $(WERROR)

AS := $(GCCPATH)arm-none-eabi-gcc
LD := $(GCCPATH)arm-none-eabi-gcc

LDFLAGS += -Wall
LDLIBS += -lm -lgcc -lc

##Enable to strip debug info from app
#LDFLAGS += -Wl,-s


############
# Platform #
############

DEFINES += OS_IO_SEPROXYHAL
DEFINES += HAVE_BAGL HAVE_SPRINTF HAVE_SNPRINTF_FORMAT_U
DEFINES += APPVERSION=\"$(APPVERSION)\"
Expand Down Expand Up @@ -105,40 +111,6 @@ else
DEFINES += PRINTF\(...\)=
endif

##############
# 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

ifeq ($(TARGET_NAME),TARGET_NANOX)
WERROR := -Werror=return-type
else
WERROR := -Werror=incompatible-pointer-types -Werror=return-type
endif

CC := $(CLANGPATH)clang
CFLAGS += -std=gnu11 -O3 -Os -Wall -Wextra -Wuninitialized $(WERROR)

AS := $(GCCPATH)arm-none-eabi-gcc
LD := $(GCCPATH)arm-none-eabi-gcc

LDFLAGS += -O3 -Os -Wall
LDLIBS += -lm -lgcc -lc

##Enable to strip debug info from app
#LDFLAGS += -Wl,-s

##################
# Dependencies #
Expand All @@ -155,19 +127,17 @@ ifeq ($(TARGET_NAME),TARGET_NANOX)
SDK_SOURCE_PATH += lib_ux
endif

##############
# Build #
##############

load: all
python -m ledgerblue.loadApp $(APP_LOAD_PARAMS)
################
# Default rule #
################

delete:
python -m ledgerblue.deleteApp $(COMMON_DELETE_PARAMS)
all: default

seed:
python -m ledgerblue.hostOnboard --id $(NANOS_ID) --words $(WORDS) --pin $(PIN)

##############
# Build #
##############

# import generic rules from the sdk
include $(BOLOS_SDK)/Makefile.rules
Expand All @@ -178,10 +148,38 @@ dep/%.d: %.c Makefile
listvariants:
@echo VARIANTS COIN cardano_ada


##############
# Load #
##############

# TODO do we need this?
ifeq ($(TARGET_NAME),TARGET_NANOX)
ICONNAME=icon_ada_nanox.gif
else
ICONNAME=icon_ada_nanos.gif
endif

NANOS_ID = 1
WORDS = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
PIN = 5555

APP_LOAD_PARAMS =--appFlags 0x240 --curve ed25519 --path "44'/1815'" --path "1852'/1815'"
APP_LOAD_PARAMS += $(COMMON_LOAD_PARAMS)

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

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

seed:
python -m ledgerblue.hostOnboard --id $(NANOS_ID) --words $(WORDS) --pin $(PIN)


##############
# Style #
##############

# better to run this manually to avoid irrelevant dependencies processing
format:
astyle --options=.astylerc src/*.h src/*.c
astyle --options=.astylerc "src/*.h" "src/*.c" --exclude=src/glyphs.h --exclude=src/glyphs.c

0 comments on commit ea3983f

Please sign in to comment.