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