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

61 lines
1.6 KiB
Text

# dpa_app cross-compilation Makefile for FreeBSD arm64
#
# Usage:
# make -f /usr/deps/fastpath/dpa_app/Makefile.cross
#
# Builds in the current directory (use /tmp/dpa_app-build or similar).
# Requires:
# - libfm.a from fmlib build (Phase 2)
# - libfmc.a from FMC build (Phase 3)
# - libxml2 cross-compiled for arm64 (in sysroot)
#
# Copyright 2026 Mono Technologies Inc.
# SPDX-License-Identifier: GPL-2.0+
SYSROOT?= /usr/obj/usr/src/arm64.aarch64/tmp
CC?= cc
CXX?= c++
TARGET?= --target=aarch64-unknown-freebsd15.1
SRCDIR= ${MAKEFILE:H}/../vendor/dpa_app
DPA_APP_DIR?= ${MAKEFILE:H}
FMLIB_INC?= ${MAKEFILE:H}/../fmlib/include/fmd
FMLIB_LIB?= /tmp/fmlib-build
FMC_INC?= ${MAKEFILE:H}/../fmc/source
FMC_LIB?= /tmp/fmc-build
CDX_INC?= ${MAKEFILE:H}/../vendor/cdx
KSRCDIR?= /usr/src
CFLAGS= -O2 -pipe -Wall -Wno-unused-variable
CFLAGS+= --sysroot=${SYSROOT} ${TARGET}
CFLAGS+= -DNCSW_LINUX -DLS1043
CFLAGS+= -I${FMC_INC}
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
CFLAGS+= -I${CDX_INC}
LDFLAGS= ${TARGET} --sysroot=${SYSROOT}
LDFLAGS+= -L${FMC_LIB} -L${FMLIB_LIB} -L${SYSROOT}/usr/local/lib -L/usr/local/lib
LIBS= -lfmc -lfm -lxml2 -lz -lm -lpthread -lc++
PROG= dpa_app
OBJS= main.o dpa.o
all: ${PROG}
main.o: ${SRCDIR}/main.c
${CC} ${CFLAGS} -c -o main.o ${SRCDIR}/main.c
dpa.o: ${SRCDIR}/dpa.c
${CC} ${CFLAGS} -c -o dpa.o ${SRCDIR}/dpa.c
${PROG}: ${OBJS}
${CXX} ${LDFLAGS} -o ${PROG} ${OBJS} ${LIBS}
clean:
rm -f ${OBJS} ${PROG}
.PHONY: all clean