Print this page
11528 Makefile.noget can get gone
11529 Use -Wno-maybe-initialized
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/i86xpv/unix/Makefile
+++ new/usr/src/uts/i86xpv/unix/Makefile
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 #
23 23 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 24 # Use is subject to license terms.
25 25 #
26 26 # Copyright (c) 2018, Joyent, Inc.
27 27 #
28 28 # This makefile drives the production of unix (and unix.o).
29 29 #
30 30 # i86xpv implementation architecture dependent
31 31 #
32 32
33 33 #
34 34 # Path to the base of the uts directory tree (usually /usr/src/uts).
35 35 #
36 36 UTSBASE = ../..
37 37
38 38 #
39 39 # Define the module and object file sets.
40 40 #
41 41 UNIX = unix
42 42 DBOOT = dboot
43 43
44 44 OBJECTS = $(SPECIAL_OBJS:%=$(OBJS_DIR)/%) \
45 45 $(CORE_OBJS:%=$(OBJS_DIR)/%) \
46 46 $(KRTLD_OBJS:%=$(OBJS_DIR)/%) \
47 47 $(MACH_NOT_YET_KMODS:%=$(OBJS_DIR)/%)
48 48
49 49 LINTS = $(SPECIAL_OBJS:%.o=$(LINTS_DIR)/%.ln) \
50 50 $(CORE_OBJS:%.o=$(LINTS_DIR)/%.ln) \
51 51 $(KRTLD_OBJS:%.o=$(LINTS_DIR)/%.ln) \
52 52 $(MACH_NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln) \
53 53 $(LINTS_DIR)/vers.ln \
54 54 $(LINTS_DIR)/modstubs.ln
55 55
56 56 ROOTMODULE = $(ROOT_PSM_KERN_DIR)/$(UNIX)
57 57
58 58 UNIX_BIN = $(OBJS_DIR)/$(UNIX)
59 59
60 60 LIBS = $(GENLIB)
61 61
62 62 GENUNIX = genunix
63 63 GENUNIX_DIR = ../../intel/$(GENUNIX)
64 64
65 65 LIBOPTS = -L $(GENUNIX_DIR)/$(OBJS_DIR) -l $(GENUNIX)
66 66
67 67 CTFEXTRAOBJS = $(OBJS_DIR)/vers.o
68 68
69 69 DBOOT_OBJS_DIR = dboot/$(OBJS_DIR)
70 70 DBOOT_OBJECTS = $(DBOOT_OBJS:%=$(DBOOT_OBJS_DIR)/%)
71 71 DBOOT_BIN = $(DBOOT_OBJS_DIR)/$(DBOOT)
72 72 DBOOT_O = $(OBJS_DIR)/$(DBOOT).o
73 73 DBOOT_S = $(DBOOT_O:%.o=%.s)
74 74 DBOOT_LINTS = $(DBOOT_OBJS:%.o=$(DBOOT_OBJS_DIR)/%.ln)
75 75 DBOOT_LINT = $(LINT_$(MACH)_$(CLASS))
76 76
77 77 #
78 78 # Include common rules.
79 79 #
80 80 include $(UTSBASE)/i86xpv/Makefile.i86xpv
81 81
82 82 #
83 83 # Define targets
84 84 #
85 85 ALL_TARGET = $(UNIX_BIN)
86 86 LINT_TARGET = $(LINT_LIB) $(DBOOT_LINT_LIB)
87 87 INSTALL_TARGET = $(UNIX_BIN) $(ROOTMODULE)
88 88
89 89 #
90 90 # This is UNIX_DIR. Use a short path.
91 91 #
92 92 UNIX_DIR = .
93 93
94 94 #
95 95 # Overrides
96 96 #
97 97 CLEANFILES += \
98 98 $(UNIX_O) $(MODSTUBS_O) \
99 99 $(OBJS_DIR)/vers.c $(OBJS_DIR)/vers.o \
100 100 $(OBJS_DIR)/dtracestubs.s \
101 101 $(DTRACESTUBS_O) $(DTRACESTUBS)
102 102
103 103 CLEANFILES += \
104 104 $(DBOOT_O) $(DBOOT_S) \
105 105 $(DBOOT_OBJECTS) \
106 106 $(DBOOT_BIN)
107 107
108 108 CLEANFILES += \
109 109 $(DBOOT_OBJS_DIR)/$(FONT).c \
110 110 $(OBJS_DIR)/$(FONT).c
111 111
112 112 CLEANFILES += \
113 113 $(OBJS_DIR)/fb_swtch_src.o \
114 114 $(OBJS_DIR)/fb_swtch_src \
115 115 $(OBJS_DIR)/fb_swtch.s
116 116
117 117 CLEANFILES += \
118 118 $(ZLIB_OBJS:%.o=$(OBJS_DIR)/%.o) \
119 119 $(ZLIB_OBJS:%.o=$(OBJS_DIR)/%.ln)
120 120
121 121 CLOBBERFILES = $(CLEANFILES) $(UNIX_BIN)
122 122 CLEANLINTFILES += $(LINT_LIB) $(DBOOT_LINT_LIB) $(DBOOT_LINTS)
123 123
124 124 # instr_size needs a special header
125 125 $(OBJS_DIR)/instr_size.o := EXTRA_OPTIONS = -I$(SRC)/common/dis/i386
126 126 $(OBJS_DIR)/instr_size.ln := EXTRA_OPTIONS = -I$(SRC)/common/dis/i386
127 127
128 128 CFLAGS += -DDIS_MEM
129 129
130 130 #
131 131 # For now, disable these lint checks; maintainers should endeavor
132 132 # to investigate and remove these for maximum lint coverage.
↓ open down ↓ |
132 lines elided |
↑ open up ↑ |
133 133 # Please do not carry these forward to new Makefiles.
134 134 #
135 135 LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
136 136 LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON
137 137 LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
138 138 LINTTAGS += -erroff=E_STATIC_UNUSED
139 139 LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW
140 140 LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
141 141
142 142 CERRWARN += -_gcc=-Wno-parentheses
143 -CERRWARN += -_gcc=-Wno-uninitialized
143 +CERRWARN += $(CNOWARN_UNINIT)
144 144 CERRWARN += -_gcc=-Wno-char-subscripts
145 145 CERRWARN += -_gcc=-Wno-unused-variable
146 146 CERRWARN += -_gcc=-Wno-unused-function
147 147 CERRWARN += -_gcc=-Wno-unused-label
148 148 CERRWARN += -_gcc=-Wno-type-limits
149 149 CERRWARN += -_gcc=-Wno-clobbered
150 150 CERRWARN += -_gcc=-Wno-unused-value
151 151 CERRWARN += -_gcc=-Wno-empty-body
152 152
153 153 # needs work
154 154 SMATCH=off
155 155
156 156 # Ensure that lint sees 'struct cpu' containing a fully declared
157 157 # embedded 'struct machcpu'
158 158 #
159 159 LINTFLAGS += -D_MACHDEP -I../../i86pc
160 160
161 161 #
162 162 # Default build targets.
163 163 #
164 164 .KEEP_STATE:
165 165
166 166 def: $(DEF_DEPS)
167 167
168 168 all: $(ALL_DEPS)
169 169
170 170 clean: $(CLEAN_DEPS)
171 171
172 172 clobber: $(CLOBBER_DEPS)
173 173
174 174 lint: $(LINT_DEPS)
175 175
176 176 clean.lint: $(CLEAN_LINT_DEPS)
177 177
178 178 install: $(INSTALL_DEPS)
179 179
180 180 MAPFILE_32 = $(MAPFILE)
181 181 MAPFILE_64 = $(MAPFILE).amd64
182 182
183 183 MAPFILE_NAME = $(MAPFILE_$(CLASS))
184 184
185 185 $(UNIX_BIN): $(UNIX_O) $(MODSTUBS_O) $(MAPFILE_NAME) \
186 186 $(GENLIB) $(DTRACESTUBS) $(DBOOT_O)
187 187 $(LD) -dy -b -o $@ -e dboot_image -znointerp -M $(MAPFILE_NAME) \
188 188 $(UNIX_O) $(DBOOT_O) $(MODSTUBS_O) $(LIBOPTS) \
189 189 $(DTRACESTUBS)
190 190 $(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
191 191 $(POST_PROCESS)
192 192
193 193 $(UNIX_O): $(OBJECTS) $(OBJS_DIR)/vers.o
194 194 $(LD) -r -o $@ $(OBJECTS) $(OBJS_DIR)/vers.o
195 195
196 196 $(DBOOT_BIN): $(DBOOT_OBJS_DIR) $(DBOOT_OBJECTS) dboot/Mapfile.dboot
197 197 $(LD) -dn -e _start -M dboot/Mapfile.dboot \
198 198 -o $(DBOOT_BIN) $(DBOOT_OBJECTS)
199 199
200 200 $(DBOOT_O): $(DBOOT_BIN)
201 201 @echo " .data" > $(DBOOT_S)
202 202 @echo " .globl dboot_image" >> $(DBOOT_S)
203 203 @echo "dboot_image:" >> $(DBOOT_S)
204 204 $(ELFEXTRACT) $(DBOOT_BIN) >> $(DBOOT_S)
205 205 $(COMPILE.s) -o $(DBOOT_O) $(DBOOT_S)
206 206
207 207 $(DBOOT_OBJS_DIR):
208 208 -@mkdir -p $@ 2> /dev/null
209 209
210 210 #
211 211 # Special rules for generating assym.h for inclusion in assembly files.
212 212 #
213 213 $(DSF_DIR)/$(OBJS_DIR)/assym.h $(DSF_DIR)/$(OBJS_DIR)/kdi_assym.h: FRC
214 214 @cd $(DSF_DIR); $(MAKE) all.targ
215 215
216 216 #
217 217 # The global lint target builds the kernel lint library (llib-lunix.ln)
218 218 # which is equivalent to a lint of /unix.o. Then all kernel modules for
219 219 # this architecture are linted against the kernel lint library.
220 220 #
221 221 # Note: lint errors in the kernel lint library will be repeated for
222 222 # each module. It is important that the kernel lint library
223 223 # be clean to keep the textual output to a reasonable level.
224 224 #
225 225
226 226 $(LINT_LIB): $(LINT_LIB_DIR) $(LINTS)
227 227 @pwd
228 228 @-$(ECHO) "\n$(UNIX): (library construction):"
229 229 @$(LINT) -o$(UNIX) $(LINTFLAGS) $(LINTS)
230 230 @$(MV) $(@F) $@
231 231
232 232 $(DBOOT_LINT_LIB): $(LINT_LIB_DIR) $(DBOOT_LINTS)
233 233 @pwd
234 234 @-$(ECHO) "\n$(DBOOT): (library construction):"
235 235 @$(LINT) -o$(DBOOT) $(DBOOT_LINTFLAGS) $(DBOOT_LINTS)
236 236 @$(MV) $(@F) $@
237 237
238 238 lintlib: $(LINT_DEPS)
239 239
240 240 #
241 241 # Include common targets.
242 242 #
243 243 include $(UTSBASE)/i86xpv/Makefile.targ
↓ open down ↓ |
90 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX