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