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