@@ -18,7 +18,6 @@ ifeq ($(SD), )
1818 include ../../py/mkenv.mk
1919 include boards/$(BOARD)/mpconfigboard.mk
2020 -include mpconfigport.mk
21-
2221else
2322 # If the build directory is not given, make it reflect the board name.
2423 BUILD ?= build-$(BOARD)-$(SD_LOWER)
2928 include drivers/bluetooth/bluetooth_common.mk
3029endif
3130
32-
3331# qstr definitions (must come before including py.mk)
3432QSTR_DEFS = qstrdefsport.h $(BUILD ) /pins_qstr.h
3533
@@ -51,6 +49,7 @@ INC += -I../..
5149INC += -I$(BUILD )
5250INC += -I$(BUILD ) /genhdr
5351INC += -I./../../lib/cmsis/inc
52+ INC += -I./boards/$(BOARD )
5453INC += -I./device
5554INC += -I./device/$(MCU_VARIANT )
5655INC += -I./hal
@@ -67,19 +66,12 @@ INC += -I./drivers
6766NRF_DEFINES += -D$(MCU_VARIANT_UPPER )
6867NRF_DEFINES += -DCONFIG_GPIO_AS_PINRESET
6968
70- CFLAGS_CORTEX_M = -mthumb -mabi=aapcs -fsingle-precision-constant -Wdouble-promotion
71-
72- CFLAGS_MCU_m4 = $(CFLAGS_CORTEX_M ) -mtune=cortex-m4 -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
73-
74- CFLAGS_MCU_m0 = $(CFLAGS_CORTEX_M ) --short-enums -mtune=cortex-m0 -mcpu=cortex-m0 -mfloat-abi=soft -fno-builtin
75-
76-
77- CFLAGS += $(CFLAGS_MCU_$(MCU_SERIES ) )
69+ CFLAGS += -mthumb -mabi=aapcs -fsingle-precision-constant -Wdouble-promotion
70+ CFLAGS += -mtune=cortex-m4 -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
7871CFLAGS += $(INC ) -Wall -Werror -ansi -std=gnu99 -nostdlib $(COPT ) $(NRF_DEFINES ) $(CFLAGS_MOD )
7972CFLAGS += -fno-strict-aliasing
8073CFLAGS += -fstack-usage
8174CFLAGS += -fdata-sections -ffunction-sections
82- CFLAGS += -Iboards/$(BOARD )
8375CFLAGS += -DNRF5_HAL_H='<$(MCU_VARIANT ) _hal.h>'
8476
8577LDFLAGS = $(CFLAGS )
@@ -97,17 +89,13 @@ CFLAGS += -Os -DNDEBUG
9789LDFLAGS += -Os
9890endif
9991
100- LIBS = \
101-
102- ifeq ($(MCU_VARIANT ) , nrf52)
10392LIBM_FILE_NAME = $(shell $(CC ) $(CFLAGS ) -print-file-name=libm.a)
10493LIBC_FILE_NAME = $(shell $(CC ) $(CFLAGS ) -print-file-name=libc.a)
10594LIBGCC_FILE_NAME = $(shell $(CC ) $(CFLAGS ) -print-libgcc-file-name)
10695
107- LIBS + = -L $(dir $(LIBM_FILE_NAME ) ) -lm
96+ LIBS : = -L $(dir $(LIBM_FILE_NAME ) ) -lm
10897LIBS += -L $(dir $(LIBC_FILE_NAME ) ) -lc
10998LIBS += -L $(dir $(LIBGCC_FILE_NAME ) ) -lgcc
110- endif
11199
112100SRC_HAL = $(addprefix hal/,\
113101 hal_uart.c \
@@ -122,14 +110,8 @@ SRC_HAL = $(addprefix hal/,\
122110 hal_temp.c \
123111 hal_gpio.c \
124112 hal_rng.c \
125- )
126-
127- ifeq ($(MCU_VARIANT ) , nrf52)
128- SRC_HAL += $(addprefix hal/,\
129113 hal_pwm.c \
130114 )
131- endif
132-
133115
134116SRC_C += \
135117 mphalport.c \
@@ -174,7 +156,6 @@ DRIVERS_SRC_C += $(addprefix modules/,\
174156 random/modrandom.c \
175157 )
176158
177-
178159SRC_COMMON_HAL += \
179160 board/__init__.c \
180161 digitalio/__init__.c \
@@ -196,8 +177,8 @@ SRC_COMMON_HAL += \
196177 pulseio/PulseOut.c \
197178 pulseio/PWMOut.c \
198179 storage/__init__.c \
199- supervisor/__init__.c \
200- supervisor/Runtime.c \
180+ supervisor/__init__.c \
181+ supervisor/Runtime.c \
201182
202183# These don't have corresponding files in each port but are still located in
203184# shared-bindings to make it clear what the contents of the modules are.
0 commit comments