Print this page
11528 Makefile.noget can get gone
11529 Use -Wno-maybe-initialized
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/devfsadm/Makefile.com
+++ new/usr/src/cmd/devfsadm/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.
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 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
22 22 # Use is subject to license terms.
23 23 #
24 24 # Copyright 2019, Joyent, Inc.
25 25
26 26 # This target builds both a command (daemon) and various shared objects. This
27 27 # isn't a typical target, and the inclusion of both library and command
28 28 # Makefiles were probably not in their original design. However, there doesn't
29 29 # presently seem to be a clash of any required definitions.
30 30 include ../../../lib/Makefile.lib
31 31 include ../../Makefile.cmd
32 32
33 33 COMMON = ..
34 34 UTSBASE = $(COMMON)/../../uts
35 35
36 36 DEVFSADM_MOD = devfsadm
37 37
38 38 DEVALLOCSRC = devalloc.c
39 39
40 40 PLCYSRC = devpolicy.c plcysubr.c
41 41
42 42 MODLOADDIR = $(COMMON)/../modload
43 43
44 44 DEVFSADM_SRC = $(COMMON)/$(DEVFSADM_MOD:%=%.c) \
45 45 $(DEVALLOCSRC:%=$(COMMON)/%) $(PLCYSRC:%=$(COMMON)/%)
46 46 DEVFSADM_OBJ = $(DEVFSADM_MOD:%=%.o) $(DEVALLOCSRC:%.c=%.o) $(PLCYSRC:%.c=%.o)
47 47
48 48 DEVFSADM_DAEMON = devfsadmd
49 49
50 50 LINKMOD_DIR = linkmod
51 51 DEVFSADM_DIR = devfsadm
52 52
53 53 CLOBBERFILES = $(MODS) $(DEVLINKTAB) $(DEVFSCOMPATLINKS) $(DEVFSADM_DAEMON)
54 54 CLOBBERFILES += $(POFILE) $(POFILES) ../plcysubr.c
55 55
56 56 LINK_OBJS_CMN = \
57 57 disk_link.o \
58 58 ieee1394_link.o \
59 59 dcam1394_link.o \
60 60 tape_link.o \
61 61 usb_link.o \
62 62 port_link.o \
63 63 audio_link.o \
64 64 cfg_link.o \
65 65 misc_link.o \
66 66 lofi_link.o \
67 67 ramdisk_link.o \
68 68 fssnap_link.o \
69 69 sgen_link.o \
70 70 smp_link.o \
71 71 dtrace_link.o \
72 72 vscan_link.o \
73 73 zfs_link.o \
74 74 zut_link.o \
75 75 sensor_link.o
76 76
77 77 LINK_OBJS = $(LINK_OBJS_CMN) \
78 78 $(LINK_OBJS_$(MACH))
79 79
80 80 LINK_SRCS = $(LINK_OBJS_CMN:%.o=$(COMMON)/%.c) \
81 81 $(LINK_OBJS_$(MACH):%.o=%.c)
82 82
83 83 LINT_MODULES = $(LINK_SRCS:%.c=%.ln)
84 84
85 85 LINK_MODS = $(LINK_OBJS:%.o=SUNW_%.so)
86 86
87 87 DEVLINKTAB = devlink.tab
88 88 DEVLINKTAB_SRC = $(COMMON)/$(DEVLINKTAB).sh
89 89
↓ open down ↓ |
89 lines elided |
↑ open up ↑ |
90 90 COMPAT_LINKS = disks tapes ports audlinks devlinks drvconfig
91 91
92 92 CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
93 93 -I$(COMMON) -I$(UTSBASE)/common -I$(MODLOADDIR)
94 94 CFLAGS += $(CCVERBOSE) $(C_PICFLAGS)
95 95
96 96 LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2
97 97 LINTFLAGS += -erroff=E_NAME_DEF_NOT_USED2
98 98 LINTFLAGS += -erroff=E_NAME_MULTIPLY_DEF2
99 99
100 -CERRWARN += -_gcc=-Wno-uninitialized
100 +CERRWARN += $(CNOWARN_UNINIT)
101 101 CERRWARN += -_gcc=-Wno-char-subscripts
102 102 CERRWARN += -_gcc=-Wno-parentheses
103 103
104 104 # not linted
105 105 SMATCH=off
106 106
107 107 # Define the dependencies required by devfsadm and all shared objects.
108 108 LDLIBS += -ldevinfo
109 109 devfsadm := LDLIBS += -lgen -lsysevent -lnvpair -lzonecfg -lbsm
110 110 SUNW_disk_link.so := LDLIBS += -ldevid
111 111 SUNW_sgen_link.so := LDLIBS += -ldevid
112 112
113 113 # All libraries are built from the same SUNW_%.so rule (see below), and define
114 114 # their own SONAME using -h explicitly. Null the generic -h macro that gets
115 115 # inherited from Makefile.lib, otherwise we'll get two -h definitions.
116 116 HSONAME =
117 117
118 118 SRCS = $(DEVFSADM_SRC) $(LINK_SRCS)
119 119 OBJS = $(DEVFSADM_OBJ) $(LINK_OBJS)
120 120 MODS = $(DEVFSADM_MOD) $(LINK_MODS)
121 121
122 122 POFILES = $(LINK_SRCS:.c=.po) $(DEVFSADM_SRC:.c=.po)
123 123 POFILE = pdevfsadm.po
124 124
125 125 # install specifics
126 126
127 127 ROOTLIB_DEVFSADM = $(ROOTLIB)/$(DEVFSADM_DIR)
128 128 ROOTLIB_DEVFSADM_LINKMOD = $(ROOTLIB_DEVFSADM)/$(LINKMOD_DIR)
129 129
130 130 ROOTLIB_DEVFSADM_LINK_MODS = $(LINK_MODS:%=$(ROOTLIB_DEVFSADM_LINKMOD)/%)
131 131
132 132 ROOTUSRSBIN_COMPAT_LINKS = $(COMPAT_LINKS:%=$(ROOTUSRSBIN)/%)
133 133
134 134 ROOTUSRSBIN_DEVFSADM = $(DEVFSADM_MOD:%=$(ROOTUSRSBIN)/%)
135 135
136 136 ROOTLIB_DEVFSADM_DAEMON = $(ROOTLIB_DEVFSADM)/$(DEVFSADM_DAEMON)
137 137
138 138 ROOTETC_DEVLINKTAB = $(DEVLINKTAB:%=$(ROOTETC)/%)
139 139
140 140 FILEMODE= 755
141 141
142 142 $(ROOTETC_DEVLINKTAB) := FILEMODE = 644
143 143
144 144 all := TARGET= all
145 145 install := TARGET= install
146 146 clean := TARGET= clean
147 147 clobber := TARGET= clobber
148 148 lint := TARGET= lint
149 149
150 150
151 151 .KEEP_STATE:
152 152
153 153 all: $(MODS) $(DEVLINKTAB)
154 154
155 155 install: all \
156 156 $(ROOTLIB_DEVFSADM) \
157 157 $(ROOTLIB_DEVFSADM_LINKMOD) \
158 158 $(ROOTUSRSBIN_DEVFSADM) \
159 159 $(ROOTETC_DEVLINKTAB) \
160 160 $(ROOTLIB_DEVFSADM_LINK_MODS) \
161 161 $(ROOTUSRINCLUDE) \
162 162 $(ROOTLIB_DEVFSADM_DAEMON) \
163 163 $(ROOTUSRSBIN_COMPAT_LINKS)
164 164
165 165
166 166 clean:
167 167 $(RM) $(OBJS)
168 168
169 169
170 170 lint: $(DEVFSADM_MOD).ln $(LINT_MODULES)
171 171
172 172 devfsadm.ln: $(DEVFSADM_SRC)
173 173 $(LINT.c) $(DEVFSADM_SRC) $(LDLIBS)
174 174
175 175 %.ln: $(DEVFSADM_SRC) %.c
176 176 $(LINT.c) $(DEVFSADM_SRC) $(@:.ln=.c) $(LDLIBS)
177 177
178 178 include ../../Makefile.targ
179 179
180 180 $(POFILE): $(POFILES)
181 181 $(RM) $@; cat $(POFILES) > $@
182 182
183 183 $(DEVFSADM_MOD): $(DEVFSADM_OBJ)
184 184 $(LINK.c) -o $@ $< $(DEVFSADM_OBJ) $(LDLIBS)
185 185 $(POST_PROCESS)
186 186
187 187 SUNW_%.so: %.o $(MAPFILES)
188 188 $(CC) -o $@ $(GSHARED) $(DYNFLAGS) -h $@ $< $(LDLIBS) -lc
189 189 $(POST_PROCESS_SO)
190 190
191 191 %.o: $(COMMON)/%.c
192 192 $(COMPILE.c) -o $@ $< $(CTFCONVERT_HOOK)
193 193 $(POST_PROCESS_O)
194 194
195 195
196 196 $(DEVLINKTAB): $(DEVLINKTAB_SRC)
197 197 $(RM) $(DEVLINKTAB)
198 198 /bin/sh $(DEVLINKTAB_SRC) > $(DEVLINKTAB)
199 199
200 200 $(ROOTUSRSBIN):
201 201 $(INS.dir)
202 202
203 203 $(ROOTLIB_DEVFSADM):
204 204 $(INS.dir)
205 205
206 206 $(ROOTUSRINCLUDE):
207 207 $(INS.dir)
208 208
209 209 $(ROOTLIB_DEVFSADM_LINKMOD):
210 210 $(INS.dir)
211 211
212 212 $(ROOTLIB_DEVFSADM_LINKMOD)/%: %
213 213 $(INS.file)
214 214
215 215 $(ROOTLIB_DEVFSADM_DAEMON):
216 216 $(RM) $@; $(SYMLINK) ../../sbin/$(DEVFSADM_DIR) $@
217 217
218 218 $(ROOTUSRSBIN_COMPAT_LINKS): $(ROOTUSRSBIN_DEVFSADM)
219 219 $(RM) $@ ; $(LN) $(ROOTUSRSBIN_DEVFSADM) $@
220 220
221 221 #
222 222 # Source shared with add_drv/update_drv
223 223 #
224 224 ../plcysubr.c:
225 225 rm -f $@
226 226 ln -s ../modload/plcysubr.c ..
↓ open down ↓ |
116 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX