1 | #
|
---|
2 | # CDDL HEADER START
|
---|
3 | #
|
---|
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.
|
---|
7 | #
|
---|
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.
|
---|
12 | #
|
---|
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]
|
---|
18 | #
|
---|
19 | # CDDL HEADER END
|
---|
20 | #
|
---|
21 | #
|
---|
22 | # Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
---|
23 | #
|
---|
24 | #
|
---|
25 |
|
---|
26 | LIBRARY = libdtrace.a
|
---|
27 | VERS = .1
|
---|
28 |
|
---|
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_handle.c \
|
---|
42 | dt_ident.c \
|
---|
43 | dt_inttab.c \
|
---|
44 | dt_link.c \
|
---|
45 | dt_list.c \
|
---|
46 | dt_open.c \
|
---|
47 | dt_options.c \
|
---|
48 | dt_program.c \
|
---|
49 | dt_map.c \
|
---|
50 | dt_module.c \
|
---|
51 | dt_names.c \
|
---|
52 | dt_parser.c \
|
---|
53 | dt_pcb.c \
|
---|
54 | dt_pid.c \
|
---|
55 | dt_pragma.c \
|
---|
56 | dt_printf.c \
|
---|
57 | dt_proc.c \
|
---|
58 | dt_provider.c \
|
---|
59 | dt_regset.c \
|
---|
60 | dt_string.c \
|
---|
61 | dt_strtab.c \
|
---|
62 | dt_subr.c \
|
---|
63 | dt_work.c \
|
---|
64 | dt_xlator.c
|
---|
65 |
|
---|
66 | LIBISASRCS = \
|
---|
67 | dt_isadep.c
|
---|
68 |
|
---|
69 | OBJECTS = dt_lex.o dt_grammar.o $(MACHOBJS) $(LIBSRCS:%.c=%.o) $(LIBISASRCS:%.c=%.o)
|
---|
70 |
|
---|
71 | DRTISRC = drti.c
|
---|
72 | DRTIOBJ = $(DRTISRC:%.c=%.o)
|
---|
73 |
|
---|
74 | DLIBSRCS += \
|
---|
75 | errno.d \
|
---|
76 | fc.d \
|
---|
77 | io.d \
|
---|
78 | ip.d \
|
---|
79 | iscsit.d \
|
---|
80 | net.d \
|
---|
81 | nfs.d \
|
---|
82 | procfs.d \
|
---|
83 | regs.d \
|
---|
84 | sched.d \
|
---|
85 | signal.d \
|
---|
86 | scsi.d \
|
---|
87 | srp.d \
|
---|
88 | sysevent.d \
|
---|
89 | tcp.d \
|
---|
90 | udp.d \
|
---|
91 | unistd.d
|
---|
92 |
|
---|
93 | include ../../Makefile.lib
|
---|
94 |
|
---|
95 | SRCS = $(LIBSRCS:%.c=../common/%.c) $(LIBISASRCS:%.c=../$(MACH)/%.c)
|
---|
96 | LIBS = $(DYNLIB) $(LINTLIB)
|
---|
97 |
|
---|
98 | SRCDIR = ../common
|
---|
99 |
|
---|
100 | CLEANFILES += dt_lex.c dt_grammar.c dt_grammar.h y.output
|
---|
101 | CLEANFILES += ../common/procfs.sed ../common/procfs.d
|
---|
102 | CLEANFILES += ../common/io.sed ../common/io.d
|
---|
103 | CLEANFILES += ../common/ip.sed ../common/ip.d
|
---|
104 | CLEANFILES += ../common/net.sed ../common/net.d
|
---|
105 | CLEANFILES += ../common/errno.d ../common/signal.d
|
---|
106 | CLEANFILES += ../common/dt_errtags.c ../common/dt_names.c
|
---|
107 | CLEANFILES += ../common/sysevent.sed ../common/sysevent.d
|
---|
108 | CLEANFILES += ../common/tcp.sed ../common/tcp.d
|
---|
109 | CLEANFILES += ../common/udp.sed ../common/udp.d
|
---|
110 |
|
---|
111 | CLOBBERFILES += drti.o
|
---|
112 |
|
---|
113 | CPPFLAGS += -I../common -I.
|
---|
114 | CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS)
|
---|
115 | CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS)
|
---|
116 | YYCFLAGS =
|
---|
117 | LDLIBS += -lgen -lproc -lrtld_db -lnsl -lsocket -lctf -lelf -lc
|
---|
118 | DRTILDLIBS = $(LDLIBS.lib) -lc
|
---|
119 |
|
---|
120 | yydebug := YYCFLAGS += -DYYDEBUG
|
---|
121 |
|
---|
122 | $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
|
---|
123 |
|
---|
124 | LFLAGS = -t -v
|
---|
125 | YFLAGS = -d -v
|
---|
126 |
|
---|
127 | ROOTDLIBDIR = $(ROOT)/usr/lib/dtrace
|
---|
128 | ROOTDLIBDIR64 = $(ROOT)/usr/lib/dtrace/64
|
---|
129 |
|
---|
130 | ROOTDLIBS = $(DLIBSRCS:%=$(ROOTDLIBDIR)/%)
|
---|
131 | ROOTDOBJS = $(ROOTDLIBDIR)/$(DRTIOBJ)
|
---|
132 | ROOTDOBJS64 = $(ROOTDLIBDIR64)/$(DRTIOBJ)
|
---|
133 |
|
---|
134 | .KEEP_STATE:
|
---|
135 |
|
---|
136 | all: $(LIBS) $(DRTIOBJ)
|
---|
137 |
|
---|
138 | lint: lintdrti lintcheck
|
---|
139 |
|
---|
140 | lintdrti: ../common/$(DRTISRC)
|
---|
141 | $(LINT.c) ../common/$(DRTISRC) $(DRTILDLIBS)
|
---|
142 |
|
---|
143 | dt_lex.c: $(SRCDIR)/dt_lex.l dt_grammar.h
|
---|
144 | $(LEX) $(LFLAGS) $(SRCDIR)/dt_lex.l > $@
|
---|
145 |
|
---|
146 | dt_grammar.c dt_grammar.h: $(SRCDIR)/dt_grammar.y
|
---|
147 | $(YACC) $(YFLAGS) $(SRCDIR)/dt_grammar.y
|
---|
148 | @mv y.tab.h dt_grammar.h
|
---|
149 | @mv y.tab.c dt_grammar.c
|
---|
150 |
|
---|
151 | pics/dt_lex.o pics/dt_grammar.o := CFLAGS += $(YYCFLAGS)
|
---|
152 | pics/dt_lex.o pics/dt_grammar.o := CFLAGS64 += $(YYCFLAGS)
|
---|
153 |
|
---|
154 | pics/dt_lex.o pics/dt_grammar.o := CERRWARN += -erroff=E_STATEMENT_NOT_REACHED
|
---|
155 | pics/dt_lex.o pics/dt_grammar.o := CCVERBOSE =
|
---|
156 |
|
---|
157 | ../common/dt_errtags.c: ../common/mkerrtags.sh ../common/dt_errtags.h
|
---|
158 | sh ../common/mkerrtags.sh < ../common/dt_errtags.h > $@
|
---|
159 |
|
---|
160 | ../common/dt_names.c: ../common/mknames.sh $(SRC)/uts/common/sys/dtrace.h
|
---|
161 | sh ../common/mknames.sh < $(SRC)/uts/common/sys/dtrace.h > $@
|
---|
162 |
|
---|
163 | ../common/errno.d: ../common/mkerrno.sh $(SRC)/uts/common/sys/errno.h
|
---|
164 | sh ../common/mkerrno.sh < $(SRC)/uts/common/sys/errno.h > $@
|
---|
165 |
|
---|
166 | ../common/signal.d: ../common/mksignal.sh $(SRC)/uts/common/sys/iso/signal_iso.h
|
---|
167 | sh ../common/mksignal.sh < $(SRC)/uts/common/sys/iso/signal_iso.h > $@
|
---|
168 |
|
---|
169 | ../common/%.sed: ../common/%.sed.in
|
---|
170 | $(COMPILE.cpp) -D_KERNEL $< | tr -d ' ' | tr '"' '@' | \
|
---|
171 | sed 's/\&/\\\&/g' | grep '^s/' > $@
|
---|
172 |
|
---|
173 | ../common/procfs.d: ../common/procfs.sed ../common/procfs.d.in
|
---|
174 | sed -f ../common/procfs.sed < ../common/procfs.d.in > $@
|
---|
175 |
|
---|
176 | ../common/io.d: ../common/io.sed ../common/io.d.in
|
---|
177 | sed -f ../common/io.sed < ../common/io.d.in > $@
|
---|
178 |
|
---|
179 | ../common/ip.d: ../common/ip.sed ../common/ip.d.in
|
---|
180 | sed -f ../common/ip.sed < ../common/ip.d.in > $@
|
---|
181 |
|
---|
182 | ../common/net.d: ../common/net.sed ../common/net.d.in
|
---|
183 | sed -f ../common/net.sed < ../common/net.d.in > $@
|
---|
184 |
|
---|
185 | ../common/sysevent.d: ../common/sysevent.sed ../common/sysevent.d.in
|
---|
186 | sed -f ../common/sysevent.sed < ../common/sysevent.d.in > $@
|
---|
187 |
|
---|
188 | ../common/tcp.d: ..//common/tcp.sed ../common/tcp.d.in
|
---|
189 | sed -f ../common/tcp.sed < ../common/tcp.d.in > $@
|
---|
190 |
|
---|
191 | ../common/udp.d: ../common/udp.sed ../common/udp.d.in
|
---|
192 | sed -f ../common/udp.sed < ../common/udp.d.in > $@
|
---|
193 |
|
---|
194 | pics/%.o: ../$(MACH)/%.c
|
---|
195 | $(COMPILE.c) -o $@ $<
|
---|
196 | $(POST_PROCESS_O)
|
---|
197 |
|
---|
198 | pics/%.o: ../$(MACH)/%.s
|
---|
199 | $(COMPILE.s) -o $@ $<
|
---|
200 | $(POST_PROCESS_O)
|
---|
201 |
|
---|
202 | %.o: ../common/%.c
|
---|
203 | $(COMPILE.c) -o $@ $<
|
---|
204 | $(POST_PROCESS_O)
|
---|
205 |
|
---|
206 | $(ROOTDLIBDIR):
|
---|
207 | $(INS.dir)
|
---|
208 |
|
---|
209 | $(ROOTDLIBDIR64): $(ROOTDLIBDIR)
|
---|
210 | $(INS.dir)
|
---|
211 |
|
---|
212 | $(ROOTDLIBDIR)/%.d: ../common/%.d
|
---|
213 | $(INS.file)
|
---|
214 |
|
---|
215 | $(ROOTDLIBDIR)/%.d: ../$(MACH)/%.d
|
---|
216 | $(INS.file)
|
---|
217 |
|
---|
218 | $(ROOTDLIBDIR)/%.d: %.d
|
---|
219 | $(INS.file)
|
---|
220 |
|
---|
221 | $(ROOTDLIBDIR)/%.o: %.o
|
---|
222 | $(INS.file)
|
---|
223 |
|
---|
224 | $(ROOTDLIBDIR64)/%.o: %.o
|
---|
225 | $(INS.file)
|
---|
226 |
|
---|
227 | $(ROOTDLIBS): $(ROOTDLIBDIR)
|
---|
228 |
|
---|
229 | $(ROOTDOBJS): $(ROOTDLIBDIR)
|
---|
230 |
|
---|
231 | $(ROOTDOBJS64): $(ROOTDLIBDIR64)
|
---|
232 |
|
---|
233 | include ../../Makefile.targ
|
---|