Skip to content

Commit 7cd34f2

Browse files
committed
nrf: Cleanup Makefile after nrf51 removal
1 parent 97f1024 commit 7cd34f2

1 file changed

Lines changed: 6 additions & 25 deletions

File tree

ports/nrf/Makefile

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ ifeq ($(SD), )
1818
include ../../py/mkenv.mk
1919
include boards/$(BOARD)/mpconfigboard.mk
2020
-include mpconfigport.mk
21-
2221
else
2322
# If the build directory is not given, make it reflect the board name.
2423
BUILD ?= build-$(BOARD)-$(SD_LOWER)
@@ -29,7 +28,6 @@ else
2928
include drivers/bluetooth/bluetooth_common.mk
3029
endif
3130

32-
3331
# qstr definitions (must come before including py.mk)
3432
QSTR_DEFS = qstrdefsport.h $(BUILD)/pins_qstr.h
3533

@@ -51,6 +49,7 @@ INC += -I../..
5149
INC += -I$(BUILD)
5250
INC += -I$(BUILD)/genhdr
5351
INC += -I./../../lib/cmsis/inc
52+
INC += -I./boards/$(BOARD)
5453
INC += -I./device
5554
INC += -I./device/$(MCU_VARIANT)
5655
INC += -I./hal
@@ -67,19 +66,12 @@ INC += -I./drivers
6766
NRF_DEFINES += -D$(MCU_VARIANT_UPPER)
6867
NRF_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
7871
CFLAGS += $(INC) -Wall -Werror -ansi -std=gnu99 -nostdlib $(COPT) $(NRF_DEFINES) $(CFLAGS_MOD)
7972
CFLAGS += -fno-strict-aliasing
8073
CFLAGS += -fstack-usage
8174
CFLAGS += -fdata-sections -ffunction-sections
82-
CFLAGS += -Iboards/$(BOARD)
8375
CFLAGS += -DNRF5_HAL_H='<$(MCU_VARIANT)_hal.h>'
8476

8577
LDFLAGS = $(CFLAGS)
@@ -97,17 +89,13 @@ CFLAGS += -Os -DNDEBUG
9789
LDFLAGS += -Os
9890
endif
9991

100-
LIBS = \
101-
102-
ifeq ($(MCU_VARIANT), nrf52)
10392
LIBM_FILE_NAME = $(shell $(CC) $(CFLAGS) -print-file-name=libm.a)
10493
LIBC_FILE_NAME = $(shell $(CC) $(CFLAGS) -print-file-name=libc.a)
10594
LIBGCC_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
10897
LIBS += -L $(dir $(LIBC_FILE_NAME)) -lc
10998
LIBS += -L $(dir $(LIBGCC_FILE_NAME)) -lgcc
110-
endif
11199

112100
SRC_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

134116
SRC_C += \
135117
mphalport.c \
@@ -174,7 +156,6 @@ DRIVERS_SRC_C += $(addprefix modules/,\
174156
random/modrandom.c \
175157
)
176158

177-
178159
SRC_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

Comments
 (0)