1# $FreeBSD$ 2 3.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/common 4.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libgen/common 5 6PACKAGE= dtrace 7LIB= dtrace 8SRCS= dt_aggregate.c \ 9 dt_as.c \ 10 dt_buf.c \ 11 dt_cc.c \ 12 dt_cg.c \ 13 dt_consume.c \ 14 dt_decl.c \ 15 dt_dis.c \ 16 dt_dof.c \ 17 dt_error.c \ 18 dt_errtags.c \ 19 dt_grammar.y \ 20 dt_handle.c \ 21 dt_ident.c \ 22 dt_isadep.c \ 23 dt_inttab.c \ 24 dt_lex.l \ 25 dt_link.c \ 26 dt_list.c \ 27 dt_map.c \ 28 dt_module.c \ 29 dt_names.c \ 30 dt_open.c \ 31 dt_options.c \ 32 dt_parser.c \ 33 dt_pcb.c \ 34 dt_pid.c \ 35 dt_pq.c \ 36 dt_pragma.c \ 37 dt_print.c \ 38 dt_printf.c \ 39 dt_proc.c \ 40 dt_program.c \ 41 dt_provider.c \ 42 dt_regset.c \ 43 dt_string.c \ 44 dt_strtab.c \ 45 dt_subr.c \ 46 dt_sugar.c \ 47 dt_work.c \ 48 dt_xlator.c \ 49 gmatch.c 50 51DSRCS= errno.d \ 52 io.d \ 53 ip.d \ 54 psinfo.d \ 55 sctp.d \ 56 siftr.d \ 57 signal.d \ 58 tcp.d \ 59 socket.d \ 60 udp.d \ 61 udplite.d \ 62 unistd.d 63 64FILES= ${DSRCS} 65FILESDIR= /usr/lib/dtrace 66FILESMODE= ${NOBINMODE} 67 68INCSGROUPS= INCS SYSINCS 69SYSINCSDIR= ${INCLUDEDIR}/sys 70INCS+= ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h 71SYSINCS+= ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h 72SYSINCS+= ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h 73 74WARNS?= 1 75 76CFLAGS+= -DIN_BASE 77CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include 78CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ 79CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd 80CFLAGS+= -I${SRCTOP}/sys 81CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h 82CFLAGS+= -DHAVE_ISSETUGID 83 84 85CFLAGS+= -I${.OBJDIR} -I${.CURDIR} \ 86 -I${SRCTOP}/sys/cddl/dev/dtrace/${MACHINE_ARCH} \ 87 -I${SRCTOP}/sys/cddl/compat/opensolaris \ 88 -I${SRCTOP}/cddl/compat/opensolaris/include \ 89 -I${OPENSOLARIS_USR_DISTDIR}/head \ 90 -I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \ 91 -I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \ 92 -I${OPENSOLARIS_SYS_DISTDIR}/uts/common 93 94#CFLAGS+= -DYYDEBUG 95 96.if ${MACHINE_CPUARCH} == "aarch64" 97CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/aarch64 98.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/aarch64 99.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/aarch64 100.elif ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" 101CFLAGS+= -I${SRCTOP}/sys/cddl/dev/dtrace/x86 102CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel -DDIS_MEM 103.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/i386 104.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/${MACHINE_ARCH} 105.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/x86 106.elif ${MACHINE_CPUARCH} == "arm" 107CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/arm 108.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/arm 109.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/arm 110.elif ${MACHINE_CPUARCH} == "powerpc" 111CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/powerpc 112.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/powerpc 113.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/powerpc 114.elif ${MACHINE_CPUARCH} == "riscv" 115CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/riscv 116.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/riscv 117.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/riscv 118.else 119# temporary hack 120CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel 121.endif 122 123.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" 124SRCS+= dis_tables.c 125DSRCS+= regs_x86.d 126.endif 127 128YFLAGS+=-d 129 130LIBADD= ctf elf proc pthread rtld_db 131 132CLEANFILES= dt_errtags.c dt_names.c 133 134.include <bsd.lib.mk> 135 136dt_errtags.c: ${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common/dt_errtags.h 137 sh ${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common/mkerrtags.sh < ${.ALLSRC} > ${.TARGET} 138 139dt_names.c: ${OPENSOLARIS_SYS_DISTDIR}/uts/common/sys/dtrace.h 140 sh ${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common/mknames.sh < ${.ALLSRC} > ${.TARGET} 141