xref: /freebsd/cddl/lib/libdtrace/Makefile (revision 39beb93c3f8bdbf72a61fda42300b5ebed7390c8)
1# $FreeBSD$
2
3.include	"../../Makefile.inc"
4
5LIB=		dtrace
6SHLIB_MAJOR=	1
7
8WARNS=		1
9
10SRCS=		dt_aggregate.c \
11		dt_as.c \
12		dt_buf.c \
13		dt_cc.c \
14		dt_cg.c \
15		dt_consume.c \
16		dt_decl.c \
17		dt_dis.c \
18		dt_dof.c \
19		dt_error.c \
20		dt_errtags.c \
21		dt_grammar.y \
22		dt_handle.c \
23		dt_ident.c \
24		dt_inttab.c \
25		dt_lex.l \
26		dt_link.c \
27		dt_list.c \
28		dt_map.c \
29		dt_module.c \
30		dt_names.c \
31		dt_open.c \
32		dt_options.c \
33		dt_parser.c \
34		dt_pcb.c \
35		dt_pid.c \
36		dt_pragma.c \
37		dt_printf.c \
38		dt_proc.c \
39		dt_program.c \
40		dt_provider.c \
41		dt_regset.c \
42		dt_string.c \
43		dt_strtab.c \
44		dt_subr.c \
45		dt_work.c \
46		dt_xlator.c \
47		gmatch.c
48
49DSRCS=		errno.d			\
50		psinfo.d		\
51		signal.d		\
52		unistd.d
53
54.PATH:		${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common
55.PATH:		${OPENSOLARIS_USR_DISTDIR}/lib/libgen/common
56
57CFLAGS+=	-I${.OBJDIR} \
58		-I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
59		-I${.CURDIR}/../../../cddl/compat/opensolaris/include \
60		-I${OPENSOLARIS_USR_DISTDIR}/head \
61		-I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \
62		-I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \
63		-I${OPENSOLARIS_SYS_DISTDIR}/uts/common
64
65#CFLAGS+=	-DYYDEBUG
66
67.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
68CFLAGS+=	-I${OPENSOLARIS_SYS_DISTDIR}/uts/intel
69.elif ${MACHINE_ARCH} == "sparc64"
70CFLAGS+=	-I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc
71.else
72# temporary hack
73CFLAGS+=	-I${OPENSOLARIS_SYS_DISTDIR}/uts/intel
74.endif
75
76LFLAGS+=-l
77
78YFLAGS+=-d
79
80CLEANFILES=	dt_errtags.c dt_names.c
81
82dt_errtags.c:
83	sh ${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common/mkerrtags.sh < ${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common/dt_errtags.h > dt_errtags.c
84
85dt_names.c:
86	sh ${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common/mknames.sh < ${OPENSOLARIS_SYS_DISTDIR}/uts/common/sys/dtrace.h > dt_names.c
87
88beforedepend:	dt_errtags.c dt_names.c
89
90beforeinstall:
91.if exists(${DESTDIR}/usr/lib/dtrace)
92.for file in ${DSRCS}
93	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} ${.CURDIR}/${file} ${DESTDIR}/usr/lib/dtrace
94.endfor
95.endif
96
97.include <bsd.lib.mk>
98