1 #
   2 # CDDL HEADER START
   3 #
   4 # The contents of this file are subject to the terms of the
   5 # Common Development and Distribution License (the "License").
   6 # You may not use this file except in compliance with the License.
   7 #
   8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9 # or http://www.opensolaris.org/os/licensing.
  10 # See the License for the specific language governing permissions
  11 # and limitations under the License.
  12 #
  13 # When distributing Covered Code, include this CDDL HEADER in each
  14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15 # If applicable, add the following below this CDDL HEADER, with the
  16 # fields enclosed by brackets "[]" replaced with your own identifying
  17 # information: Portions Copyright [yyyy] [name of copyright owner]
  18 #
  19 # CDDL HEADER END
  20 #
  21 
  22 # Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23 
  24 
  25 #
  26 #       This makefile contains the common definitions for all sparc
  27 #       implementation architecture independent modules.
  28 #
  29 
  30 #
  31 #       Define supported builds
  32 #
  33 DEF_BUILDS      = $(DEF_BUILDS64)
  34 ALL_BUILDS      = $(ALL_BUILDS64)
  35 
  36 #
  37 #       Everybody needs to know how to build modstubs.o and to locate unix.o.
  38 #       Note that unix.o must currently be selected from among the possible
  39 #       "implementation architectures". Note further, that unix.o is only
  40 #       used as an optional error check for undefines so (theoretically)
  41 #       any "implementation architectures" could be used. We choose sun4u
  42 #       because it is the reference port.
  43 #
  44 UNIX_DIR         = $(UTSBASE)/sun4u/unix
  45 GENLIB_DIR       = $(UTSBASE)/sun4u/genunix
  46 IPDRV_DIR        = $(UTSBASE)/sparc/ip
  47 MODSTUBS_DIR     = $(UNIX_DIR)
  48 DSF_DIR          = $(UNIX_DIR)
  49 LINTS_DIR        = $(OBJS_DIR)
  50 LINT_LIB_DIR     = $(UTSBASE)/sparc/lint-libs/$(OBJS_DIR)
  51 
  52 UNIX_O           = $(UNIX_DIR)/$(OBJS_DIR)/unix.o
  53 MODSTUBS_O       = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o
  54 GENLIB           = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/libgenunix.so
  55 
  56 LINT_LIB_32      = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/llib-lunix.ln
  57 GEN_LINT_LIB_32  = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/llib-lgenunix.ln
  58 
  59 LINT_LIB_64      = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/llib-lunix.ln
  60 GEN_LINT_LIB_64  = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/llib-lgenunix.ln
  61 
  62 LINT_LIB         = $(LINT_LIB_$(CLASS))
  63 GEN_LINT_LIB     = $(GEN_LINT_LIB_$(CLASS))
  64 
  65 LINT32_DIRS      = $(LINT32_BUILDS:%=$(UTSBASE)/sparc/lint-libs/%)
  66 LINT32_FILES     = $(LINT32_DIRS:%=%/llib-l$(MODULE).ln)
  67 
  68 LINT64_DIRS      = $(LINT64_BUILDS:%=$(UTSBASE)/sparc/lint-libs/%)
  69 LINT64_FILES     = $(LINT64_DIRS:%=%/llib-l$(MODULE).ln)
  70 
  71 #
  72 #       Include the makefiles which define build rule templates, the
  73 #       collection of files per module, and a few specific flags. Note
  74 #       that order is significant, just as with an include path. The
  75 #       first build rule template which matches the files name will be
  76 #       used. By including these in order from most machine dependent
  77 #       to most machine independent, we allow a machine dependent file
  78 #       to be used in preference over a machine independent version
  79 #       (Such as a machine specific optimization, which preserves the
  80 #       interfaces.)
  81 #
  82 include $(UTSBASE)/sparc/Makefile.files
  83 include $(UTSBASE)/sparc/v9/Makefile.files
  84 include $(UTSTREE)/sun/Makefile.files
  85 include $(UTSTREE)/common/Makefile.files
  86 
  87 #
  88 # ----- TRANSITIONAL SECTION --------------------------------------------------
  89 #
  90 
  91 #
  92 #       Not everything which *should* be a module is a module yet. The
  93 #       following is a list of such objects which are currently part of
  94 #       genunix but which might someday become kmods.   This must be
  95 #       defined before we include Makefile.uts, or else genunix's build
  96 #       won't be as parallel as we might like.
  97 #
  98 NOT_YET_KMODS    = $(OLDPTY_OBJS) $(PTY_OBJS) $(VCONS_CONF_OBJS) $(MOD_OBJS)
  99 
 100 #
 101 # ----- END OF TRANSITIONAL SECTION -------------------------------------------
 102 #
 103 #       Include machine independent rules. Note that this does not imply
 104 #       that the resulting module from rules in Makefile.uts is machine
 105 #       independent. Only that the build rules are machine independent.
 106 #
 107 include $(UTSBASE)/Makefile.uts
 108 
 109 #
 110 #       machine specific optimization, override default in Makefile.master
 111 #
 112 XARCH_32        = -xarch=v8
 113 XARCH_64        = -m64
 114 XARCH           = $(XARCH_$(CLASS))
 115 
 116 COPTIMIZE_32    = -xO3
 117 COPTIMIZE_64    = -xO3
 118 COPTIMIZE       = $(COPTIMIZE_$(CLASS))
 119 
 120 CCMODE          = -Xa
 121 
 122 CFLAGS_32       = -xcg92
 123 CFLAGS_64       = -xchip=ultra $(CCABS32) $(CCREGSYM)
 124 CFLAGS          = $(CFLAGS_$(CLASS))
 125 
 126 CFLAGS          += $(XARCH)
 127 CFLAGS          += $(COPTIMIZE)
 128 CFLAGS          += $(EXTRA_CFLAGS)
 129 CFLAGS          += $(XAOPT)
 130 CFLAGS          += $(INLINES) -D_ASM_INLINES
 131 CFLAGS          += $(CCMODE)
 132 CFLAGS          += $(SPACEFLAG)
 133 CFLAGS          += $(CERRWARN)
 134 CFLAGS          += $(CTF_FLAGS)
 135 CFLAGS          += $(C99MODE)
 136 CFLAGS          += $(CCUNBOUND)
 137 CFLAGS          += $(CCSTATICSYM)
 138 CFLAGS          += $(CC32BITCALLERS)
 139 CFLAGS          += $(CCNOAUTOINLINE)
 140 CFLAGS          += $(IROPTFLAG)
 141 CFLAGS          += $(CGLOBALSTATIC)
 142 CFLAGS          += -xregs=no%float
 143 CFLAGS          += -xstrconst
 144 
 145 ASFLAGS         += $(XARCH)
 146 
 147 LINT_DEFS_32    =
 148 LINT_DEFS_64    = -m64
 149 LINT_DEFS       += $(LINT_DEFS_$(CLASS))
 150 
 151 #
 152 #       The following must be defined for all implementations:
 153 #
 154 #       MODSTUBS:       Module stubs source file.
 155 #
 156 MODSTUBS         = $(UTSBASE)/sparc/ml/modstubs.s
 157 
 158 #
 159 #       Define the actual specific platforms - obviously none.
 160 #
 161 MACHINE_DEFS     =
 162 
 163 #
 164 #       Debugging level
 165 #
 166 #       Special knowledge of which special debugging options effect which
 167 #       file is used to optimize the build if these flags are changed.
 168 #
 169 #       XXX: The above could possibly be done for more flags and files, but
 170 #            is left as an experiment to the interested reader. Be forewarned,
 171 #            that excessive use could lead to maintenance difficulties.
 172 #
 173 DEBUG_DEFS_OBJ32        =
 174 DEBUG_DEFS_DBG32        = -DDEBUG
 175 DEBUG_DEFS_OBJ64        =
 176 DEBUG_DEFS_DBG64        = -DDEBUG
 177 DEBUG_DEFS              = $(DEBUG_DEFS_$(BUILD_TYPE))
 178 
 179 DEBUG_COND_OBJ32        :sh = echo \\043
 180 DEBUG_COND_DBG32        =
 181 DEBUG_COND_OBJ64        :sh = echo \\043
 182 DEBUG_COND_DBG64        =
 183 IF_DEBUG_OBJ            = $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/
 184 
 185 $(IF_DEBUG_OBJ)syscall.o        :=      DEBUG_DEFS      += -DSYSCALLTRACE
 186 $(IF_DEBUG_OBJ)clock.o          :=      DEBUG_DEFS      += -DKSLICE=1
 187 
 188 # Comment these out if you don't want dispatcher lock statistics.
 189 
 190 # $(IF_DEBUG_OBJ)disp_lock.o    := DEBUG_DEFS   += -DDISP_LOCK_STATS
 191 
 192 #
 193 #       Collect the preprocessor definitions to be associated with *all*
 194 #       files.
 195 #
 196 ALL_DEFS         = $(MACHINE_DEFS) $(DEBUG_DEFS) $(OPTION_DEFS)
 197 #
 198 #
 199 #       The kernels modules which are "implementation architecture"
 200 #       specific for this machine are enumerated below. Note that most
 201 #       of these modules must exist (in one form or another) for each
 202 #       architecture.
 203 #
 204 #       Common Drivers (usually pseudo drivers) (/kernel/drv):
 205 #
 206 DRV_KMODS       += aggr arp audio bl blkdev bofi clone cn conskbd consms cpuid
 207 DRV_KMODS       += crypto cryptoadm devinfo dump
 208 DRV_KMODS       += dtrace fasttrap fbt lockstat profile sdt systrace dcpc
 209 DRV_KMODS       += fssnap icmp icmp6 ip ip6 ipnet ipsecah
 210 DRV_KMODS       += ipsecesp iptun iwscn keysock kmdb kstat ksyms llc1
 211 DRV_KMODS       += lofi
 212 DRV_KMODS       += log logindmux kssl mm nca physmem pm poll pool
 213 DRV_KMODS       += pseudo ptc ptm pts ptsl ramdisk random rsm rts sad
 214 DRV_KMODS       += simnet softmac sppp sppptun sy sysevent sysmsg 
 215 DRV_KMODS       += spdsock
 216 DRV_KMODS       += tcp tcp6 tl tnf ttymux udp udp6 wc winlock zcons
 217 DRV_KMODS       += ippctl
 218 DRV_KMODS       += dld
 219 DRV_KMODS       += ipf
 220 DRV_KMODS       += rpcib
 221 DRV_KMODS       += dlpistub
 222 DRV_KMODS       += vnic
 223 DRV_KMODS       += xge
 224 DRV_KMODS       += rds
 225 DRV_KMODS       += rdsv3
 226 DRV_KMODS       += chxge
 227 DRV_KMODS       += smbsrv
 228 DRV_KMODS       += vscan
 229 DRV_KMODS       += nsmb
 230 DRV_KMODS       += fm
 231 DRV_KMODS       += nulldriver
 232 DRV_KMODS       += bridge trill
 233 DRV_KMODS       += bpf
 234 DRV_KMODS       += dca
 235 
 236 $(CLOSED_BUILD)CLOSED_DRV_KMODS += glm
 237 $(CLOSED_BUILD)CLOSED_DRV_KMODS += isp
 238 $(CLOSED_BUILD)CLOSED_DRV_KMODS += mpt
 239 $(CLOSED_BUILD)CLOSED_DRV_KMODS += qus
 240 $(CLOSED_BUILD)CLOSED_DRV_KMODS += se
 241 
 242 #
 243 #       Hardware Drivers in common space
 244 #
 245 
 246 DRV_KMODS       += afe
 247 DRV_KMODS       += audio1575
 248 DRV_KMODS       += audioens
 249 DRV_KMODS       += audiols
 250 DRV_KMODS       += audiop16x
 251 DRV_KMODS       += audiopci
 252 DRV_KMODS       += audiots
 253 DRV_KMODS       += e1000g
 254 DRV_KMODS       += efe
 255 DRV_KMODS       += hxge
 256 DRV_KMODS       += mxfe
 257 DRV_KMODS       += pcan
 258 DRV_KMODS       += pcwl
 259 DRV_KMODS       += rge
 260 DRV_KMODS       += rtls
 261 DRV_KMODS       += sfe
 262 DRV_KMODS       += aac
 263 DRV_KMODS       += igb
 264 DRV_KMODS       += ixgbe
 265 DRV_KMODS       += vr
 266 DRV_KMODS       += mr_sas
 267 $(CLOSED_BUILD)CLOSED_DRV_KMODS += ixgb
 268 DRV_KMODS       += yge
 269 
 270 #
 271 #       Machine Specific Driver Modules (/kernel/drv):
 272 #
 273 DRV_KMODS       += audiocs
 274 DRV_KMODS       += bge dmfe eri fas hme qfe
 275 DRV_KMODS       += openeepr options sd ses st
 276 DRV_KMODS       += ssd
 277 DRV_KMODS       += ecpp
 278 DRV_KMODS       += hid hubd ehci ohci uhci usb_mid usb_ia scsa2usb usbprn ugen
 279 DRV_KMODS       += usbser usbsacm usbsksp usbsprl
 280 DRV_KMODS       += usb_as usb_ac
 281 DRV_KMODS       += usbskel
 282 DRV_KMODS       += usbvc
 283 DRV_KMODS       += usbftdi
 284 DRV_KMODS       += wusb_df hwahc hwarc wusb_ca
 285 DRV_KMODS       += usbecm
 286 DRV_KMODS       += hci1394 av1394 scsa1394 dcam1394
 287 DRV_KMODS       += sbp2
 288 DRV_KMODS       += ib ibp eibnx eoib rdsib sdp iser daplt hermon tavor sol_ucma sol_uverbs
 289 DRV_KMODS       += sol_umad
 290 DRV_KMODS       += pci_pci pcieb pcieb_bcm
 291 DRV_KMODS       += i8042 kb8042 mouse8042
 292 DRV_KMODS       += fcode
 293 DRV_KMODS       += mpt_sas
 294 DRV_KMODS       += socal
 295 DRV_KMODS       += sgen
 296 DRV_KMODS       += myri10ge
 297 DRV_KMODS       += smp
 298 DRV_KMODS       += dad
 299 DRV_KMODS       += scsi_vhci
 300 DRV_KMODS       += fcp
 301 DRV_KMODS       += fcip
 302 DRV_KMODS       += fcsm
 303 DRV_KMODS       += fp
 304 DRV_KMODS       += qlc
 305 DRV_KMODS       += qlge
 306 DRV_KMODS       += stmf
 307 DRV_KMODS       += stmf_sbd
 308 DRV_KMODS       += fct
 309 DRV_KMODS       += fcoe
 310 DRV_KMODS       += fcoet
 311 DRV_KMODS       += fcoei
 312 DRV_KMODS       += qlt
 313 DRV_KMODS       += iscsit
 314 DRV_KMODS       += pppt
 315 DRV_KMODS       += ncall nsctl sdbc nskern sv
 316 DRV_KMODS       += ii rdc rdcsrv rdcstub 
 317 DRV_KMODS       += iscsi
 318 DRV_KMODS       += emlxs
 319 DRV_KMODS       += oce
 320 DRV_KMODS       += srpt
 321 DRV_KMODS       += pmcs
 322 DRV_KMODS       += pmcs8001fw
 323 
 324 $(CLOSED_BUILD)CLOSED_DRV_KMODS += ifp
 325 $(CLOSED_BUILD)CLOSED_DRV_KMODS += uata
 326 $(CLOSED_BUILD)CLOSED_DRV_KMODS += usbser_edge
 327 
 328 #
 329 #       I/O framework test drivers
 330 #
 331 DRV_KMODS       += pshot
 332 DRV_KMODS       += gen_drv
 333 DRV_KMODS       += tvhci tphci tclient
 334 DRV_KMODS       += emul64
 335 
 336 #
 337 # PCMCIA specific module(s)
 338 #
 339 DRV_KMODS       += pcs
 340 MISC_KMODS      += busra cardbus dada pcmcia
 341 DRV_KMODS       += pcata
 342 DRV_KMODS       += pcic
 343 
 344 $(CLOSED_BUILD)CLOSED_DRV_KMODS += pcser
 345 
 346 # Add lvm
 347 #
 348 DRV_KMODS       += md
 349 MISC_KMODS      += md_mirror md_stripe md_hotspares md_raid md_trans md_notify
 350 MISC_KMODS      += md_sp
 351 
 352 #
 353 #       Exec Class Modules (/kernel/exec):
 354 #
 355 EXEC_KMODS      += aoutexec elfexec intpexec shbinexec javaexec
 356 
 357 #
 358 #       Scheduling Class Modules (/kernel/sched):
 359 #
 360 SCHED_KMODS     += RT TS RT_DPTBL TS_DPTBL IA FSS FX FX_DPTBL SDC
 361 
 362 #
 363 #       File System Modules (/kernel/fs):
 364 #
 365 FS_KMODS        += dev devfs fdfs fifofs hsfs lofs namefs nfs pcfs tmpfs zfs
 366 FS_KMODS        += zut specfs udfs ufs autofs cachefs procfs sockfs mntfs
 367 FS_KMODS        += ctfs objfs sharefs dcfs smbfs
 368 
 369 #
 370 #       Streams Modules (/kernel/strmod):
 371 #
 372 STRMOD_KMODS    += bufmod connld dedump ldterm ms pckt pfmod
 373 STRMOD_KMODS    += pipemod ptem redirmod rpcmod rlmod telmod timod
 374 STRMOD_KMODS    += spppasyn spppcomp
 375 STRMOD_KMODS    += tirdwr ttcompat
 376 STRMOD_KMODS    += usbkbm usbms usbwcm usb_ah
 377 STRMOD_KMODS    += drcompat
 378 STRMOD_KMODS    += cryptmod
 379 STRMOD_KMODS    += vuid3ps2
 380 
 381 #
 382 #       'System' Modules (/kernel/sys):
 383 #
 384 SYS_KMODS       += c2audit
 385 SYS_KMODS       += exacctsys
 386 SYS_KMODS       += inst_sync kaio msgsys semsys shmsys sysacct pipe
 387 SYS_KMODS       += doorfs pset acctctl portfs
 388 
 389 #
 390 #       'User' Modules (/kernel/misc):
 391 #
 392 MISC_KMODS      += ac97
 393 MISC_KMODS      += bignum
 394 MISC_KMODS      += consconfig gld ipc nfs_dlboot nfssrv scsi
 395 MISC_KMODS      += strplumb swapgeneric tlimod
 396 MISC_KMODS      += rpcsec rpcsec_gss kgssapi kmech_dummy
 397 MISC_KMODS      += kmech_krb5
 398 MISC_KMODS      += fssnap_if
 399 MISC_KMODS      += hidparser kbtrans usba usba10 usbs49_fw
 400 MISC_KMODS      += s1394
 401 MISC_KMODS      += hpcsvc pcihp
 402 MISC_KMODS      += rsmops
 403 MISC_KMODS      += kcf
 404 MISC_KMODS      += ksocket
 405 MISC_KMODS      += ibcm
 406 MISC_KMODS      += ibdm
 407 MISC_KMODS      += ibdma
 408 MISC_KMODS      += ibmf
 409 MISC_KMODS      += ibtl
 410 MISC_KMODS      += sol_ofs
 411 MISC_KMODS      += idm
 412 MISC_KMODS      += idmap
 413 MISC_KMODS      += hook
 414 MISC_KMODS      += neti
 415 MISC_KMODS      += ctf 
 416 MISC_KMODS      += mac dls
 417 MISC_KMODS      += cmlb
 418 MISC_KMODS      += tem
 419 MISC_KMODS      += pcicfg fcodem fcpci
 420 MISC_KMODS      += scsi_vhci_f_sym scsi_vhci_f_tpgs scsi_vhci_f_asym_sun
 421 MISC_KMODS      += scsi_vhci_f_sym_hds
 422 MISC_KMODS      += scsi_vhci_f_tape scsi_vhci_f_tpgs_tape
 423 MISC_KMODS      += fctl
 424 MISC_KMODS      += emlxs_fw
 425 MISC_KMODS      += qlc_fw_2200
 426 MISC_KMODS      += qlc_fw_2300
 427 MISC_KMODS      += qlc_fw_2400
 428 MISC_KMODS      += qlc_fw_2500
 429 MISC_KMODS      += qlc_fw_6322
 430 MISC_KMODS      += qlc_fw_8100
 431 MISC_KMODS      += spuni
 432 MISC_KMODS      += hwa1480_fw uwba
 433 MISC_KMODS      += mii
 434 
 435 $(CLOSED_BUILD)CLOSED_MISC_KMODS        += klmmod klmops
 436 $(CLOSED_BUILD)CLOSED_MISC_KMODS        += scsi_vhci_f_asym_lsi
 437 $(CLOSED_BUILD)CLOSED_MISC_KMODS        += scsi_vhci_f_asym_emc
 438 $(CLOSED_BUILD)CLOSED_MISC_KMODS        += scsi_vhci_f_sym_emc
 439 
 440 #
 441 #       Software Cryptographic Providers (/kernel/crypto):
 442 #
 443 CRYPTO_KMODS    += aes
 444 CRYPTO_KMODS    += arcfour
 445 CRYPTO_KMODS    += blowfish
 446 CRYPTO_KMODS    += des
 447 CRYPTO_KMODS    += md4
 448 CRYPTO_KMODS    += md5
 449 CRYPTO_KMODS    += ecc
 450 CRYPTO_KMODS    += rsa
 451 CRYPTO_KMODS    += sha1
 452 CRYPTO_KMODS    += sha2
 453 CRYPTO_KMODS    += swrand
 454 
 455 #
 456 # IP Policy Modules (/kernel/ipp):
 457 #
 458 IPP_KMODS       += dlcosmk
 459 IPP_KMODS       += flowacct
 460 IPP_KMODS       += ipgpc
 461 IPP_KMODS       += dscpmk
 462 IPP_KMODS       += tokenmt
 463 IPP_KMODS       += tswtclmt
 464 
 465 #
 466 # 'Dacf' modules (/kernel/dacf)
 467 DACF_KMODS      += consconfig_dacf
 468 
 469 #
 470 #       SVVS Testing Modules (/kernel/strmod):
 471 #
 472 #       These are streams and driver modules which are not to be
 473 #       delivered with a released system. However, during development
 474 #       it is convenient to build and install the SVVS kernel modules.
 475 #
 476 SVVS_KMODS      += lmodb lmode lmodr lmodt svvslo tidg tivc tmux
 477 
 478 $(CLOSED_BUILD)SVVS             += svvs
 479 
 480 #
 481 #       Modules eXcluded from the product:
 482 #
 483 XMODS           +=
 484 $(CLOSED_BUILD)CLOSED_XMODS =           \
 485         sdpib           \
 486         wsdrv
 487 
 488 #
 489 #       'Dacf' Modules (/kernel/dacf):
 490 #
 491 DACF_KMODS      += net_dacf
 492 
 493 #
 494 #       MAC-Type Plugin Modules (/kernel/mac)
 495 #
 496 MAC_KMODS       += mac_6to4
 497 MAC_KMODS       += mac_ether
 498 MAC_KMODS       += mac_ipv4
 499 MAC_KMODS       += mac_ipv6
 500 MAC_KMODS       += mac_wifi
 501 MAC_KMODS       += mac_ib
 502 
 503 #
 504 # socketmod (kernel/socketmod)
 505 #
 506 SOCKET_KMODS    += sockpfp
 507 SOCKET_KMODS    += socksctp
 508 SOCKET_KMODS    += socksdp
 509 SOCKET_KMODS    += sockrds
 510 SOCKET_KMODS    += ksslf
 511 
 512 #
 513 #       kiconv modules (/kernel/kiconv):
 514 #
 515 KICONV_KMODS    += kiconv_emea kiconv_ja kiconv_ko kiconv_sc kiconv_tc