xref: /freebsd/usr.bin/kdump/Makefile (revision a812392203d7c4c3f0db9d8a0f3391374c49c71f)
1#	@(#)Makefile	8.1 (Berkeley) 6/6/93
2# $FreeBSD$
3
4.include <src.opts.mk>
5
6.if (${MACHINE_ARCH} == "amd64")
7SFX=		32
8.endif
9
10.PATH: ${.CURDIR}/../ktrace
11
12PROG=		kdump
13SRCS=		kdump_subr.c kdump.c ioctl.c subr.c
14DPSRCS=		kdump_subr.h
15CFLAGS+=	-I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../.. -I.
16
17.if ${MK_CASPER} != "no"
18LIBADD=	capsicum
19CFLAGS+=-DHAVE_LIBCAPSICUM
20.endif
21
22.if ${MK_PF} != "no"
23CFLAGS+=-DPF
24.endif
25
26.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
27SRCS+=		linux_syscalls.c
28.endif
29
30NO_WERROR?=	YES
31
32CLEANFILES=	ioctl.c kdump_subr.c kdump_subr.h linux_syscalls.c
33
34ioctl.c: mkioctls
35	env MACHINE=${MACHINE} CPP="${CPP}" \
36	    sh ${.CURDIR}/mkioctls print ${DESTDIR}/usr/include > ${.TARGET}
37
38kdump_subr.h: mksubr
39	sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include | \
40	    sed -n 's/^\([a-z].*)\)$$/void \1;/p' >${.TARGET}
41
42kdump_subr.c: mksubr kdump_subr.h
43	sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include >${.TARGET}
44
45linux_syscalls.c:
46	/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh \
47	    ${.CURDIR}/../../sys/${MACHINE_ARCH}/linux${SFX}/syscalls.master ${.CURDIR}/linux_syscalls.conf
48	echo "int nlinux_syscalls = sizeof(linux_syscallnames) / sizeof(linux_syscallnames[0]);" \
49	    >> linux_syscalls.c
50
51.include <bsd.prog.mk>
52