opnsense-deps/fastpath/fmlib/Makefile.cross
Jeremy Karst 87893ded3e Build 26.7 for FreeBSD 15 only; port caam and cdx to its kernel
- caam: the bus activate, deactivate and release resource methods take
  no type and rid in FreeBSD 15.
- cdx: sys/cdefs.h defines __maybe_unused now; define it only if missing.
- 26.1 is end of life and no longer built: remove patches/26.1 and
  make-26.1.conf, default to 26.7 and FreeBSD 15.1 throughout, and move
  the build examples in README.md and RELEASE.md to 26.7.9. The 26.1
  tree on the mirror stays, for gateways that still have to upgrade.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 19:26:41 -05:00

47 lines
1.2 KiB
Text

# fmlib cross-compilation Makefile for FreeBSD arm64
#
# Usage:
# make -f /usr/deps/fastpath/fmlib/Makefile.cross
#
# Builds in the current directory (use /tmp/fmlib-build or similar).
# Requires OPNsense base build first:
# sudo make -C /usr/tools base DEVICE=GATEWAY SETTINGS=26.7 TOOLSDIR=/usr/tools
#
# Copyright 2026 Mono Technologies Inc.
# SPDX-License-Identifier: BSD-2-Clause
SYSROOT?= /usr/obj/usr/src/arm64.aarch64/tmp
CC?= cc
AR?= ar
TARGET?= --target=aarch64-unknown-freebsd15.1
SRCDIR= ${MAKEFILE:H}
FMLIB_INC= ${SRCDIR}/include/fmd
FMLIB_SRC= ${SRCDIR}/src
KSRCDIR?= /usr/src
# Platform: LS1043/LS1046A (FManv3, DPAA v11)
# NCSW_LINUX: selects types_linux.h (stdint/stdbool — works on FreeBSD too)
CFLAGS= -O2 -pipe -Wall -fPIC
CFLAGS+= --sysroot=${SYSROOT} ${TARGET}
CFLAGS+= -DNCSW_LINUX -DLS1043
CFLAGS+= -I${FMLIB_INC}
CFLAGS+= -I${FMLIB_INC}/Peripherals
CFLAGS+= -I${FMLIB_INC}/Peripherals/common
CFLAGS+= -I${FMLIB_INC}/integrations
CFLAGS+= -I${KSRCDIR}/sys/contrib/ncsw/inc/ioctls
LIB= libfm.a
all: ${LIB}
fm_lib.o: ${FMLIB_SRC}/fm_lib.c
${CC} ${CFLAGS} -c -o fm_lib.o ${FMLIB_SRC}/fm_lib.c
${LIB}: fm_lib.o
${AR} rcs ${LIB} fm_lib.o
clean:
rm -f fm_lib.o ${LIB}
.PHONY: all clean