Print this page
10080 smatch Makefile changes for usr/src/cmd
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/fm/fmd/Makefile.fmd
+++ new/usr/src/cmd/fm/fmd/Makefile.fmd
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
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
14 14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
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) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
23 23 # Copyright 2015 RackTop Systems.
24 +# Copyright (c) 2018, Joyent, Inc.
24 25 #
25 26
26 27 .KEEP_STATE:
27 28
28 29 SRCS += fmd.c \
29 30 fmd_api.c \
30 31 fmd_alloc.c \
31 32 fmd_asru.c \
32 33 fmd_buf.c \
33 34 fmd_builtin.c \
34 35 fmd_case.c \
35 36 fmd_ckpt.c \
36 37 fmd_conf.c \
37 38 fmd_ctl.c \
38 39 fmd_dispq.c \
39 40 fmd_dr.c \
40 41 fmd_error.c \
41 42 fmd_event.c \
42 43 fmd_eventq.c \
43 44 fmd_fmri.c \
44 45 fmd_idspace.c \
45 46 fmd_list.c \
46 47 fmd_log.c \
47 48 fmd_main.c \
48 49 fmd_module.c \
49 50 fmd_nv.c \
50 51 fmd_proc.c \
51 52 fmd_protocol.c \
52 53 fmd_rpc.c \
53 54 fmd_rpc_adm.c \
54 55 fmd_rpc_api.c \
55 56 fmd_rtld.c \
56 57 fmd_scheme.c \
57 58 fmd_self.c \
58 59 fmd_serd.c \
59 60 fmd_string.c \
60 61 fmd_subr.c \
61 62 fmd_svc_adm.c \
62 63 fmd_svc_api.c \
63 64 fmd_sysevent.c \
64 65 fmd_thread.c \
65 66 fmd_time.c \
66 67 fmd_timerq.c \
67 68 fmd_topo.c \
68 69 fmd_trace.c \
69 70 fmd_ustat.c \
70 71 fmd_xdr_adm.c \
71 72 fmd_xdr_api.c \
72 73 fmd_xprt.c
73 74
74 75 PROG = fmd
75 76 MANIFEST = ../common/$(PROG).xml
76 77
77 78 MAPFILE-DMOD = $(SRC)/cmd/mdb/common/modules/conf/mapfile-extern
78 79
79 80
80 81 LOGADMFILE = $(PROG).logadm.conf
81 82 LOGADMDIR = $(ROOT)/etc/logadm.d
82 83 LOGADMENT = $(LOGADMDIR)/$(LOGADMFILE)
83 84 $(LOGADMENT) := FILEMODE = 444
84 85
85 86 ROOTPDIR = $(ROOT)/usr/lib/fm/$(PROG)
86 87 ROOTVDIR = $(ROOT)/var/fm/$(PROG)
87 88 ROOTVSUB = $(ROOTVDIR)/ckpt $(ROOTVDIR)/rsrc $(ROOTVDIR)/xprt
88 89 ROOTPROG = $(ROOTPDIR)/$(PROG)
89 90
90 91 ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
91 92 ROOTMANIFEST = $(ROOTMANIFESTDIR)/$(PROG).xml
92 93
93 94 OBJS = $(SRCS:%.c=%.o)
94 95 LINTFILES = $(SRCS:%.c=%.ln)
95 96
96 97 CLEANFILES += ../common/fmd_rpc_api.h ../common/fmd_rpc_adm.h
97 98 CLEANFILES += fmd_svc_adm.c fmd_svc_api.c fmd_xdr_adm.c fmd_xdr_api.c
98 99 CLEANFILES += ../common/fmd_error.c
99 100
100 101 DMOD = fmd.so
101 102 ROOTDMOD = $(ROOT)/usr/lib/mdb/proc/$(DMOD)
102 103 DMOD_SRCS = fmd_mdb.c
103 104 DMOD_OBJS = $(DMOD_SRCS:%.c=%.o)
104 105 DMOD_LINT = $(DMOD_SRCS:%.c=%.ln)
105 106
106 107 HDRS = fmd_api.h fmd_fmri.h
107 108 ROOTCDIR = $(ROOT)/etc/fm/$(PROG)
108 109 ROOTHDIR = $(ROOT)/usr/include/fm
109 110 ROOTHDRS = $(HDRS:%=$(ROOTHDIR)/%)
110 111
111 112 $(ROOTHDRS) := FILEMODE = 0644
112 113 $(ROOTVSUB) := DIRMODE = 0755
113 114 $(ROOTMANIFEST) := FILEMODE = 0444
114 115
115 116 $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
↓ open down ↓ |
82 lines elided |
↑ open up ↑ |
116 117 CPPFLAGS += -I. -I../common
117 118 CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
118 119 CFLAGS += $(CTF_FLAGS) $(CCVERBOSE) $(XSTRCONST)
119 120 LINTFLAGS += -mu
120 121 CERRWARN += -_gcc=-Wno-switch
121 122 CERRWARN += -_gcc=-Wno-parentheses
122 123 CERRWARN += -_gcc=-Wno-uninitialized
123 124 CERRWARN += -_gcc=-Wno-unused-variable
124 125 CERRWARN += -_gcc=-Wno-clobbered
125 126
127 +# not linted
128 +SMATCH=off
129 +
126 130 $(PROG) := LDFLAGS += -R/usr/lib/fm
127 131 $(PROG) := LDLIBS += -L$(ROOTLIB)/fm -ltopo -ldiagcode -lsysevent -lsmbios \
128 132 -luuid -lnvpair -lexacct -lnsl -lumem -ldevinfo -lfmd_msg
129 133
130 134 $(DMOD) := CFLAGS += $(CC_PICFLAGS) -G $(XREGSFLAG)
131 135 $(DMOD) := LDFLAGS += $(ZTEXT) $(ZDEFS) $(MAPFILE-DMOD:%=-M%)
132 136
133 137 #
134 138 # rpcgen(1) produces code that wants to be in the foreground if we're compiled
135 139 # DEBUG, which isn't appropriate for our daemon. Forcibly undefine this code.
136 140 # It also produces various lint warnings; turn these off for these files only.
137 141 # Unfortunately we also have to turn off IGNOR2 for pass2 lint as well.
138 142 #
139 143 fmd_svc_adm.o fmd_svc_api.o := CPPFLAGS += -UDEBUG -URPC_SVC_FG
140 144 fmd_xdr_adm.o fmd_xdr_api.o := CPPFLAGS += -UDEBUG -URPC_SVC_FG
141 145
142 146 fmd_svc_adm.ln fmd_svc_api.ln fmd_xdr_adm.ln fmd_xdr_api.ln := LINTFLAGS += \
143 147 -xerroff=E_FUNC_ARG_UNUSED -xerroff=E_FUNC_VAR_UNUSED -xerroff=E_STATIC_UNUSED
144 148
145 149 lint_prog := LINTFLAGS += -xerroff=E_FUNC_RET_ALWAYS_IGNOR2
146 150
147 151 .NO_PARALLEL:
148 152 .PARALLEL: $(OBJS) $(LINTFILES)
149 153
150 154 all: $(PROG) $(DMOD) install_h
151 155
152 156 $(LOGADMDIR):
153 157 $(INS.dir)
154 158
155 159 $(LOGADMDIR)/%.conf: ../common/%.conf
156 160 $(INS.file)
157 161
158 162 $(PROG): $(OBJS)
159 163 $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
160 164 $(CTFMERGE) -L VERSION -o $@ $(OBJS)
161 165 $(POST_PROCESS)
162 166
163 167 $(DMOD): $(DMOD_OBJS)
164 168 $(LINK.c) $(DMOD_OBJS) -o $@ $(LDLIBS) -lc
165 169 $(POST_PROCESS)
166 170
167 171 %.o: ../common/%.c
168 172 $(COMPILE.c) $<
169 173 $(CTFCONVERT_O)
170 174
171 175 %.o: %.c
172 176 $(COMPILE.c) $<
173 177 $(CTFCONVERT_O)
174 178
175 179 ../common/fmd_error.c: ../common/mkerror.sh ../common/fmd_error.h
176 180 sh ../common/mkerror.sh < ../common/fmd_error.h > $@
177 181
178 182 ../common/fmd_rpc_%.c: ../common/fmd_rpc_%.h
179 183
180 184 ../common/fmd_rpc.c: ../common/fmd_rpc_adm.h ../common/fmd_rpc_api.h
181 185
182 186 ../common/fmd_rpc_%.h: ../common/fmd_rpc_%.x
183 187 $(RPCGEN) -CMN -h -o $@ $<
184 188
185 189 fmd_svc_%.c: ../common/fmd_rpc_%.h
186 190 $(RPCGEN) -CMN -m -o $@ `echo $< | sed 's/h$$/x/'`
187 191
188 192 fmd_xdr_%.c: ../common/fmd_rpc_%.h
189 193 $(RPCGEN) -CMN -c -o $@ `echo $< | sed 's/h$$/x/'`
190 194
191 195 clean:
192 196 $(RM) $(OBJS) $(DMOD_OBJS) $(LINTFILES) $(DMOD_LINT)
193 197 $(RM) $(CLEANFILES)
194 198
195 199 clobber: clean
196 200 $(RM) $(PROG) $(DMOD)
197 201
198 202 %.ln: ../common/%.c
199 203 $(LINT.c) -c $<
200 204
201 205 %.ln: %.c
202 206 $(LINT.c) -c $<
203 207
204 208 lint_prog: $(LINTFILES)
205 209 $(LINT) $(LINTFLAGS) $(LINTFILES) $(LDLIBS)
206 210
207 211 lint_dmod: $(DMOD_LINT)
208 212 $(LINT) $(LINTFLAGS) $(DMOD_LINT) $(LDLIBS)
209 213
210 214 lint: lint_prog lint_dmod
211 215
212 216 $(ROOT)/etc/fm:
213 217 $(INS.dir)
214 218
215 219 $(ROOTCDIR): $(ROOT)/etc/fm
216 220 $(INS.dir)
217 221
218 222 $(ROOTHDIR):
219 223 $(INS.dir)
220 224
221 225 $(ROOTHDIR)/%.h: ../common/%.h
222 226 $(INS.file)
223 227
224 228 $(ROOTMANIFESTDIR)/%.xml: ../common/%.xml
225 229 $(INS.file)
226 230
227 231 $(ROOT)/var/%:
228 232 $(INS.dir)
229 233
230 234 $(ROOTVDIR): $(ROOT)/var/fm
231 235 $(INS.dir)
232 236
233 237 $(ROOTVSUB): $(ROOTVDIR)
234 238 $(INS.dir)
235 239
236 240 $(ROOT)/usr/lib/fm:
237 241 $(INS.dir)
238 242
239 243 $(ROOTPDIR): $(ROOT)/usr/lib/fm
240 244 $(INS.dir)
241 245
242 246 $(ROOTPROG): $(ROOTPDIR) $(PROG)
243 247 $(RM) $@; $(INS) -s -m 0555 -f $(@D) $(PROG)
244 248
245 249 $(ROOT)/usr/lib/mdb/proc: $(ROOT)/usr/lib/mdb
246 250 $(INS.dir)
247 251
248 252 $(ROOTDMOD): $(ROOT)/usr/lib/mdb/proc $(DMOD)
249 253 $(RM) $@; $(INS) -s -m 0555 -f $(@D) $(DMOD)
250 254
251 255 install_h: $(ROOTHDIR) $(ROOTHDRS)
252 256
253 257 install: all install_h $(ROOTPROG) $(ROOTDMOD) $(LOGADMDIR) $(LOGADMENT) \
254 258 $(ROOTCDIR) $(ROOTVDIR) $(ROOTVSUB) $(ROOTMANIFEST)
255 259
256 260 check: $(CHKMANIFEST)
↓ open down ↓ |
121 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX