Print this page
3735 should include an empty make variable in the default CFLAGS/CCFLAGS
3844 the build should make source-level debugging easier
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/sun4v/Makefile.sun4v.shared
+++ new/usr/src/uts/sun4v/Makefile.sun4v.shared
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 2010 Sun Microsystems, Inc. All rights reserved.
24 24 # Use is subject to license terms.
25 25 #
26 26 # This makefile contains the common definitions for the sun4v unix
27 27 # and all sun4v implementation architecture dependent modules.
28 28 #
29 29
30 30 #
31 31 # Machine type (implementation architecture):
32 32 #
33 33 PLATFORM = sun4v
34 34 LINKED_PLATFORMS += SUNW,Sun-Fire-T1000
35 35 LINKED_PLATFORMS += SUNW,SPARC-Enterprise-T5120
36 36 LINKED_PLATFORMS += SUNW,SPARC-Enterprise-T5220
37 37 LINKED_PLATFORMS += SUNW,T5140
38 38 LINKED_PLATFORMS += SUNW,T5240
39 39 LINKED_PLATFORMS += SUNW,T5440
40 40 LINKED_PLATFORMS += SUNW,SPARC-Enterprise-T1000
41 41 LINKED_PLATFORMS += SUNW,Sun-Blade-T6300
42 42 LINKED_PLATFORMS += SUNW,Sun-Blade-T6320
43 43 LINKED_PLATFORMS += SUNW,Netra-CP3260
44 44 LINKED_PLATFORMS += SUNW,Netra-T5220
45 45 LINKED_PLATFORMS += SUNW,USBRDT-5240
46 46 LINKED_PLATFORMS += SUNW,Netra-T5440
47 47 LINKED_PLATFORMS += SUNW,Sun-Blade-T6340
48 48 PROMIF = ieee1275
49 49 PSMBASE = $(UTSBASE)/../psm
50 50
51 51 #
52 52 # uname -m value
53 53 #
54 54 UNAME_M = $(PLATFORM)
55 55
56 56 #
57 57 # Definitions for the platform-specific /platform directories.
58 58 #
59 59 # PLATFORMS designates those sun4v machines which have no platform
60 60 # specific code.
61 61 #
62 62 # IMPLEMENTATIONS is used to designate sun4v machines which have
63 63 # platform specific modules. All code specific to a given implementation
64 64 # resides in the appropriately named subdirectory. This requires
65 65 # these platforms to have their own Makefiles to define ROOT_PLAT_DIRS,
66 66 # USR_PLAT_DIRS, etc.
67 67 # The number of IMPLEMENTATIONS should not grow!
68 68 #
69 69 # So if we had an implementation named 'foo', we would need the following
70 70 # Makefiles in the foo subdirectory:
71 71 #
72 72 # sun4v/foo/Makefile
73 73 # sun4v/foo/Makefile.foo
74 74 # sun4v/foo/Makefile.targ
75 75 #
76 76
77 77 #
78 78 # all PLATFORMS that do not belong in the $(IMPLEMENTATIONS) list.
79 79 # This list should be empty. A platform without platform modules
80 80 # is a plain, generic sun4v platform.
81 81 #
82 82 #IMPLEMENTED_PLATFORM =
83 83 #PLATFORMS = $(IMPLEMENTED_PLATFORM)
84 84
85 85 IMPLEMENTATIONS = ontario montoya huron maramba
86 86
87 87 #ROOT_PLAT_DIRS = $(PLATFORMS:%=$(ROOT_PLAT_DIR)/%)
88 88 #USR_PLAT_DIRS = $(PLATFORMS:%=$(USR_PLAT_DIR)/%)
89 89
90 90 #USR_DESKTOP_DIR = $(USR_PLAT_DIR)/$(IMPLEMENTED_PLATFORM)
91 91 #USR_DESKTOP_INC_DIR = $(USR_DESKTOP_DIR)/include
92 92 #USR_DESKTOP_SBIN_DIR = $(USR_DESKTOP_DIR)/sbin
93 93 #USR_DESKTOP_LIB_DIR = $(USR_DESKTOP_DIR)/lib
94 94
95 95 #
96 96 # Define supported builds
97 97 #
98 98 DEF_BUILDS = $(DEF_BUILDS64)
99 99 ALL_BUILDS = $(ALL_BUILDS64)
100 100
101 101 #
102 102 # Everybody needs to know how to build modstubs.o and to locate unix.o
103 103 #
104 104 UNIX_DIR = $(UTSBASE)/$(PLATFORM)/unix
105 105 GENLIB_DIR = $(UTSBASE)/$(PLATFORM)/genunix
106 106 MODSTUBS_DIR = $(UNIX_DIR)
107 107 DSF_DIR = $(UTSBASE)/$(PLATFORM)/genassym
108 108 LINTS_DIR = $(OBJS_DIR)
109 109 LINT_LIB_DIR = $(UTSBASE)/$(PLATFORM)/lint-libs/$(OBJS_DIR)
110 110
111 111 DTRACESTUBS_O = $(OBJS_DIR)/dtracestubs.o
112 112 DTRACESTUBS = $(OBJS_DIR)/libdtracestubs.so
113 113
114 114 UNIX_O = $(UNIX_DIR)/$(OBJS_DIR)/unix.o
115 115 MODSTUBS_O = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o
116 116 GENLIB = $(GENLIB_DIR)/$(OBJS_DIR)/libgenunix.so
117 117
118 118 LINT_LIB = $(LINT_LIB_DIR)/llib-lunix.ln
119 119 GEN_LINT_LIB = $(LINT_LIB_DIR)/llib-lgenunix.ln
120 120
121 121 LINT64_DIRS = $(LINT64_BUILDS:%=$(UTSBASE)/$(PLATFORM)/lint-libs/%)
122 122 LINT64_FILES = $(LINT64_DIRS:%=%/llib-l$(MODULE).ln)
123 123
124 124 #
125 125 # cpu and platform modules need to know how to build their own symcheck module
126 126 #
127 127 PLATMOD = platmod
128 128 PLATLIB = $(PLAT_DIR)/$(OBJS_DIR)/libplatmod.so
129 129
130 130 CPUNAME = cpu
131 131 CPULIB = $(CPU_DIR)/$(OBJS_DIR)/libcpu.so
132 132
133 133 SYM_MOD = $(OBJS_DIR)/unix.sym
134 134
135 135 #
136 136 # Include the makefiles which define build rule templates, the
137 137 # collection of files per module, and a few specific flags. Note
138 138 # that order is significant, just as with an include path. The
139 139 # first build rule template which matches the files name will be
140 140 # used. By including these in order from most machine dependent
141 141 # to most machine independent, we allow a machine dependent file
142 142 # to be used in preference over a machine independent version
143 143 # (Such as a machine specific optimization, which preserves the
144 144 # interfaces.)
145 145 #
146 146 include $(UTSBASE)/sun4/Makefile.files
147 147 include $(UTSTREE)/$(PLATFORM)/Makefile.files
148 148 include $(UTSBASE)/sfmmu/Makefile.files
149 149 include $(UTSBASE)/sparc/v9/Makefile.files
150 150 include $(UTSBASE)/sparc/Makefile.files
151 151 include $(UTSTREE)/sun/Makefile.files
152 152 include $(SRC)/psm/promif/$(PROMIF)/common/Makefile.files
153 153 include $(SRC)/psm/promif/$(PROMIF)/$(PLATFORM)/Makefile.files
154 154 include $(UTSTREE)/common/Makefile.files
155 155
156 156 #
157 157 # Include machine independent rules. Note that this does not imply
158 158 # that the resulting module from rules in Makefile.uts is machine
159 159 # independent. Only that the build rules are machine independent.
160 160 #
161 161 include $(UTSBASE)/Makefile.uts
162 162
163 163 CTFMERGE_GUDIR = sun4v
164 164
165 165 #
166 166 # machine specific optimization, override default in Makefile.master
167 167 #
168 168 CC_XARCH = -m64 -xarch=sparcvis
169 169 AS_XARCH = -xarch=v9v
170 170 COPTIMIZE = -xO3
171 171 CCMODE = -Xa
172 172
173 173 CFLAGS = -xchip=ultra $(CCABS32) $(CCREGSYM)
174 174 CFLAGS += $(CC_XARCH)
175 175 CFLAGS += $(COPTIMIZE)
176 176 CFLAGS += $(EXTRA_CFLAGS)
177 177 CFLAGS += $(XAOPT)
178 178 CFLAGS += $(INLINES) -D_ASM_INLINES
179 179 CFLAGS += $(CCMODE)
180 180 CFLAGS += $(SPACEFLAG)
181 181 CFLAGS += $(CERRWARN)
↓ open down ↓ |
181 lines elided |
↑ open up ↑ |
182 182 CFLAGS += $(CTF_FLAGS_$(CLASS))
183 183 CFLAGS += $(C99MODE)
184 184 CFLAGS += $(CCUNBOUND)
185 185 CFLAGS += $(CCNOAUTOINLINE)
186 186 CFLAGS += $(CCSTATICSYM)
187 187 CFLAGS += $(CC32BITCALLERS)
188 188 CFLAGS += $(IROPTFLAG)
189 189 CFLAGS += $(CGLOBALSTATIC)
190 190 CFLAGS += -xregs=no%float
191 191 CFLAGS += -xstrconst
192 +CFLAGS += $(CSOURCEDEBUGFLAGS)
193 +CFLAGS += $(CUSERFLAGS)
194 +
192 195 CPPFLAGS += -DGLREG
193 196
194 197 ASFLAGS += $(AS_XARCH) -DGLREG
195 198
196 199 AS_INC_PATH += -I$(DSF_DIR)/$(OBJS_DIR)
197 200
198 201 LINT_KMODS += $(GENUNIX_KMODS)
199 202
200 203 LINT_DEFS = -m64
201 204
202 205 #
203 206 # The following must be defined for all implementations:
204 207 #
205 208 # MAPFILE: ld mapfile for the build of kernel/unix.
206 209 # MODSTUBS: Module stubs source file.
207 210 # GENCONST_SRC: genconst.c
208 211 # OFFSETS: offsets.in
209 212 # PLATFORM_OFFSETS: Platform specific mach_offsets.in
210 213 # FDOFFSETS: fd_offsets.in
211 214 #
212 215 MAPFILE = $(UTSBASE)/sun4/conf/Mapfile
213 216 MODSTUBS = $(UTSBASE)/sparc/ml/modstubs.s
214 217 GENCONST_SRC = $(UTSBASE)/sun4/ml/genconst.c
215 218 OFFSETS = $(UTSBASE)/sun4/ml/offsets.in
216 219 PLATFORM_OFFSETS = $(UTSBASE)/sun4v/ml/mach_offsets.in
217 220 FDOFFSETS = $(UTSBASE)/sun/io/fd_offsets.in
218 221
219 222 #
220 223 # Define the actual specific platforms
221 224 #
222 225
223 226 MACHINE_DEFS = -D$(PLATFORM) -D_MACHDEP -DSFMMU
224 227 MACHINE_DEFS += -DMAX_MEM_NODES=8
225 228
226 229 #
227 230 # Software workarounds for hardware "features"
228 231 #
229 232
230 233 include $(UTSBASE)/$(PLATFORM)/Makefile.workarounds
231 234
232 235 #
233 236 # Debugging level
234 237 #
235 238 # Special knowledge of which special debugging options effect which
236 239 # file is used to optimize the build if these flags are changed.
237 240 #
238 241 # XXX: The above could possibly be done for more flags and files, but
239 242 # is left as an experiment to the interested reader. Be forewarned,
240 243 # that excessive use could lead to maintenance difficulties.
241 244 #
242 245 # Note: kslice can be enabled for the sun4v, but is disabled by default
243 246 # in all cases.
244 247 #
245 248
246 249 DEBUG_DEFS_OBJ64 =
247 250 DEBUG_DEFS_DBG64 = -DDEBUG
248 251 DEBUG_DEFS = $(DEBUG_DEFS_$(BUILD_TYPE))
249 252
250 253 DEBUG_COND_OBJ64 :sh = echo \\043
251 254 DEBUG_COND_DBG64 =
252 255 IF_DEBUG_OBJ = $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/
253 256
254 257 $(IF_DEBUG_OBJ)trap.o := DEBUG_DEFS += -DTRAPDEBUG
255 258 $(IF_DEBUG_OBJ)mach_trap.o := DEBUG_DEFS += -DTRAPDEBUG
256 259 $(IF_DEBUG_OBJ)syscall_trap.o := DEBUG_DEFS += -DSYSCALLTRACE
257 260 $(IF_DEBUG_OBJ)clock.o := DEBUG_DEFS += -DKSLICE=0
258 261
259 262 IF_TRAPTRACE_OBJ = $(IF_DEBUG_OBJ)
260 263 # comment this out for a non-debug kernel with TRAPTRACE
261 264 #IF_TRAPTRACE_OBJ = $(OBJS_DIR)/
262 265
263 266 $(IF_TRAPTRACE_OBJ)mach_locore.o := DEBUG_DEFS += -DTRAPTRACE
264 267 $(IF_TRAPTRACE_OBJ)mlsetup.o := DEBUG_DEFS += -DTRAPTRACE
265 268 $(IF_TRAPTRACE_OBJ)syscall_trap.o := DEBUG_DEFS += -DTRAPTRACE
266 269 $(IF_TRAPTRACE_OBJ)startup.o := DEBUG_DEFS += -DTRAPTRACE
267 270 $(IF_TRAPTRACE_OBJ)mach_startup.o := DEBUG_DEFS += -DTRAPTRACE
268 271 $(IF_TRAPTRACE_OBJ)mp_startup.o := DEBUG_DEFS += -DTRAPTRACE
269 272 $(IF_TRAPTRACE_OBJ)cpu_states.o := DEBUG_DEFS += -DTRAPTRACE
270 273 $(IF_TRAPTRACE_OBJ)mach_cpu_states.o := DEBUG_DEFS += -DTRAPTRACE
271 274 $(IF_TRAPTRACE_OBJ)interrupt.o := DEBUG_DEFS += -DTRAPTRACE
272 275 $(IF_TRAPTRACE_OBJ)mach_interrupt.o := DEBUG_DEFS += -DTRAPTRACE
273 276 $(IF_TRAPTRACE_OBJ)sfmmu_asm.o := DEBUG_DEFS += -DTRAPTRACE
274 277 $(IF_TRAPTRACE_OBJ)trap_table.o := DEBUG_DEFS += -DTRAPTRACE
275 278 $(IF_TRAPTRACE_OBJ)xc.o := DEBUG_DEFS += -DTRAPTRACE
276 279 $(IF_TRAPTRACE_OBJ)mach_xc.o := DEBUG_DEFS += -DTRAPTRACE
277 280 $(IF_TRAPTRACE_OBJ)wbuf.o := DEBUG_DEFS += -DTRAPTRACE
278 281 $(IF_TRAPTRACE_OBJ)trap.o := DEBUG_DEFS += -DTRAPTRACE
279 282 $(IF_TRAPTRACE_OBJ)mach_trap.o := DEBUG_DEFS += -DTRAPTRACE
280 283 $(IF_TRAPTRACE_OBJ)x_call.o := DEBUG_DEFS += -DTRAPTRACE
281 284
282 285 # Comment these out if you don't want dispatcher lock statistics.
283 286
284 287 #$(IF_DEBUG_OBJ)lock_prim.o := DEBUG_DEFS += -DDISP_LOCK_STATS
285 288 #$(IF_DEBUG_OBJ)disp.o := DEBUG_DEFS += -DDISP_LOCK_STATS
286 289
287 290 # Comment these out if you don't want dispatcher debugging
288 291
289 292 #$(IF_DEBUG_OBJ)lock_prim.o := DEBUG_DEFS += -DDISP_DEBUG
290 293
291 294 #
292 295 # Collect the preprocessor definitions to be associated with *all*
293 296 # files.
294 297 #
295 298 ALL_DEFS = $(MACHINE_DEFS) $(WORKAROUND_DEFS) $(DEBUG_DEFS) \
296 299 $(OPTION_DEFS)
297 300 GENCONST_DEFS = $(MACHINE_DEFS) $(OPTION_DEFS)
298 301
299 302 #
300 303 # ----- TRANSITIONAL SECTION --------------------------------------------------
301 304 #
302 305
303 306 #
304 307 # Not everything which *should* be a module is a module yet. The
305 308 # following is a list of such objects which are currently part of
306 309 # the base kernel but should soon become kmods.
307 310 #
308 311 MACH_NOT_YET_KMODS = $(AUTOCONF_OBJS)
309 312
310 313 #
311 314 # ----- END OF TRANSITIONAL SECTION -------------------------------------------
312 315 #
313 316
314 317 #
315 318 # The kernels modules which are "implementation architecture"
316 319 # specific for this machine are enumerated below. Note that most
317 320 # of these modules must exist (in one form or another) for each
318 321 # architecture.
319 322 #
320 323 # Common Drivers (usually pseudo drivers) (/kernel/drv):
321 324 #
322 325
323 326 #
324 327 # Machine Specific Driver Modules (/kernel/drv):
325 328 #
326 329 DRV_KMODS += bge
327 330 DRV_KMODS += cnex
328 331 DRV_KMODS += cpc
329 332 DRV_KMODS += drctl
330 333 DRV_KMODS += ds_pri
331 334 DRV_KMODS += ds_snmp
332 335 DRV_KMODS += ebus
333 336 DRV_KMODS += fpc
334 337 DRV_KMODS += glvc
335 338 DRV_KMODS += mdesc
336 339 DRV_KMODS += niumx
337 340 DRV_KMODS += ntwdt
338 341 DRV_KMODS += nxge
339 342 DRV_KMODS += n2piupc
340 343 DRV_KMODS += iospc
341 344 DRV_KMODS += n2rng
342 345 DRV_KMODS += px
343 346 DRV_KMODS += qcn
344 347 DRV_KMODS += rootnex
345 348 DRV_KMODS += su
346 349 DRV_KMODS += tpm
347 350 DRV_KMODS += trapstat
348 351 DRV_KMODS += vcc
349 352 DRV_KMODS += vdc
350 353 DRV_KMODS += vds
351 354 DRV_KMODS += vldc
352 355 DRV_KMODS += vlds
353 356 DRV_KMODS += vnet
354 357 DRV_KMODS += vnex
355 358 DRV_KMODS += vsw
356 359
357 360 $(CLOSED_BUILD)CLOSED_DRV_KMODS += bmc
358 361 $(CLOSED_BUILD)CLOSED_DRV_KMODS += memtest
359 362 $(CLOSED_BUILD)CLOSED_DRV_KMODS += ncp
360 363 $(CLOSED_BUILD)CLOSED_DRV_KMODS += n2cp
361 364
362 365 #
363 366 # Exec Class Modules (/kernel/exec):
364 367 #
365 368 EXEC_KMODS +=
366 369
367 370 #
368 371 # Scheduling Class Modules (/kernel/sched):
369 372 #
370 373 SCHED_KMODS +=
371 374
372 375 #
373 376 # File System Modules (/kernel/fs):
374 377 #
375 378 FS_KMODS +=
376 379
377 380 #
378 381 # Streams Modules (/kernel/strmod):
379 382 #
380 383 # STRMOD_KMODS += kb
381 384
382 385 #
383 386 # 'System' Modules (/kernel/sys):
384 387 #
385 388 SYS_KMODS +=
386 389
387 390 #
388 391 # 'User' Modules (/kernel/misc):
389 392 #
390 393 MISC_KMODS += bootdev
391 394 MISC_KMODS += dr_cpu
392 395 MISC_KMODS += dr_io
393 396 MISC_KMODS += dr_mem
394 397 MISC_KMODS += ds
395 398 MISC_KMODS += fault_iso
396 399 MISC_KMODS += ldc
397 400 MISC_KMODS += obpsym
398 401 MISC_KMODS += platmod
399 402 MISC_KMODS += platsvc
400 403 MISC_KMODS += vis
401 404 MISC_KMODS += pcie
402 405
403 406 # md5 optimized for Niagara
404 407 #
405 408 MISC_KMODS += md5
406 409
407 410 #
408 411 # Brand modules
409 412 #
410 413 BRAND_KMODS += sn1_brand s10_brand
411 414
412 415 #
413 416 # Software Cryptographic Providers (/kernel/crypto):
414 417 #
415 418 CRYPTO_KMODS += arcfour
416 419
417 420 #
418 421 # generic-unix module (/kernel/genunix):
419 422 #
420 423 GENUNIX_KMODS += genunix
421 424
422 425 # 'User' "Modules" excluded from the Full Kernel lint target:
423 426 #
424 427 $(CLOSED_BUILD)CLOSED_NLMISC_KMODS += forthdebug
425 428
426 429 #
427 430 # Modules eXcluded from the product:
428 431 #
429 432 XMODS +=
430 433
431 434 #
432 435 # cpu modules
433 436 #
434 437 CPU_KMODS += generic niagara niagara2 vfalls kt
435 438
436 439 LINT_CPU_KMODS += generic
437 440
438 441 #
439 442 # Performance Counter BackEnd Modules (/usr/kernel/pcbe):
440 443 #
441 444 PCBE_KMODS += niagara_pcbe
442 445 PCBE_KMODS += niagara2_pcbe
443 446 PCBE_KMODS += vfalls_pcbe
444 447 PCBE_KMODS += kt_pcbe
↓ open down ↓ |
243 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX