mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
Some checks failed
JavaScript code lint and formatting with Biome / eslint (push) Has been cancelled
Check code formatting / code-formatting (push) Has been cancelled
Check spelling with codespell / codespell (push) Has been cancelled
Build docs / build (push) Has been cancelled
Check examples / embedding (push) Has been cancelled
Package mpremote / build (push) Has been cancelled
.mpy file format and tools / test (push) Has been cancelled
Build ports metadata / build (push) Has been cancelled
cc3200 port / build (push) Has been cancelled
esp32 port / build_idf (esp32_build_cmod_spiram_s2) (push) Has been cancelled
esp32 port / build_idf (esp32_build_s3_c3) (push) Has been cancelled
esp8266 port / build (push) Has been cancelled
mimxrt port / build (push) Has been cancelled
nrf port / build (push) Has been cancelled
powerpc port / build (push) Has been cancelled
qemu port / build_and_test_arm (push) Has been cancelled
qemu port / build_and_test_rv32 (push) Has been cancelled
renesas-ra port / build_renesas_ra_board (push) Has been cancelled
rp2 port / build (push) Has been cancelled
samd port / build (push) Has been cancelled
stm32 port / build_stm32 (stm32_misc_build) (push) Has been cancelled
stm32 port / build_stm32 (stm32_nucleo_build) (push) Has been cancelled
stm32 port / build_stm32 (stm32_pyb_build) (push) Has been cancelled
unix port / minimal (push) Has been cancelled
unix port / reproducible (push) Has been cancelled
unix port / standard (push) Has been cancelled
unix port / standard_v2 (push) Has been cancelled
unix port / coverage (push) Has been cancelled
unix port / coverage_32bit (push) Has been cancelled
unix port / nanbox (push) Has been cancelled
unix port / float (push) Has been cancelled
unix port / stackless_clang (push) Has been cancelled
unix port / float_clang (push) Has been cancelled
unix port / settrace (push) Has been cancelled
unix port / settrace_stackless (push) Has been cancelled
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
This prevents printing the lengthy command and makes the build output a little cleaner. Signed-off-by: Damien George <damien@micropython.org>
78 lines
2.3 KiB
Makefile
78 lines
2.3 KiB
Makefile
# Makefile for micropython on Raspberry Pi RP2
|
|
#
|
|
# This is a simple wrapper around cmake
|
|
|
|
include ../../py/verbose.mk
|
|
|
|
# Select the board to build for:
|
|
ifdef BOARD_DIR
|
|
# Custom board path - remove trailing slash and get the final component of
|
|
# the path as the board name.
|
|
BOARD ?= $(notdir $(BOARD_DIR:/=))
|
|
else
|
|
# If not given on the command line, then default to RPI_PICO.
|
|
BOARD ?= RPI_PICO
|
|
BOARD_DIR ?= boards/$(BOARD)
|
|
endif
|
|
|
|
ifeq ($(wildcard $(BOARD_DIR)/.),)
|
|
ifeq ($(findstring boards/PICO,$(BOARD_DIR)),boards/PICO)
|
|
$(warning The PICO* boards have been renamed to RPI_PICO*)
|
|
endif
|
|
$(error Invalid BOARD specified: $(BOARD_DIR))
|
|
endif
|
|
|
|
# If the build directory is not given, make it reflect the board name (and
|
|
# optionally the board variant).
|
|
ifneq ($(BOARD_VARIANT),)
|
|
BUILD ?= build-$(BOARD)-$(BOARD_VARIANT)
|
|
else
|
|
BUILD ?= build-$(BOARD)
|
|
endif
|
|
|
|
ifeq ($(BUILD_VERBOSE),1)
|
|
MAKE_ARGS += VERBOSE=1 # Picked up in Makefile generated by CMake
|
|
endif
|
|
|
|
CMAKE_ARGS += -DMICROPY_BOARD=$(BOARD) -DMICROPY_BOARD_DIR="$(abspath $(BOARD_DIR))"
|
|
|
|
ifdef USER_C_MODULES
|
|
CMAKE_ARGS += -DUSER_C_MODULES=${USER_C_MODULES}
|
|
endif
|
|
|
|
ifneq ($(FROZEN_MANIFEST),)
|
|
CMAKE_ARGS += -DMICROPY_FROZEN_MANIFEST=${FROZEN_MANIFEST}
|
|
endif
|
|
|
|
ifeq ($(DEBUG),1)
|
|
CMAKE_ARGS += -DCMAKE_BUILD_TYPE=Debug
|
|
endif
|
|
|
|
ifdef BOARD_VARIANT
|
|
CMAKE_ARGS += -DMICROPY_BOARD_VARIANT=$(BOARD_VARIANT)
|
|
endif
|
|
|
|
ifdef MICROPY_PREVIEW_VERSION_2
|
|
CMAKE_ARGS += -DMICROPY_PREVIEW_VERSION_2=1
|
|
endif
|
|
|
|
HELP_PICO_SDK_SUBMODULE ?= "\033[1;31mError: pico-sdk submodule is not initialized.\033[0m Run 'make submodules'"
|
|
HELP_BUILD_ERROR ?= "See \033[1;31mhttps://github.com/micropython/micropython/wiki/Build-Troubleshooting\033[0m"
|
|
|
|
all:
|
|
$(Q)[ -f ../../lib/pico-sdk/README.md ] || (echo -e $(HELP_PICO_SDK_SUBMODULE); false)
|
|
$(Q)[ -e $(BUILD)/Makefile ] || cmake -S . -B $(BUILD) -DPICO_BUILD_DOCS=0 ${CMAKE_ARGS}
|
|
$(Q)$(MAKE) $(MAKE_ARGS) -C $(BUILD) || (echo -e $(HELP_BUILD_ERROR); false)
|
|
|
|
clean:
|
|
$(RM) -rf $(BUILD)
|
|
|
|
# First ensure that pico-sdk is initialised, then run CMake with the
|
|
# UPDATE_SUBMODULES flag to update necessary submodules for this board.
|
|
#
|
|
# This is done in a dedicated build directory as some CMake cache values are not
|
|
# set correctly if not all submodules are loaded yet.
|
|
submodules:
|
|
$(Q)$(MAKE) -f ../../py/mkrules.mk GIT_SUBMODULES="lib/pico-sdk" submodules
|
|
$(Q)cmake -S . -B $(BUILD)/submodules -DUPDATE_SUBMODULES=1 ${CMAKE_ARGS}
|