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