freebsd-nq/usr.bin/kdump/Makefile
Dag-Erling Smørgrav c04743dac1 It turns out that truss also used kdump's mkioctls script, and expected
ioctlname() to return a pointer to the name rather than print it.  This did
not show up in testing because truss had its own prototype for ioctlname(),
so it would build fine and run fine as long as the program being traced did
not issue an ioctl.

Teach mkioctls to generate different versions of ioctlname() based on its
first command-line argument.

Pointed out by:	Garrett Cooper <yanegomi@gmail.com>
2011-10-21 11:08:25 +00:00

41 lines
1.1 KiB
Makefile

# @(#)Makefile 8.1 (Berkeley) 6/6/93
# $FreeBSD$
.if (${MACHINE_ARCH} == "amd64")
SFX= 32
.endif
.PATH: ${.CURDIR}/../ktrace
PROG= kdump
SRCS= kdump_subr.c kdump.c ioctl.c subr.c
DPSRCS= kdump_subr.h
CFLAGS+= -I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../.. -I.
.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
SRCS+= linux_syscalls.c
.endif
NO_WERROR?= YES
CLEANFILES= ioctl.c kdump_subr.c kdump_subr.h linux_syscalls.c
ioctl.c: mkioctls
env MACHINE=${MACHINE} \
sh ${.CURDIR}/mkioctls print ${DESTDIR}/usr/include > ${.TARGET}
kdump_subr.h: mksubr
sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include | \
sed -n 's/^\([a-z].*)\)$$/void \1;/p' >${.TARGET}
kdump_subr.c: mksubr kdump_subr.h
sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include >${.TARGET}
linux_syscalls.c:
/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh \
${.CURDIR}/../../sys/${MACHINE_ARCH}/linux${SFX}/syscalls.master ${.CURDIR}/linux_syscalls.conf
echo "int nlinux_syscalls = sizeof(linux_syscallnames) / sizeof(linux_syscallnames[0]);" \
>> linux_syscalls.c
.include <bsd.prog.mk>