Skip to content

Commit 88ae8d6

Browse files
committed
ports/quectel: Update to minimal port.
1 parent bdef720 commit 88ae8d6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+42
-16460
lines changed

ports/quectel/Makefile

Lines changed: 16 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -5,64 +5,16 @@ include ../../py/mkenv.mk
55
include mpconfigport.mk
66
include quectel.mk
77

8-
include ../../py/verbose.mk
8+
CROSS = 1
99

10-
# Select the board to build for:
11-
ifdef BOARD_DIR
12-
# Custom board path - remove trailing slash and get the final component of
13-
# the path as the board name.
14-
BOARD ?= $(notdir $(BOARD_DIR:/=))
10+
ifeq ($(CROSS), 1)
11+
CFLAGS = $(INC) $(QUEC_MOD_CFLAGS) $(PLAT_CFLAGS) $(PLAT_DFLAGS) $(COPT)
1512
else
16-
# If not given on the command line, then default to RPI_PICO.
17-
BOARD ?= EC600UCN_LB
18-
BOARD_DIR ?= boards/$(BOARD)
13+
LD = gcc
14+
CFLAGS = $(INC) -Wall -Werror -Wdouble-promotion -Wfloat-conversion -std=c99 $(COPT)
15+
LDFLAGS = -Wl,-Map=$@.map,--cref -Wl,--gc-sections
1916
endif
2017

21-
ifeq ($(wildcard $(BOARD_DIR)/.),)
22-
ifeq ($(findstring boards/PICO,$(BOARD_DIR)),boards/PICO)
23-
$(warning The PICO* boards have been renamed to RPI_PICO*)
24-
endif
25-
$(error Invalid BOARD specified: $(BOARD_DIR))
26-
endif
27-
28-
# If the build directory is not given, make it reflect the board name (and
29-
# optionally the board variant).
30-
ifneq ($(BOARD_VARIANT),)
31-
BUILD ?= build-$(BOARD)-$(BOARD_VARIANT)
32-
else
33-
BUILD ?= build-$(BOARD)
34-
endif
35-
36-
ifeq ($(BUILD_VERBOSE),1)
37-
MAKE_ARGS += VERBOSE=1 # Picked up in Makefile generated by CMake
38-
endif
39-
40-
MAKE_ARGS += -DMICROPY_BOARD=$(BOARD) -DMICROPY_BOARD_DIR="$(abspath $(BOARD_DIR))"
41-
42-
ifdef USER_C_MODULES
43-
MAKE_ARGS += -DUSER_C_MODULES=${USER_C_MODULES}
44-
endif
45-
46-
ifneq ($(FROZEN_MANIFEST),)
47-
MAKE_ARGS += -DMICROPY_FROZEN_MANIFEST=${FROZEN_MANIFEST}
48-
endif
49-
50-
ifeq ($(DEBUG),1)
51-
MAKE_ARGS += -DCMAKE_BUILD_TYPE=Debug
52-
endif
53-
54-
ifdef BOARD_VARIANT
55-
MAKE_ARGS += -DMICROPY_BOARD_VARIANT=$(BOARD_VARIANT)
56-
endif
57-
58-
ifdef MICROPY_PREVIEW_VERSION_2
59-
MAKE_ARGS += -DMICROPY_PREVIEW_VERSION_2=1
60-
endif
61-
62-
FROZEN_MANIFEST ?= boards/manifest.py
63-
64-
CFLAGS = $(INC) $(QUEC_MOD_CFLAGS) $(PLAT_CFLAGS) $(PLAT_DFLAGS) $(COPT) $(MAKE_ARGS)
65-
6618
CSUPEROPT = -Os # save some code space
6719

6820
# qstr definitions (must come before including py.mk)
@@ -71,12 +23,17 @@ QSTR_DEFS = qstrdefsport.h
7123
# MicroPython feature configurations
7224
MICROPY_ROM_TEXT_COMPRESSION ?= 1
7325

26+
27+
FROZEN_MANIFEST = $(QUEC_PY_MOD)
28+
29+
export MICROPY_MPYCROSS = $(TOP)/mpy-cross/build/mpy-cross.exe
7430
# include py core make definitions
7531
include $(TOP)/py/py.mk
7632
include $(TOP)/extmod/extmod.mk
7733

34+
ifeq ($(CROSS), 1)
7835
CROSS_COMPILE ?= arm-none-eabi-
79-
36+
endif
8037

8138
INC += -I.
8239
INC += -I$(TOP)
@@ -139,7 +96,11 @@ SRC_QSTR += $(SRC_MOD) $(SRC_MOD_CXX) $(SHARED_SRC_C) $(EXTMOD_SRC_C)
13996
OBJ += $(PY_CORE_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
14097
OBJ += $(addprefix $(BUILD)/, $(SRC_CXX:.cpp=.o))
14198

99+
ifeq ($(CROSS), 1)
142100
all: $(BUILD)/firmware.a
101+
else
102+
all: $(BUILD)/firmware.elf
103+
endif
143104

144105
$(BUILD)/_frozen_mpy.c: frozentest.mpy $(BUILD)/genhdr/qstrdefs.generated.h
145106
$(ECHO) "MISC freezing bytecode"

0 commit comments

Comments
 (0)