# $FreeBSD$

PROG=	uathload
MAN=	uathload.8

SRCS=	uathload.c ar5523.bin

CLEANFILES=	ar5523.bin

ar5523.bin: ${.CURDIR}/../../sys/contrib/dev/uath/ar5523.bin.uu
	uudecode -p ${.CURDIR}/../../sys/contrib/dev/uath/ar5523.bin.uu > ${.TARGET}

ar5523.o: ar5523.bin
	${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ar5523.bin

.include <bsd.prog.mk>

# $FreeBSD$

PROG=	uathload
MAN=	uathload.8

SRCS=	uathload.c ar5523.bin

CLEANFILES=	ar5523.bin

.if ${MACHINE_ARCH} != "ia64" && ${MACHINE_ARCH} != "sparc64"
LDFLAGS+=	-Wl,-z,noexecstack
.endif

ar5523.bin: ${.CURDIR}/../../sys/contrib/dev/uath/ar5523.bin.uu
	uudecode -p ${.CURDIR}/../../sys/contrib/dev/uath/ar5523.bin.uu > ${.TARGET}

ar5523.o: ar5523.bin
	${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ar5523.bin

.include <bsd.prog.mk>

Fix the last binary in the base system that still has an executable stack, /usr/sbin/uathload.
Fix the last binary in the base system that still has an executable
stack, /usr/sbin/uathload.

Since this program links in a .o file containing a firmware blob, and
there is no clean way to add a .note.GNU-stack section to this .o file,
we simply use the -z noexecstack option to ld here.
