-
Notifications
You must be signed in to change notification settings - Fork 109
/
Makefile
executable file
·136 lines (103 loc) · 3.28 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#*******************************************************************************
# Ledger App
# (c) 2018 - 2023 Zondax AG
# (c) 2017 Ledger
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#*******************************************************************************
ifeq ($(BOLOS_SDK),)
$(error BOLOS_SDK is not set)
endif
MY_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.installer_script
include $(BOLOS_SDK)/Makefile.defines
include $(CURDIR)/Makefile.version
ifndef COIN
COIN=ATOM
endif
PRODUCTION_BUILD ?= 1
ifeq ($(COIN),ATOM)
ifeq ($(TARGET_NAME),TARGET_NANOS)
HAVE_SWAP ?= 0
else
HAVE_SWAP ?= 1
endif
endif
# Display the target name
$(info ************ TARGET_NAME = [$(TARGET_NAME)])
# Display whether this is a production build or for internal use
ifeq ($(PRODUCTION_BUILD), 1)
$(info ************ PRODUCTION_BUILD = [PRODUCTION BUILD])
else
$(info ************ PRODUCTION_BUILD = [INTERNAL USE])
endif
ifeq ($(HAVE_SWAP), 1)
$(info ************ HAVE_SWAP = [ENABLED])
DEFINES += HAVE_SWAP=$(HAVE_SWAP)
else
$(info ************ HAVE_SWAP = [DISABLED])
endif
# Add the PRODUCTION_BUILD definition to the compiler flags
DEFINES += PRODUCTION_BUILD=$(PRODUCTION_BUILD)
include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.app_testing
$(info COIN = [$(COIN)])
ifeq ($(COIN),ATOM)
# Main app configuration
APPNAME = "Cosmos"
APPPATH = "44'/118'" --path "44'/60'"
else
define error_message
COIN value not supported: [$(COIN)]
endef
$(error "$(error_message)")
endif
APP_LOAD_PARAMS = --curve secp256k1 $(COMMON_LOAD_PARAMS) --path $(APPPATH)
include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.devices
$(info TARGET_NAME = [$(TARGET_NAME)])
$(info ICONNAME = [$(ICONNAME)])
ifndef ICONNAME
$(error ICONNAME is not set)
endif
# Compile textual mode for all devices excetpt Nano S,
# and define a Min stack size for Nano S with some margin
# to get an error if app grows too much
ifneq ($(TARGET_NAME),TARGET_NANOS)
DEFINES += COMPILE_TEXTUAL
endif
ifeq ($(TARGET_NAME),TARGET_NANOS)
APP_STACK_MIN_SIZE := 1600
else
APP_STACK_MIN_SIZE := 1850
endif
include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.platform
CFLAGS += -I$(MY_DIR)/../deps/tinycbor/src
APP_SOURCE_PATH += $(MY_DIR)/../deps/tinycbor-ledger
APP_SOURCE_PATH += $(MY_DIR)/../deps/jsmn/src
.PHONY: rust
rust:
@echo "No rust code"
.PHONY: rust_clean
rust_clean:
@echo "No rust code"
clean: rust_clean
include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.side_loading
# Import generic rules from the SDK
include $(BOLOS_SDK)/Makefile.rules
#add dependency on custom makefile filename
dep/%.d: %.c Makefile
.PHONY: listvariants
listvariants:
@echo VARIANTS COIN ATOM
.PHONY: version
version:
@echo "v$(APPVERSION)" > app.version