build: introduce mk/boards.mk board target table, T= selects board
T= now names a specific board (qemu, pc, pi4, pi5, milkv) rather than an arch alias. mk/boards.mk is the single table: sets ARCH, BOARD, and BOARD_NAME. Each Makefile applies board-specific compiler flags after its arch block — pi5 gets Cortex-A76 tuning, pi4 gets Cortex-A72, qemu uses portable x86-64 baseline instead of -march=native. Zynq-7020 is stubbed in comments for future 32-bit ARM support. ARCH= override still works for raw arch selection without a named board. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
# Board target table — T= selects board, sets ARCH + BOARD + BOARD_NAME.
|
||||
# Included early by both Makefile and Makefile.starkernel, before arch
|
||||
# normalization runs. Each Makefile applies board-specific flag overrides
|
||||
# after its own arch block.
|
||||
#
|
||||
# Adding a new board: add an ifeq block here, then add compiler-flag
|
||||
# overrides in the board-override sections of Makefile and
|
||||
# Makefile.starkernel if the board needs tuning beyond the arch default.
|
||||
|
||||
ifdef T
|
||||
|
||||
ifeq ($(T),qemu)
|
||||
ARCH ?= amd64
|
||||
BOARD := qemu
|
||||
BOARD_NAME := QEMU x86_64
|
||||
|
||||
else ifeq ($(T),pc)
|
||||
ARCH ?= amd64
|
||||
BOARD := pc
|
||||
BOARD_NAME := x86_64 PC (native)
|
||||
|
||||
else ifeq ($(T),pi4)
|
||||
ARCH ?= aarch64
|
||||
BOARD := pi4
|
||||
BOARD_NAME := Raspberry Pi 4 (Cortex-A72)
|
||||
|
||||
else ifeq ($(T),pi5)
|
||||
ARCH ?= aarch64
|
||||
BOARD := pi5
|
||||
BOARD_NAME := Raspberry Pi 5 (Cortex-A76)
|
||||
|
||||
else ifeq ($(T),milkv)
|
||||
ARCH ?= riscv64
|
||||
BOARD := milkv
|
||||
BOARD_NAME := Milk-V Pioneer (SG2042 RISC-V 64)
|
||||
|
||||
# ── Future boards (uncomment + add flag overrides in Makefile / Makefile.starkernel) ──
|
||||
# else ifeq ($(T),zynq7020)
|
||||
# ARCH ?= arm
|
||||
# BOARD := zynq7020
|
||||
# BOARD_NAME := Xilinx Zynq-7020 (Cortex-A9, 32-bit)
|
||||
# # NOTE: requires removing the 32-bit guardrail and adding armhf toolchain support
|
||||
|
||||
else
|
||||
$(error Unknown board target T='$(T)'. Supported: qemu pc pi4 pi5 milkv)
|
||||
endif
|
||||
|
||||
endif # ifdef T
|
||||
Reference in New Issue
Block a user