remove pyzfs
[unleashed.git] / usr / src / lib / libdtrace / Makefile.com
blob08fcec598e9be81c71ab2db15234f70193c23595
2 # CDDL HEADER START
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
19 # CDDL HEADER END
22 # Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
23 # Copyright (c) 2011, 2016 by Delphix. All rights reserved.
26 LIBRARY = libdtrace.a
27 VERS = .1
29 LIBSRCS = \
30         dt_aggregate.c \
31         dt_as.c \
32         dt_buf.c \
33         dt_cc.c \
34         dt_cg.c \
35         dt_consume.c \
36         dt_decl.c \
37         dt_dis.c \
38         dt_dof.c \
39         dt_error.c \
40         dt_errtags.c \
41         dt_sugar.c \
42         dt_handle.c \
43         dt_ident.c \
44         dt_inttab.c \
45         dt_link.c \
46         dt_list.c \
47         dt_open.c \
48         dt_options.c \
49         dt_program.c \
50         dt_map.c \
51         dt_module.c \
52         dt_names.c \
53         dt_parser.c \
54         dt_pcb.c \
55         dt_pid.c \
56         dt_pq.c \
57         dt_pragma.c \
58         dt_print.c \
59         dt_printf.c \
60         dt_proc.c \
61         dt_provider.c \
62         dt_regset.c \
63         dt_string.c \
64         dt_strtab.c \
65         dt_subr.c \
66         dt_work.c \
67         dt_xlator.c
69 LIBISASRCS = \
70         dt_isadep.c
72 OBJECTS = dt_lex.o dt_grammar.o $(MACHOBJS) $(LIBSRCS:%.c=%.o) $(LIBISASRCS:%.c=%.o)
74 DRTISRCS = dlink_init.c dlink_common.c
75 DRTIOBJS = $(DRTISRCS:%.c=pics/%.o)
76 DRTIOBJ = drti.o
78 LIBDAUDITSRCS = dlink_audit.c dlink_common.c
79 LIBDAUDITOBJS = $(LIBDAUDITSRCS:%.c=pics/%.o)
80 LIBDAUDIT = libdtrace_forceload.so
82 DLINKSRCS = dlink_common.c dlink_init.c dlink_audit.c
84 DLIBSRCS += \
85         errno.d \
86         fc.d \
87         io.d \
88         ip.d \
89         iscsit.d \
90         net.d \
91         nfs.d \
92         nfssrv.d \
93         procfs.d \
94         regs.d \
95         sched.d \
96         signal.d \
97         scsi.d \
98         srp.d \
99         sysevent.d \
100         tcp.d \
101         udp.d \
102         unistd.d
104 include ../../Makefile.lib
106 SRCS = $(LIBSRCS:%.c=../common/%.c) $(LIBISASRCS:%.c=../$(MACH)/%.c) 
107 LIBS = $(DYNLIB)
109 SRCDIR = ../common
111 CLEANFILES += dt_lex.c dt_grammar.c dt_grammar.h y.output
112 CLEANFILES += ../common/procfs.sed ../common/procfs.d
113 CLEANFILES += ../common/io.sed ../common/io.d
114 CLEANFILES += ../common/ip.sed ../common/ip.d
115 CLEANFILES += ../common/net.sed ../common/net.d
116 CLEANFILES += ../common/errno.d ../common/signal.d
117 CLEANFILES += ../common/dt_errtags.c ../common/dt_names.c
118 CLEANFILES += ../common/sysevent.sed ../common/sysevent.d
119 CLEANFILES += ../common/tcp.sed ../common/tcp.d
120 CLEANFILES += ../common/udp.sed ../common/udp.d
121 CLEANFILES += $(LIBDAUDITOBJS) $(DRTIOBJS)
123 CLOBBERFILES += $(LIBDAUDIT) drti.o
125 CPPFLAGS += -I../common -I.
126 CFLAGS += $(C_BIGPICFLAGS)
127 CFLAGS64 += $(C_BIGPICFLAGS)
129 CERRWARN += -Wno-unused-label
130 CERRWARN += -Wno-unused-variable
131 CERRWARN += -Wno-parentheses
132 CERRWARN += -Wno-uninitialized
133 CERRWARN += -Wno-switch
135 YYCFLAGS =
136 LDLIBS += -lgen -lproc -lrtld_db -lctf -lelf -lc
137 DRTILDLIBS = $(LDLIBS.lib) -lc
138 LIBDAUDITLIBS = $(LDLIBS.lib) -lmapmalloc -lc -lproc
140 yydebug := YYCFLAGS += -DYYDEBUG
142 LFLAGS += -t
143 YFLAGS = -d -v
145 ROOTDLIBDIR = $(ROOT)/usr/lib/dtrace
146 ROOTDLIBDIR64 = $(ROOT)/usr/lib/dtrace/64
148 ROOTDLIBS = $(DLIBSRCS:%=$(ROOTDLIBDIR)/%)
149 ROOTDOBJS = $(ROOTDLIBDIR)/$(DRTIOBJ) $(ROOTDLIBDIR)/$(LIBDAUDIT)
150 ROOTDOBJS64 = $(ROOTDLIBDIR64)/$(DRTIOBJ) $(ROOTDLIBDIR64)/$(LIBDAUDIT)
152 $(ROOTDLIBDIR)/%.d := FILEMODE=444
153 $(ROOTDLIBDIR)/%.o := FILEMODE=444
154 $(ROOTDLIBDIR64)/%.o := FILEMODE=444
155 $(ROOTDLIBDIR)/%.so := FILEMODE=555
156 $(ROOTDLIBDIR64)/%.so := FILEMODE=555
158 .KEEP_STATE:
160 all: $(LIBS) $(DRTIOBJ) $(LIBDAUDIT)
162 dt_lex.c: $(SRCDIR)/dt_lex.l dt_grammar.h
163         $(LEX) $(LFLAGS) $(SRCDIR)/dt_lex.l > $@
165 dt_grammar.c dt_grammar.h: $(SRCDIR)/dt_grammar.y
166         $(YACC) $(YFLAGS) $(SRCDIR)/dt_grammar.y
167         @mv y.tab.h dt_grammar.h
168         @mv y.tab.c dt_grammar.c
170 pics/dt_lex.o pics/dt_grammar.o := CFLAGS += $(YYCFLAGS)
171 pics/dt_lex.o pics/dt_grammar.o := CFLAGS64 += $(YYCFLAGS)
173 ../common/dt_errtags.c: ../common/mkerrtags.sh ../common/dt_errtags.h
174         sh ../common/mkerrtags.sh < ../common/dt_errtags.h > $@
176 ../common/dt_names.c: ../common/mknames.sh $(SRCTOP)/include/sys/dtrace.h
177         sh ../common/mknames.sh < $(SRCTOP)/include/sys/dtrace.h > $@
179 ../common/errno.d: ../common/mkerrno.sh $(SRCTOP)/include/sys/errno.h
180         sh ../common/mkerrno.sh < $(SRCTOP)/include/sys/errno.h > $@
182 ../common/signal.d: ../common/mksignal.sh $(SRCTOP)/include/sys/iso/signal_iso.h
183         sh ../common/mksignal.sh < $(SRCTOP)/include/sys/iso/signal_iso.h > $@
185 ../common/%.sed: ../common/%.sed.in
186         $(COMPILE.cpp) -D_KERNEL $< | tr -d ' ' | tr '"' '@' | \
187             sed 's/\&/\\\&/g' | grep '^s/' > $@
189 ../common/procfs.d: ../common/procfs.sed ../common/procfs.d.in
190         sed -f ../common/procfs.sed < ../common/procfs.d.in > $@
192 ../common/io.d: ../common/io.sed ../common/io.d.in
193         sed -f ../common/io.sed < ../common/io.d.in > $@
195 ../common/ip.d: ../common/ip.sed ../common/ip.d.in
196         sed -f ../common/ip.sed < ../common/ip.d.in > $@
198 ../common/net.d: ../common/net.sed ../common/net.d.in
199         sed -f ../common/net.sed < ../common/net.d.in > $@
201 ../common/sysevent.d: ../common/sysevent.sed ../common/sysevent.d.in
202         sed -f ../common/sysevent.sed < ../common/sysevent.d.in > $@
204 ../common/tcp.d: ..//common/tcp.sed ../common/tcp.d.in
205         sed -f ../common/tcp.sed < ../common/tcp.d.in > $@
207 ../common/udp.d: ../common/udp.sed ../common/udp.d.in
208         sed -f ../common/udp.sed < ../common/udp.d.in > $@
210 pics/%.o: ../$(MACH)/%.c
211         $(COMPILE.c) -o $@ $<
212         $(POST_PROCESS_O)
214 pics/%.o: ../$(MACH)/%.s
215         $(COMPILE.s) -o $@ $<
216         $(POST_PROCESS_O)
218 $(DRTIOBJ): $(DRTIOBJS)
219         $(LD) -o $@ -r -Blocal -Breduce $(DRTIOBJS)
220         $(POST_PROCESS_O)
222 $(LIBDAUDIT): $(LIBDAUDITOBJS)
223         $(LINK.c) -o $@ $(GSHARED) -h$(LIBDAUDIT) $(ZTEXT) $(ZDEFS) $(BDIRECT) \
224             $(MAPFILE.PGA:%=-Wl,-M%) $(LIBDAUDITOBJS) \
225             $(LIBDAUDITLIBS)
226         $(POST_PROCESS_SO)
228 $(ROOTDLIBDIR):
229         $(INS.dir)
231 $(ROOTDLIBDIR64): $(ROOTDLIBDIR)
232         $(INS.dir)
234 $(ROOTDLIBDIR)/%.d: ../common/%.d
235         $(INS.file)
237 $(ROOTDLIBDIR)/%.d: ../$(MACH)/%.d
238         $(INS.file)
240 $(ROOTDLIBDIR)/%.d: %.d
241         $(INS.file)
243 $(ROOTDLIBDIR)/%.o: %.o
244         $(INS.file)
246 $(ROOTDLIBDIR64)/%.o: %.o
247         $(INS.file)
249 $(ROOTDLIBDIR)/%.so: %.so
250         $(INS.file)
252 $(ROOTDLIBDIR64)/%.so: %.so
253         $(INS.file)
255 $(ROOTDLIBS): $(ROOTDLIBDIR)
257 $(ROOTDOBJS): $(ROOTDLIBDIR)
259 $(ROOTDOBJS64): $(ROOTDLIBDIR64)
261 include ../../Makefile.targ