xref: /freebsd/sys/modules/dtrace/dtrace/Makefile (revision eac7052fdebb90caf2f653e06187bdbca837b9c7)
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=	dtrace_register \
53		dtrace_unregister \
54		dtrace_probe_lookup
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-uninitialized
64CWARNFLAGS+=	-Wno-cast-qual
65CWARNFLAGS+=	-Wno-unused
66