Print this page
10079 smatch Makefile changes for usr/src/lib
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libdtrace/Makefile.com
+++ new/usr/src/lib/libdtrace/Makefile.com
1 1 #
2 2 # CDDL HEADER START
3 3 #
4 4 # The contents of this file are subject to the terms of the
5 5 # Common Development and Distribution License (the "License").
6 6 # You may not use this file except in compliance with the License.
7 7 #
8 8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 # or http://www.opensolaris.org/os/licensing.
10 10 # See the License for the specific language governing permissions
11 11 # and limitations under the License.
12 12 #
13 13 # When distributing Covered Code, include this CDDL HEADER in each
14 14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 # If applicable, add the following below this CDDL HEADER, with the
16 16 # fields enclosed by brackets "[]" replaced with your own identifying
17 17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 18 #
19 19 # CDDL HEADER END
20 20 #
21 21 #
22 22 # Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
23 23 # Copyright (c) 2011, 2016 by Delphix. All rights reserved.
24 24 #
25 +# Copyright (c) 2018, Joyent, Inc.
25 26
26 27 LIBRARY = libdtrace.a
27 28 VERS = .1
28 29
29 30 LIBSRCS = \
30 31 dt_aggregate.c \
31 32 dt_as.c \
32 33 dt_buf.c \
33 34 dt_cc.c \
34 35 dt_cg.c \
35 36 dt_consume.c \
36 37 dt_decl.c \
37 38 dt_dis.c \
38 39 dt_dof.c \
39 40 dt_error.c \
40 41 dt_errtags.c \
41 42 dt_sugar.c \
42 43 dt_handle.c \
43 44 dt_ident.c \
44 45 dt_inttab.c \
45 46 dt_link.c \
46 47 dt_list.c \
47 48 dt_open.c \
48 49 dt_options.c \
49 50 dt_program.c \
50 51 dt_map.c \
51 52 dt_module.c \
52 53 dt_names.c \
53 54 dt_parser.c \
54 55 dt_pcb.c \
55 56 dt_pid.c \
56 57 dt_pq.c \
57 58 dt_pragma.c \
58 59 dt_print.c \
59 60 dt_printf.c \
60 61 dt_proc.c \
61 62 dt_provider.c \
62 63 dt_regset.c \
63 64 dt_string.c \
64 65 dt_strtab.c \
65 66 dt_subr.c \
66 67 dt_work.c \
67 68 dt_xlator.c
68 69
69 70 LIBISASRCS = \
70 71 dt_isadep.c
71 72
72 73 OBJECTS = dt_lex.o dt_grammar.o $(MACHOBJS) $(LIBSRCS:%.c=%.o) $(LIBISASRCS:%.c=%.o)
73 74
74 75 DRTISRCS = dlink_init.c dlink_common.c
75 76 DRTIOBJS = $(DRTISRCS:%.c=pics/%.o)
76 77 DRTIOBJ = drti.o
77 78
78 79 LIBDAUDITSRCS = dlink_audit.c dlink_common.c
79 80 LIBDAUDITOBJS = $(LIBDAUDITSRCS:%.c=pics/%.o)
80 81 LIBDAUDIT = libdtrace_forceload.so
81 82
82 83 DLINKSRCS = dlink_common.c dlink_init.c dlink_audit.c
83 84
84 85 DLIBSRCS += \
85 86 errno.d \
86 87 fc.d \
87 88 io.d \
88 89 ip.d \
89 90 iscsit.d \
90 91 net.d \
91 92 nfs.d \
92 93 nfssrv.d \
93 94 procfs.d \
94 95 regs.d \
95 96 sched.d \
↓ open down ↓ |
61 lines elided |
↑ open up ↑ |
96 97 signal.d \
97 98 scsi.d \
98 99 srp.d \
99 100 sysevent.d \
100 101 tcp.d \
101 102 udp.d \
102 103 unistd.d
103 104
104 105 include ../../Makefile.lib
105 106
106 -SRCS = $(LIBSRCS:%.c=../common/%.c) $(LIBISASRCS:%.c=../$(MACH)/%.c)
107 +SRCS = $(LIBSRCS:%.c=../common/%.c) $(LIBISASRCS:%.c=../$(MACH)/%.c)
107 108 LIBS = $(DYNLIB) $(LINTLIB)
108 109
109 110 SRCDIR = ../common
110 111
111 112 CLEANFILES += dt_lex.c dt_grammar.c dt_grammar.h y.output
112 113 CLEANFILES += ../common/procfs.sed ../common/procfs.d
113 114 CLEANFILES += ../common/io.sed ../common/io.d
114 115 CLEANFILES += ../common/ip.sed ../common/ip.d
115 116 CLEANFILES += ../common/net.sed ../common/net.d
116 117 CLEANFILES += ../common/errno.d ../common/signal.d
117 118 CLEANFILES += ../common/dt_errtags.c ../common/dt_names.c
118 119 CLEANFILES += ../common/sysevent.sed ../common/sysevent.d
119 120 CLEANFILES += ../common/tcp.sed ../common/tcp.d
120 121 CLEANFILES += ../common/udp.sed ../common/udp.d
121 122 CLEANFILES += $(LIBDAUDITOBJS) $(DRTIOBJS)
122 123
123 124 CLOBBERFILES += $(LIBDAUDIT) drti.o
124 125
↓ open down ↓ |
8 lines elided |
↑ open up ↑ |
125 126 CPPFLAGS += -I../common -I.
126 127 CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS)
127 128 CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS)
128 129
129 130 CERRWARN += -_gcc=-Wno-unused-label
130 131 CERRWARN += -_gcc=-Wno-unused-variable
131 132 CERRWARN += -_gcc=-Wno-parentheses
132 133 CERRWARN += -_gcc=-Wno-uninitialized
133 134 CERRWARN += -_gcc=-Wno-switch
134 135
136 +# not linted
137 +SMATCH=off
138 +
135 139 YYCFLAGS =
136 140 LDLIBS += -lgen -lproc -lrtld_db -lnsl -lsocket -lctf -lelf -lc
137 141 DRTILDLIBS = $(LDLIBS.lib) -lc
138 142 LIBDAUDITLIBS = $(LDLIBS.lib) -lmapmalloc -lc -lproc
139 143
140 144 yydebug := YYCFLAGS += -DYYDEBUG
141 145
142 146 $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
143 147
144 148 LFLAGS = -t -v
145 149 YFLAGS = -d -v
146 150
147 151 ROOTDLIBDIR = $(ROOT)/usr/lib/dtrace
148 152 ROOTDLIBDIR64 = $(ROOT)/usr/lib/dtrace/64
149 153
150 154 ROOTDLIBS = $(DLIBSRCS:%=$(ROOTDLIBDIR)/%)
151 155 ROOTDOBJS = $(ROOTDLIBDIR)/$(DRTIOBJ) $(ROOTDLIBDIR)/$(LIBDAUDIT)
152 156 ROOTDOBJS64 = $(ROOTDLIBDIR64)/$(DRTIOBJ) $(ROOTDLIBDIR64)/$(LIBDAUDIT)
153 157
154 158 $(ROOTDLIBDIR)/%.d := FILEMODE=444
155 159 $(ROOTDLIBDIR)/%.o := FILEMODE=444
156 160 $(ROOTDLIBDIR64)/%.o := FILEMODE=444
157 161 $(ROOTDLIBDIR)/%.so := FILEMODE=555
158 162 $(ROOTDLIBDIR64)/%.so := FILEMODE=555
159 163
160 164 .KEEP_STATE:
161 165
162 166 all: $(LIBS) $(DRTIOBJ) $(LIBDAUDIT)
163 167
164 168 lint: lintdlink lintcheck
165 169
166 170 lintdlink: $(DLINKSRCS:%.c=../common/%.c)
167 171 $(LINT.c) $(DLINKSRCS:%.c=../common/%.c) $(DRTILDLIBS)
168 172
169 173 dt_lex.c: $(SRCDIR)/dt_lex.l dt_grammar.h
170 174 $(LEX) $(LFLAGS) $(SRCDIR)/dt_lex.l > $@
171 175
172 176 dt_grammar.c dt_grammar.h: $(SRCDIR)/dt_grammar.y
173 177 $(YACC) $(YFLAGS) $(SRCDIR)/dt_grammar.y
174 178 @mv y.tab.h dt_grammar.h
175 179 @mv y.tab.c dt_grammar.c
176 180
177 181 pics/dt_lex.o pics/dt_grammar.o := CFLAGS += $(YYCFLAGS)
178 182 pics/dt_lex.o pics/dt_grammar.o := CFLAGS64 += $(YYCFLAGS)
179 183
180 184 pics/dt_lex.o pics/dt_grammar.o := CERRWARN += -erroff=E_STATEMENT_NOT_REACHED
181 185 pics/dt_lex.o pics/dt_grammar.o := CCVERBOSE =
182 186
183 187 ../common/dt_errtags.c: ../common/mkerrtags.sh ../common/dt_errtags.h
184 188 sh ../common/mkerrtags.sh < ../common/dt_errtags.h > $@
185 189
186 190 ../common/dt_names.c: ../common/mknames.sh $(SRC)/uts/common/sys/dtrace.h
187 191 sh ../common/mknames.sh < $(SRC)/uts/common/sys/dtrace.h > $@
188 192
189 193 ../common/errno.d: ../common/mkerrno.sh $(SRC)/uts/common/sys/errno.h
190 194 sh ../common/mkerrno.sh < $(SRC)/uts/common/sys/errno.h > $@
191 195
192 196 ../common/signal.d: ../common/mksignal.sh $(SRC)/uts/common/sys/iso/signal_iso.h
193 197 sh ../common/mksignal.sh < $(SRC)/uts/common/sys/iso/signal_iso.h > $@
194 198
195 199 ../common/%.sed: ../common/%.sed.in
196 200 $(COMPILE.cpp) -D_KERNEL $< | tr -d ' ' | tr '"' '@' | \
197 201 sed 's/\&/\\\&/g' | grep '^s/' > $@
198 202
199 203 ../common/procfs.d: ../common/procfs.sed ../common/procfs.d.in
200 204 sed -f ../common/procfs.sed < ../common/procfs.d.in > $@
201 205
202 206 ../common/io.d: ../common/io.sed ../common/io.d.in
203 207 sed -f ../common/io.sed < ../common/io.d.in > $@
204 208
205 209 ../common/ip.d: ../common/ip.sed ../common/ip.d.in
206 210 sed -f ../common/ip.sed < ../common/ip.d.in > $@
207 211
208 212 ../common/net.d: ../common/net.sed ../common/net.d.in
209 213 sed -f ../common/net.sed < ../common/net.d.in > $@
210 214
211 215 ../common/sysevent.d: ../common/sysevent.sed ../common/sysevent.d.in
212 216 sed -f ../common/sysevent.sed < ../common/sysevent.d.in > $@
213 217
214 218 ../common/tcp.d: ..//common/tcp.sed ../common/tcp.d.in
215 219 sed -f ../common/tcp.sed < ../common/tcp.d.in > $@
216 220
217 221 ../common/udp.d: ../common/udp.sed ../common/udp.d.in
218 222 sed -f ../common/udp.sed < ../common/udp.d.in > $@
219 223
220 224 pics/%.o: ../$(MACH)/%.c
221 225 $(COMPILE.c) -o $@ $<
222 226 $(POST_PROCESS_O)
223 227
224 228 pics/%.o: ../$(MACH)/%.s
225 229 $(COMPILE.s) -o $@ $<
226 230 $(POST_PROCESS_O)
227 231
228 232 $(DRTIOBJ): $(DRTIOBJS)
229 233 $(LD) -o $@ -r -Blocal -Breduce $(DRTIOBJS)
230 234 $(POST_PROCESS_O)
231 235
232 236 $(LIBDAUDIT): $(LIBDAUDITOBJS)
233 237 $(LINK.c) -o $@ $(GSHARED) -h$(LIBDAUDIT) $(ZTEXT) $(ZDEFS) $(BDIRECT) \
234 238 $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%) $(LIBDAUDITOBJS) \
235 239 $(LIBDAUDITLIBS)
236 240 $(POST_PROCESS_SO)
237 241
238 242 $(ROOTDLIBDIR):
239 243 $(INS.dir)
240 244
241 245 $(ROOTDLIBDIR64): $(ROOTDLIBDIR)
242 246 $(INS.dir)
243 247
244 248 $(ROOTDLIBDIR)/%.d: ../common/%.d
245 249 $(INS.file)
246 250
247 251 $(ROOTDLIBDIR)/%.d: ../$(MACH)/%.d
248 252 $(INS.file)
249 253
250 254 $(ROOTDLIBDIR)/%.d: %.d
251 255 $(INS.file)
252 256
253 257 $(ROOTDLIBDIR)/%.o: %.o
254 258 $(INS.file)
255 259
256 260 $(ROOTDLIBDIR64)/%.o: %.o
257 261 $(INS.file)
258 262
259 263 $(ROOTDLIBDIR)/%.so: %.so
260 264 $(INS.file)
261 265
262 266 $(ROOTDLIBDIR64)/%.so: %.so
263 267 $(INS.file)
264 268
265 269 $(ROOTDLIBS): $(ROOTDLIBDIR)
266 270
267 271 $(ROOTDOBJS): $(ROOTDLIBDIR)
268 272
269 273 $(ROOTDOBJS64): $(ROOTDLIBDIR64)
270 274
271 275 include ../../Makefile.targ
↓ open down ↓ |
127 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX