forked from LedgerHQ/nanos-secure-sdk
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.defines
52 lines (45 loc) · 2.41 KB
/
Makefile.defines
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
#*******************************************************************************
# Ledger SDK
# (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.
#*******************************************************************************
#extract TARGET_NAME/TARGET_ID from the SDK to allow for makefile choices
TARGET_ID:=$(shell cat $(BOLOS_SDK)/include/bolos_target.h | grep TARGET_ID | cut -f3 -d' ')
TARGET_NAME:=$(shell cat $(BOLOS_SDK)/include/bolos_target.h | grep TARGET_ | grep -v TARGET_ID | cut -f2 -d' ')
$(info TARGET_NAME=$(TARGET_NAME) TARGET_ID=$(TARGET_ID))
# extra load parameters for loadApp script
ifneq ($(SCP_PRIVKEY),)
PARAM_SCP=--rootPrivateKey $(SCP_PRIVKEY)
endif
COMMON_LOAD_PARAMS=--targetId $(TARGET_ID) --fileName bin/app.hex --appName $(APPNAME) `ICONHEX=\`python $(BOLOS_SDK)/icon.py $(ICONNAME) hexbitmaponly 2>/dev/null\` ; [ ! -z "$$ICONHEX" ] && echo "--icon $$ICONHEX"` $(PARAM_SCP)
COMMON_DELETE_PARAMS=--targetId $(TARGET_ID) --appName $(APPNAME) $(PARAM_SCP)
### platform definitions
DEFINES += ST31 gcc __IO=volatile
# default is not to display make commands
log = $(if $(strip $(VERBOSE)),$1,@$1)
CFLAGS += -gdwarf-2 -gstrict-dwarf
CFLAGS += -mcpu=cortex-m0 -mthumb
CFLAGS += -fno-common -mtune=cortex-m0 -mlittle-endian
CFLAGS += -std=gnu99 -Werror=int-to-pointer-cast -Wall -Wextra #-save-temps
CFLAGS += -fdata-sections -ffunction-sections -funsigned-char -fshort-enums
CFLAGS += -mno-unaligned-access
CFLAGS += -Wno-unused-parameter -Wno-duplicate-decl-specifier
CFLAGS += -fropi --target=armv6m-none-eabi
AFLAGS += -ggdb2 -O3 -Os -mcpu=cortex-m0 -fno-common -mtune=cortex-m0
LDFLAGS += -gdwarf-2 -gstrict-dwarf
LDFLAGS += -Wall
LDFLAGS += -mcpu=cortex-m0 -mthumb
LDFLAGS += -fno-common -ffunction-sections -fdata-sections -fwhole-program -nostartfiles
LDFLAGS += -mno-unaligned-access
LDFLAGS += -T$(BOLOS_SDK)/script.ld -Wl,--gc-sections -Wl,-Map,debug/app.map,--cref