freebsd-nq/usr.bin/kdump/Makefile
Dag-Erling Smørgrav 34bb8e6d12 1) Some of the #defines or enums for which we auto-generate naming
functions may be wider than int, so use intmax_t throughout.  Also
   add missing casts in printf() calls.

2) Clean up some of the auto-generated code to improve readability.

3) Auto-generate kdump_subr.h.  Note that this requires a semi-ugly hack
   in the Makefile to make sure it is generated before make(1) tries to
   build kdump.c, or preprocess it for 'make depend'.

MFC after:	3 weeks
2011-10-08 09:57:29 +00:00

44 lines
1.2 KiB
Makefile

# @(#)Makefile 8.1 (Berkeley) 6/6/93
# $FreeBSD$
.if (${MACHINE_ARCH} == "amd64")
SFX= 32
.endif
.PATH: ${.CURDIR}/../ktrace
PROG= kdump
SRCS= kdump.c ioctl.c kdump_subr.c subr.c
CFLAGS+= -I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../.. -I.
.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
SRCS+= linux_syscalls.c
.endif
WARNS?= 0
CLEANFILES= ioctl.c kdump_subr.c linux_syscalls.c
ioctl.c: mkioctls
sh ${.CURDIR}/mkioctls ${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}
# kdump.c includes kdump_subr.h, which is auto-generated. Add a
# manual dependency to make sure kdump_subr.h is generated before we
# try to either compile or preprocess kdump.c.
${.CURDIR}/kdump.c: kdump_subr.h
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>