This repository has been archived by the owner on Aug 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile.upylib.arm
71 lines (57 loc) · 2.07 KB
/
Makefile.upylib.arm
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
# Copyright (c) 2016 Ericsson AB
#
# 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.
# include of pre-make files
include $(MPTOP)/py/mkenv.mk
MPY_CROSS = $(MPTOP)/mpy-cross/mpy-cross
MPY_TOOL = $(MPTOP)/tools/mpy-tool.py
PYTHON = PYTHONPATH=$(abspath $(MPTOP)/py) python
# qstr definitions (must come before including py.mk)
QSTR_DEFS = qstrdefsport.h
# include py core make definitions
include $(MPTOP)/py/py.mk
all: lib
CROSS_COMPILE = arm-none-eabi-
INC += -I.
INC += -I..
INC += -I$(MPTOP)
INC += -I$(BUILD)
CWARN = -Wall -Werror
CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mabi=aapcs-linux -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -Wdouble-promotion
CFLAGS_CORTEX_M4 += -fno-builtin --short-enums
CFLAGS = $(INC) $(CWARN) -ansi -std=gnu99 -DUNIX -nostdlib $(COPT) $(CFLAGS_CORTEX_M4)
ifneq ($(FROZEN_MPY_DIR),)
CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
CFLAGS += -DMICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE=0 # not supported
CFLAGS += -DMPZ_DIG_SIZE=16 # force 16 bits to work on both 32 and 64 bit archs
endif
ifdef CONFIGFILE
CFLAGS += -DMP_CONFIGFILE=\"$(CONFIGFILE)\"
endif
# Debugging/Optimization
ifeq ($(DEBUG), 1)
CFLAGS += -g
COPT = -O0
else
CFLAGS += -fdata-sections -ffunction-sections
COPT += -Os -DNDEBUG
LDFLAGS += --gc-sections
endif
OBJ = $(PY_O)
OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(LIB_SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(STMHAL_SRC_C:.c=.o))
# List of sources for qstr extraction
SRC_QSTR += $(SRC_C) $(LIB_SRC_C) $(EXT_SRC_C)
include $(MPTOP)/py/mkrules.mk