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