opnsense-deps/fastpath/cmmctl/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

50 lines
1.3 KiB
Text

# cmmctl cross-compilation Makefile for arm64
#
# Usage:
# mkdir -p /tmp/cmmctl-build && cd /tmp/cmmctl-build
# make -f /usr/deps/fastpath/cmmctl/Makefile.cross clean all
#
# 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: GPL-2.0+
SYSROOT?= /usr/obj/usr/src/arm64.aarch64/tmp
CC?= cc
TARGET?= --target=aarch64-unknown-freebsd15.1
SRCDIR= ${MAKEFILE:H}/..
CTL_DIR= ${SRCDIR}/cmmctl
CMM_DIR= ${SRCDIR}/cmm
CTL_SRCS= cmmctl.c cmmctl_qm.c cmmctl_tunnel.c cmmctl_stat.c cmmctl_ff.c \
cmmctl_socket.c cmmctl_bridge.c cmmctl_pktcap.c cmmctl_prf.c \
cmmctl_natpt.c cmmctl_icc.c cmmctl_l2tp.c cmmctl_macvlan.c \
cmmctl_tx.c cmmctl_mcast.c
CTL_OBJS= ${CTL_SRCS:.c=.o}
PROG= cmmctl
CFLAGS= -O2 -pipe -Wall -Wextra -Wno-unused-parameter
CFLAGS+= --sysroot=${SYSROOT} ${TARGET}
CFLAGS+= -I${CMM_DIR} -I${SRCDIR}/include
CFLAGS+= -DLS1043
LDFLAGS= ${TARGET} --sysroot=${SYSROOT}
LIBS= -lpcap
all: ${PROG}
.for src in ${CTL_SRCS}
${src:.c=.o}: ${CTL_DIR}/${src}
${CC} ${CFLAGS} -c -o ${.TARGET} ${CTL_DIR}/${src}
.endfor
${PROG}: ${CTL_OBJS}
${CC} ${LDFLAGS} -o ${.TARGET} ${CTL_OBJS} ${LIBS}
clean:
rm -f ${CTL_OBJS} ${PROG}
.PHONY: all clean