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