xref: /freebsd/sys/modules/dtrace/dtrace/Makefile (revision 349cc55c9796c4596a5b9904cd3281af295f878f)
1# $FreeBSD$
2
3SYSDIR?=	${SRCTOP}/sys
4
5ARCHDIR=	${MACHINE_CPUARCH}
6
7.PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/common/dtrace
8.PATH: ${SYSDIR}/cddl/compat/opensolaris/kern
9.PATH: ${SYSDIR}/cddl/kern
10.PATH: ${SYSDIR}/cddl/dev/dtrace
11.PATH: ${SYSDIR}/cddl/dev/dtrace/${ARCHDIR}
12
13KMOD=		dtrace
14SRCS=		dtrace.c \
15		dtrace_xoroshiro128_plus.c \
16		dtrace_asm.S \
17		dtrace_subr.c
18
19.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
20.PATH: ${SYSDIR}/cddl/dev/dtrace/x86
21SRCS+=		dis_tables.c \
22		instr_size.c
23CFLAGS+=       -I${SYSDIR}/cddl/contrib/opensolaris/uts/intel \
24               -I${SYSDIR}/cddl/dev/dtrace/x86
25
26.endif
27CFLAGS+= ${OPENZFS_CFLAGS}
28
29SRCS+=		bus_if.h device_if.h vnode_if.h
30
31# Needed for dtrace_asm.S
32DPSRCS+=	assym.inc
33
34# These are needed for assym.inc
35SRCS+=		opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h
36
37#This is needed for dtrace.c
38SRCS += 	opensolaris_taskq.c
39
40.if ${MACHINE_CPUARCH} == "i386"
41SRCS+=		opt_apic.h
42.endif
43
44CFLAGS+=	-I${SYSDIR}/cddl/compat/opensolaris \
45		-I${SYSDIR}/cddl/dev/dtrace \
46		-I${SYSDIR}/cddl/dev/dtrace/${ARCHDIR} \
47		-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
48		-I${SYSDIR}/cddl/contrib/opensolaris/uts/common/dtrace \
49		-I${SYSDIR}/cddl/contrib/opensolaris/common/util \
50		-I${SYSDIR} -DDIS_MEM
51
52EXPORT_SYMS=	YES
53
54dtrace_asm.o:  assym.inc
55
56.include <bsd.kmod.mk>
57
58CFLAGS+=	-include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
59CFLAGS.dtrace_asm.S+= -D_SYS_ERRNO_H_ -D_SYS_PARAM_H_ -DLOCORE
60CWARNFLAGS+=	${OPENZFS_CWARNFLAGS}
61CWARNFLAGS+=	-Wno-parentheses
62CWARNFLAGS+=	-Wno-cast-qual
63CWARNFLAGS+=	-Wno-unused
64