Skip to content

Commit

Permalink
Merge pull request LedgerHQ#124 from LedgerHQ/feat/apa/compilation_sp…
Browse files Browse the repository at this point in the history
…eedup

Makefile simplification + compilation speedup
  • Loading branch information
apaillier-ledger authored Dec 8, 2023
2 parents eb9fca7 + 4207bea commit 1d7bff3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 112 deletions.
110 changes: 2 additions & 108 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ****************************************************************************
# Ledger App Boilerplate
# Ledger Ethereum Plugin Boilerplate
# (c) 2023 Ledger SAS.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,118 +15,12 @@
# limitations under the License.
# ****************************************************************************

ifeq ($(BOLOS_SDK),)
$(error Environment variable BOLOS_SDK is not set)
endif

include $(BOLOS_SDK)/Makefile.defines

########################################
# Mandatory configuration #
########################################
# EDIT THIS: Application name
# Will be displayed on screen by the Ethereum app
APPNAME = "PluginBoilerplate"

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

# Initialize plugin SDK submodule if needed
ifneq ($(shell git submodule status | grep '^[-+]'),)
$(info INFO: Need to reinitialize git submodules)
$(shell git submodule update --init)
endif

ifeq ($(ETHEREUM_PLUGIN_SDK),)
ETHEREUM_PLUGIN_SDK=ethereum-plugin-sdk
endif

# Application source files
APP_SOURCE_PATH += src $(ETHEREUM_PLUGIN_SDK)

# Application icons following guidelines:
# https://developers.ledger.com/docs/embedded-app/design-requirements/#device-icon
ICON_ID = $(shell echo -n "$(APPNAME)" | tr " " "_" | tr "[:upper:]" "[:lower:]")
ICON_NANOS = icons/nanos_app_$(ICON_ID).gif
ICON_NANOX = icons/nanox_app_$(ICON_ID).gif
ICON_NANOSP = $(ICON_NANOX)
ICON_STAX = icons/stax_app_$(ICON_ID).gif

ifeq ($(TARGET_NAME),TARGET_STAX)
DEFINES += ICONGLYPH=C_stax_$(ICON_ID)_64px
DEFINES += ICONBITMAP=C_stax_$(ICON_ID)_64px_bitmap
endif

# Application allowed derivation curves.
# Possibles curves are: secp256k1, secp256r1, ed25519 and bls12381g1
# If your app needs it, you can specify multiple curves by using:
# `CURVE_APP_LOAD_PARAMS = <curve1> <curve2>`
CURVE_APP_LOAD_PARAMS = secp256k1

# Application allowed derivation paths.
# You should request a specific path for your app.
# This serve as an isolation mechanism.
# Most application will have to request a path according to the BIP-0044
# and SLIP-0044 standards.
# If your app needs it, you can specify multiple path by using:
# `PATH_APP_LOAD_PARAMS = "44'/1'" "45'/1'"`
PATH_APP_LOAD_PARAMS = "44'/60'" # purpose=coin(44) / coin_type=Testnet(1)

# Setting to allow building variant applications
# - <VARIANT_PARAM> is the name of the parameter which should be set
# to specify the variant that should be build.
# - <VARIANT_VALUES> a list of variant that can be build using this app code.
# * It must at least contains one value.
# * Values can be the app ticker or anything else but should be unique.
VARIANT_PARAM = COIN
# EDIT THIS: Plugin ticker name
VARIANT_VALUES = pbol

# Enabling DEBUG flag will enable PRINTF and disable optimizations
#DEBUG = 1

########################################
# Application custom permissions #
########################################
# See SDK `include/appflags.h` for the purpose of each permission
#HAVE_APPLICATION_FLAG_DERIVE_MASTER = 1
#HAVE_APPLICATION_FLAG_GLOBAL_PIN = 1
#HAVE_APPLICATION_FLAG_BOLOS_SETTINGS = 1
HAVE_APPLICATION_FLAG_LIBRARY = 1

########################################
# Application communication interfaces #
########################################
#ENABLE_BLUETOOTH = 1
#ENABLE_NFC = 1

########################################
# NBGL custom features #
########################################
#ENABLE_NBGL_QRCODE = 1
#ENABLE_NBGL_KEYBOARD = 1
#ENABLE_NBGL_KEYPAD = 1

########################################
# Features disablers #
########################################
# These advanced settings allow to disable some feature that are by
# default enabled in the SDK `Makefile.standard_app`.

DISABLE_STANDARD_APP_FILES = 1

# To allow custom size declaration
#DISABLE_DEFAULT_IO_SEPROXY_BUFFER_SIZE = 1

# Will set all the following disablers
#DISABLE_STANDARD_APP_DEFINES = 1

DISABLE_STANDARD_SNPRINTF = 1
#DISABLE_STANDARD_USB = 1
DISABLE_STANDARD_WEBUSB = 1
DISABLE_STANDARD_BAGL_UX_FLOW = 1

include $(BOLOS_SDK)/Makefile.standard_app
include ethereum-plugin-sdk/standard_plugin.mk
2 changes: 1 addition & 1 deletion ethereum-plugin-sdk
4 changes: 2 additions & 2 deletions fuzzing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ add_executable(fuzz

# Ethereum SDK
${ETH_DIR}/include/eth_internals.c
${ETH_DIR}/include/utils.c
${ETH_DIR}/include/plugin_utils.c

# cxng
${BOLOS_SDK}/lib_cxng/src/cx_hash.c
Expand All @@ -106,4 +106,4 @@ add_executable(fuzz
)

target_compile_options(fuzz PUBLIC ${COMPILATION_FLAGS})
target_link_options(fuzz PUBLIC ${COMPILATION_FLAGS})
target_link_options(fuzz PUBLIC ${COMPILATION_FLAGS})
2 changes: 1 addition & 1 deletion src/handle_init_contract.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "plugin_utils.h"
#include "plugin.h"
#include "utils.h"

// Called once to init.
void handle_init_contract(ethPluginInitContract_t *msg) {
Expand Down

0 comments on commit 1d7bff3

Please sign in to comment.