1 0 stevel # 2 0 stevel # CDDL HEADER START 3 0 stevel # 4 0 stevel # The contents of this file are subject to the terms of the 5 580 wesolows # Common Development and Distribution License (the "License"). 6 580 wesolows # You may not use this file except in compliance with the License. 7 0 stevel # 8 0 stevel # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 0 stevel # or http://www.opensolaris.org/os/licensing. 10 0 stevel # See the License for the specific language governing permissions 11 0 stevel # and limitations under the License. 12 0 stevel # 13 0 stevel # When distributing Covered Code, include this CDDL HEADER in each 14 0 stevel # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 0 stevel # If applicable, add the following below this CDDL HEADER, with the 16 0 stevel # fields enclosed by brackets "[]" replaced with your own identifying 17 0 stevel # information: Portions Copyright [yyyy] [name of copyright owner] 18 0 stevel # 19 0 stevel # CDDL HEADER END 20 0 stevel # 21 580 wesolows 22 0 stevel # 23 8654 Bill # Copyright 2009 Sun Microsystems, Inc. All rights reserved. 24 0 stevel # Use is subject to license terms. 25 580 wesolows # 26 580 wesolows 27 0 stevel # 28 0 stevel # This Makefile contains the common targets and definitions for 29 0 stevel # all kernels. It is to be included in the Makefiles for specific 30 0 stevel # implementation architectures and processor architecture dependent 31 0 stevel # modules: i.e.: all driving kernel Makefiles. 32 0 stevel # 33 0 stevel # Include global definitions: 34 0 stevel # 35 0 stevel include $(SRC)/Makefile.master 36 0 stevel 37 0 stevel # 38 0 stevel # No text domain in the kernel. 39 0 stevel # 40 0 stevel DTEXTDOM = 41 0 stevel 42 0 stevel # 43 0 stevel # Keep references to $(SRC)/common relative. 44 0 stevel COMMONBASE= $(UTSBASE)/../common 45 0 stevel 46 0 stevel # 47 0 stevel # Setup build-specific vars 48 0 stevel # To add a build type: 49 0 stevel # add name to ALL_BUILDS32 & ALL_BUILDS64 50 0 stevel # set CLASS_name and OBJ_DIR_name 51 0 stevel # add targets to Makefile.targ 52 0 stevel # 53 0 stevel 54 0 stevel # 55 3678 yz155240 # DEF_BUILDS is for def, lint, sischeck, and install 56 0 stevel # ALL_BUILDS is for everything else (all, clean, ...) 57 0 stevel # 58 0 stevel # The NOT_RELEASE_BUILD noise is to maintain compatibility with the 59 0 stevel # gatekeeper's nightly build script. 60 0 stevel # 61 0 stevel DEF_BUILDS32 = obj32 62 0 stevel DEF_BUILDS64 = obj64 63 0 stevel DEF_BUILDSONLY64 = obj64 64 0 stevel $(NOT_RELEASE_BUILD)DEF_BUILDS32 = debug32 65 0 stevel $(NOT_RELEASE_BUILD)DEF_BUILDS64 = debug64 66 0 stevel $(NOT_RELEASE_BUILD)DEF_BUILDSONLY64 = debug64 67 0 stevel ALL_BUILDS32 = obj32 debug32 68 0 stevel ALL_BUILDS64 = obj64 debug64 69 0 stevel ALL_BUILDSONLY64 = obj64 debug64 70 0 stevel 71 0 stevel # 72 0 stevel # For modules in 64b dirs that aren't built 64b 73 0 stevel # or modules in 64b dirs that aren't built 32b we 74 0 stevel # need to create empty modlintlib files so global lint works 75 0 stevel # 76 0 stevel LINT32_BUILDS = debug32 77 0 stevel LINT64_BUILDS = debug64 78 0 stevel 79 0 stevel # 80 0 stevel # Build class (32b or 64b) 81 0 stevel # 82 0 stevel CLASS_OBJ32 = 32 83 0 stevel CLASS_DBG32 = 32 84 0 stevel CLASS_OBJ64 = 64 85 0 stevel CLASS_DBG64 = 64 86 0 stevel CLASS = $(CLASS_$(BUILD_TYPE)) 87 0 stevel 88 0 stevel # 89 0 stevel # Build subdirectory 90 0 stevel # 91 0 stevel OBJS_DIR_OBJ32 = obj32 92 0 stevel OBJS_DIR_DBG32 = debug32 93 0 stevel OBJS_DIR_OBJ64 = obj64 94 0 stevel OBJS_DIR_DBG64 = debug64 95 0 stevel OBJS_DIR = $(OBJS_DIR_$(BUILD_TYPE)) 96 0 stevel 97 0 stevel # 98 0 stevel # Create defaults so empty rules don't 99 0 stevel # confuse make 100 0 stevel # 101 0 stevel CLASS_ = 32 102 0 stevel OBJS_DIR_ = debug32 103 0 stevel 104 0 stevel # 105 0 stevel # Build tools 106 0 stevel # 107 0 stevel CC_sparc_32 = $(sparc_CC) 108 0 stevel CC_sparc_64 = $(sparcv9_CC) 109 0 stevel 110 0 stevel CC_i386_32 = $(i386_CC) 111 0 stevel CC_i386_64 = $(amd64_CC) 112 0 stevel CC_amd64_64 = $(amd64_CC) 113 0 stevel 114 0 stevel CC = $(CC_$(MACH)_$(CLASS)) 115 0 stevel 116 0 stevel AS_sparc_32 = $(sparc_AS) 117 0 stevel AS_sparc_64 = $(sparcv9_AS) 118 0 stevel 119 0 stevel AS_i386_32 = $(i386_AS) 120 0 stevel AS_i386_64 = $(amd64_AS) 121 0 stevel AS_amd64_64 = $(amd64_AS) 122 0 stevel 123 0 stevel AS = $(AS_$(MACH)_$(CLASS)) 124 0 stevel 125 0 stevel LD_sparc_32 = $(sparc_LD) 126 0 stevel LD_sparc_64 = $(sparcv9_LD) 127 0 stevel 128 0 stevel LD_i386_32 = $(i386_LD) 129 0 stevel LD_i386_64 = $(amd64_LD) 130 0 stevel LD_amd64_64 = $(amd64_LD) 131 0 stevel 132 0 stevel LD = $(LD_$(MACH)_$(CLASS)) 133 0 stevel 134 0 stevel LINT_sparc_32 = $(sparc_LINT) 135 0 stevel LINT_sparc_64 = $(sparcv9_LINT) 136 0 stevel 137 0 stevel LINT_i386_32 = $(i386_LINT) 138 0 stevel LINT_i386_64 = $(amd64_LINT) 139 0 stevel LINT_amd64_64 = $(amd64_LINT) 140 0 stevel 141 0 stevel LINT = $(LINT_$(MACH)_$(CLASS)) 142 0 stevel 143 0 stevel MODEL_32 = ilp32 144 0 stevel MODEL_64 = lp64 145 0 stevel MODEL = $(MODEL_$(CLASS)) 146 0 stevel 147 0 stevel # 148 0 stevel # Build rules for linting the kernel. 149 0 stevel # 150 8654 Bill LHEAD = $(ECHO) "\n$@"; 151 0 stevel 152 1026 carlsonj # Note: egrep returns "failure" if there are no matches, which is 153 1026 carlsonj # exactly the opposite of what we need. 154 1026 carlsonj LGREP.2 = if egrep -v ' (_init|_fini|_info|_depends_on) '; then false; else true; fi 155 0 stevel 156 8654 Bill LTAIL = 157 0 stevel 158 0 stevel LINT.c = $(LINT) -c -dirout=$(LINTS_DIR) $(LINTFLAGS) $(LINT_DEFS) $(CPPFLAGS) 159 0 stevel 160 2840 carlsonj # Please do not add new erroff directives here. If you need to disable 161 2840 carlsonj # lint warnings in your module for things that cannot be fixed in any 162 2840 carlsonj # reasonable manner, please augment LINTTAGS in your module Makefile 163 2840 carlsonj # instead. 164 7632 Nick LINTTAGS = -erroff=E_INCONS_ARG_DECL2 165 7632 Nick LINTTAGS += -erroff=E_INCONS_VAL_TYPE_DECL2 166 0 stevel 167 0 stevel LINTFLAGS_sparc_32 = $(LINTCCMODE) -nsxmuF -errtags=yes 168 7684 Nick LINTFLAGS_sparc_64 = $(LINTFLAGS_sparc_32) -m64 169 0 stevel LINTFLAGS_i386_32 = $(LINTCCMODE) -nsxmuF -errtags=yes 170 7684 Nick LINTFLAGS_i386_64 = $(LINTFLAGS_i386_32) -m64 171 0 stevel 172 2840 carlsonj LINTFLAGS = $(LINTFLAGS_$(MACH)_$(CLASS)) $(LINTTAGS) 173 0 stevel LINTFLAGS += $(C99LMODE) 174 0 stevel 175 0 stevel # 176 0 stevel # Override this variable to modify the name of the lint target. 177 0 stevel # 178 0 stevel LINT_MODULE= $(MODULE) 179 0 stevel 180 0 stevel # 181 0 stevel # Build the compile/assemble lines: 182 0 stevel # 183 0 stevel EXTRA_OPTIONS = 184 0 stevel AS_DEFS = -D_ASM -D__STDC__=0 185 0 stevel 186 1106 mrj ALWAYS_DEFS_32 = -D_KERNEL -D_SYSCALL32 -D_DDI_STRICT 187 1106 mrj ALWAYS_DEFS_64 = -D_KERNEL -D_SYSCALL32 -D_SYSCALL32_IMPL -D_ELF64 \ 188 1106 mrj -D_DDI_STRICT 189 0 stevel # 190 0 stevel # XX64 This should be defined by the compiler! 191 0 stevel # 192 0 stevel ALWAYS_DEFS_64 += -Dsun -D__sun -D__SVR4 193 0 stevel ALWAYS_DEFS = $(ALWAYS_DEFS_$(CLASS)) 194 0 stevel 195 0 stevel # 196 0 stevel # CPPFLAGS is deliberatly set with a "=" and not a "+=". For the kernel 197 0 stevel # the header include path should not look for header files outside of 198 0 stevel # the kernel code. This "=" removes the search path built in 199 0 stevel # Makefile.master inside CPPFLAGS. Ditto for AS_CPPFLAGS. 200 0 stevel # 201 0 stevel CPPFLAGS = $(ALWAYS_DEFS) $(ALL_DEFS) $(CONFIG_DEFS) \ 202 0 stevel $(INCLUDE_PATH) $(EXTRA_OPTIONS) 203 0 stevel ASFLAGS += -P 204 0 stevel AS_CPPFLAGS = $(ALWAYS_DEFS) $(ALL_DEFS) $(CONFIG_DEFS) $(AS_DEFS) \ 205 0 stevel $(AS_INC_PATH) $(EXTRA_OPTIONS) 206 0 stevel 207 0 stevel # 208 0 stevel # Make it (relatively) easy to share compilation options between 209 0 stevel # all kernel implementations. 210 0 stevel # 211 0 stevel 212 1027 robinson # Override the default, the kernel is squeaky clean 213 1027 robinson CERRWARN = -errtags=yes -errwarn=%all 214 1027 robinson 215 3446 mrj C99MODE = $(C99_ENABLE) 216 3446 mrj 217 0 stevel CFLAGS_uts = 218 0 stevel CFLAGS_uts += $(STAND_FLAGS_$(CLASS)) 219 0 stevel CFLAGS_uts += $(CCVERBOSE) 220 0 stevel CFLAGS_uts += $(ILDOFF) 221 0 stevel CFLAGS_uts += $(XAOPT) 222 0 stevel CFLAGS_uts += $(CTF_FLAGS) 223 0 stevel CFLAGS_uts += $(CERRWARN) 224 2538 esaxe CFLAGS_uts += $(CGLOBALSTATIC) 225 0 stevel CFLAGS_uts += $(EXTRA_CFLAGS) 226 0 stevel 227 0 stevel # 228 0 stevel # Declare that $(OBJECTS) and $(LINTS) can be compiled in parallel. 229 0 stevel # The DUMMY target is for those instances where OBJECTS and LINTS 230 0 stevel # are empty (to avoid an unconditional .PARALLEL). 231 0 stevel .PARALLEL: $(OBJECTS) $(LINTS) DUMMY 232 0 stevel 233 0 stevel # 234 0 stevel # Expanded dependencies 235 0 stevel # 236 0 stevel DEF_DEPS = $(DEF_BUILDS:%=def.%) 237 0 stevel ALL_DEPS = $(ALL_BUILDS:%=all.%) 238 0 stevel CLEAN_DEPS = $(ALL_BUILDS:%=clean.%) 239 0 stevel CLOBBER_DEPS = $(ALL_BUILDS:%=clobber.%) 240 0 stevel LINT_DEPS = $(DEF_BUILDS:%=lint.%) 241 0 stevel MODLINTLIB_DEPS = $(DEF_BUILDS:%=modlintlib.%) 242 1167 kupfer MODLIST_DEPS = $(DEF_BUILDS:%=modlist.%) 243 0 stevel CLEAN_LINT_DEPS = $(ALL_BUILDS:%=clean.lint.%) 244 0 stevel INSTALL_DEPS = $(DEF_BUILDS:%=install.%) 245 0 stevel SYM_DEPS = $(SYM_BUILDS:%=symcheck.%) 246 3678 yz155240 SISCHECK_DEPS = $(DEF_BUILDS:%=sischeck.%) 247 3678 yz155240 SISCLEAN_DEPS = $(ALL_BUILDS:%=sisclean.%) 248 0 stevel 249 0 stevel # 250 0 stevel # Default module name 251 0 stevel # 252 0 stevel BINARY = $(OBJS_DIR)/$(MODULE) 253 0 stevel 254 0 stevel # 255 0 stevel # Default cleanup definitions 256 0 stevel # 257 0 stevel CLEANLINTFILES = $(LINTS) $(MOD_LINT_LIB) 258 0 stevel CLEANFILES = $(OBJECTS) $(CLEANLINTFILES) 259 0 stevel CLOBBERFILES = $(BINARY) $(CLEANFILES) 260 0 stevel 261 0 stevel # 262 0 stevel # Installation constants: 263 0 stevel # 264 0 stevel # FILEMODE is the mode given to the kernel modules 265 0 stevel # CFILEMODE is the mode given to the '.conf' files 266 0 stevel # 267 0 stevel FILEMODE = 755 268 0 stevel DIRMODE = 755 269 0 stevel CFILEMODE = 644 270 0 stevel 271 0 stevel # 272 0 stevel # Special Installation Macros for the installation of '.conf' files. 273 0 stevel # 274 0 stevel # These are unique because they are not installed from the current 275 0 stevel # working directory. 276 0 stevel # 277 0 stevel # Sigh. Apparently at some time in the past there was a confusion on 278 0 stevel # whether the name is SRC_CONFFILE or SRC_CONFILE. Consistency with the 279 0 stevel # other names would indicate SRC_CONFFILE, but the voting is >180 Makefiles 280 0 stevel # with SRC_CONFILE and about 11 with SRC_CONFFILE. Software development 281 0 stevel # isn't a popularity contest, though, and so my inclination is to define 282 0 stevel # both names for now and incrementally convert to SRC_CONFFILE to be consistent 283 0 stevel # with the other names. 284 0 stevel # 285 0 stevel CONFFILE = $(MODULE).conf 286 0 stevel SRC_CONFFILE = $(CONF_SRCDIR)/$(CONFFILE) 287 0 stevel SRC_CONFILE = $(SRC_CONFFILE) 288 0 stevel ROOT_CONFFILE_32 = $(ROOTMODULE).conf 289 0 stevel ROOT_CONFFILE_64 = $(ROOTMODULE:%/$(SUBDIR64)/$(MODULE)=%/$(MODULE)).conf 290 0 stevel ROOT_CONFFILE = $(ROOT_CONFFILE_$(CLASS)) 291 0 stevel 292 0 stevel 293 0 stevel INS.conffile= \ 294 0 stevel $(RM) $@; $(INS) -s -m $(CFILEMODE) -f $(@D) $(SRC_CONFFILE) 295 0 stevel 296 0 stevel # 297 0 stevel # The CTF merge of child kernel modules is performed against one of the genunix 298 0 stevel # modules. For Intel builds, all modules will be used with a single genunix: 299 0 stevel # the one built in intel/genunix. For SPARC builds, a given 300 0 stevel # module may be 301 0 stevel # used with one of a number of genunix files, depending on what platform the 302 0 stevel # module is deployed on. We merge against the sun4u genunix to optimize for 303 0 stevel # the common case. We also merge against the ip driver since networking is 304 0 stevel # typically loaded and types defined therein are shared between many modules. 305 0 stevel # 306 0 stevel CTFMERGE_GUDIR_sparc = sun4u 307 0 stevel CTFMERGE_GUDIR_i386 = intel 308 0 stevel CTFMERGE_GUDIR = $(CTFMERGE_GUDIR_$(MACH)) 309 0 stevel 310 0 stevel CTFMERGE_GENUNIX = \ 311 0 stevel $(UTSBASE)/$(CTFMERGE_GUDIR)/genunix/$(OBJS_DIR)/genunix 312 0 stevel 313 0 stevel # 314 0 stevel # Used to uniquify a non-genunix module against genunix. If used in patch 315 0 stevel # mode (PATCH_BUILD != "#"), the patch ID corresponding to the module being 316 0 stevel # built will be used as the label. If no ID is available, or if patch mode 317 0 stevel # is not being used, the value of $VERSION will be used. 318 0 stevel # 319 10613 Jonathan # For the ease of developers dropping modules onto possibly unrelated systems, 320 10613 Jonathan # you can set NO_GENUNIX_MERGE= in the environment to skip uniquifying against 321 10613 Jonathan # genunix. 322 10613 Jonathan # 323 10613 Jonathan NO_GENUNIX_UNIQUIFY=$(POUND_SIGN) 324 10613 Jonathan SKIP_GENUNIX_UNIQUIFY=no 325 10613 Jonathan $(NO_GENUNIX_UNIQUIFY)SKIP_GENUNIX_UNIQUIFY=yes 326 10613 Jonathan 327 0 stevel CTFMERGE_UNIQUIFY_AGAINST_GENUNIX = \ 328 0 stevel @label="-L VERSION" ; \ 329 10613 Jonathan uniq= ; \ 330 0 stevel if [ -z "$(PATCH_BUILD)" ] ; then \ 331 0 stevel uniq="-D BASE" ; \ 332 0 stevel set -- `$(CTFFINDMOD) -n -r -t $(PMTMO_FILE) $@` ; \ 333 0 stevel if [ "X$$1" != "X-" ] ; then \ 334 0 stevel label="-l $$1" ; \ 335 0 stevel if [ "$$2" != "fcs" ] ; then \ 336 0 stevel uniq="-D $$2" ; \ 337 0 stevel fi ; \ 338 0 stevel fi ; \ 339 0 stevel fi ; \ 340 10613 Jonathan if [ "$(SKIP_GENUNIX_UNIQUIFY)" = "yes" ]; then \ 341 10613 Jonathan uniq= ; \ 342 10613 Jonathan else \ 343 10613 Jonathan uniq="-d $(CTFMERGE_GENUNIX) $$uniq" ; \ 344 10613 Jonathan fi ; \ 345 10613 Jonathan cmd="$(CTFMERGE) $(CTFMRGFLAGS) $$label $$uniq" ; \ 346 10613 Jonathan cmd="$$cmd -o $@ $(OBJECTS) $(CTFEXTRAOBJS)" ; \ 347 10613 Jonathan echo $$cmd ; \ 348 10613 Jonathan $$cmd 349 0 stevel 350 0 stevel # 351 0 stevel # Used to merge the genunix module. genunix has special requirements in 352 0 stevel # patch mode. In particular, it needs to be able to find the genunix used 353 0 stevel # in the previous version of the KU patch (or the FCS version of genunix in 354 0 stevel # the case of KU 1). 355 0 stevel # 356 0 stevel CTFMERGE_GENUNIX_MERGE = \ 357 0 stevel @if [ -z "$(PATCH_BUILD)" ] ; then \ 358 0 stevel set -- `$(CTFFINDMOD) -b $(OBJS_DIR) -o patch,lastgu -n -r \ 359 0 stevel -t $(PMTMO_FILE) $(GENUNIX) || true` '' ; \ 360 0 stevel msg= ; \ 361 0 stevel if [ $$$(POUND_SIGN) -eq 1 ] ; \ 362 0 stevel then msg="Error in $(CTFFINDMOD)" ; \ 363 0 stevel elif [ "X$$1" = "X-" ] ; then msg="Did not get label" ; \ 364 0 stevel elif [ "X$$2" = "X-" ] ; then msg="Did not get withfile" ; \ 365 0 stevel fi ; \ 366 0 stevel if [ -n "$$msg" ] ; then \ 367 0 stevel echo "make ctf: $$msg - removing $(GENUNIX)" ; \ 368 0 stevel $(RM) $(GENUNIX) ; \ 369 0 stevel exit 1 ; \ 370 0 stevel fi ; \ 371 0 stevel label="-l $$1" ; \ 372 0 stevel with="-w $$2" ; \ 373 0 stevel else \ 374 0 stevel label="-L VERSION" ; \ 375 0 stevel fi ; \ 376 0 stevel cmd="$(CTFMERGE) $(CTFMRGFLAGS) $$label $$with -o $@" ; \ 377 0 stevel echo $$cmd "$(OBJECTS) $(CTFEXTRAOBJS) $(IPCTF_TARGET)"; \ 378 0 stevel $$cmd $(OBJECTS) $(CTFEXTRAOBJS) $(IPCTF_TARGET) 379 0 stevel 380 0 stevel # 381 0 stevel # We ctfmerge the ip objects into genunix to maximize the number of common types 382 0 stevel # found there, thus maximizing the effectiveness of uniquification. We don't 383 0 stevel # want the genunix build to have to know about the individual ip objects, so we 384 0 stevel # put them in an archive. The genunix ctfmerge then includes this archive. 385 0 stevel # 386 3446 mrj IPCTF = $(IPDRV_DIR)/$(OBJS_DIR)/ipctf.a 387 0 stevel 388 0 stevel # 389 580 wesolows # Rule for building fake shared libraries used for symbol resolution 390 580 wesolows # when building other modules. -znoreloc is needed here to avoid 391 580 wesolows # tripping over code that isn't really suitable for shared libraries. 392 580 wesolows # 393 580 wesolows BUILD.SO = \ 394 580 wesolows $(LD) -o $@ $(GSHARED) $(ZNORELOC) -h $(SONAME) 395 580 wesolows 396 580 wesolows # 397 580 wesolows # SONAME defaults for common fake shared libraries. 398 580 wesolows # 399 580 wesolows $(LIBGEN) := SONAME = $(MODULE) 400 580 wesolows $(PLATLIB) := SONAME = misc/platmod 401 580 wesolows $(CPULIB) := SONAME = 'cpu/$$CPU' 402 580 wesolows $(DTRACESTUBS) := SONAME = dtracestubs 403 580 wesolows 404 580 wesolows # 405 0 stevel # Installation directories 406 0 stevel # 407 0 stevel 408 0 stevel # 409 0 stevel # For now, 64b modules install into a subdirectory 410 0 stevel # of their 32b brethren. 411 0 stevel # 412 0 stevel SUBDIR64_sparc = sparcv9 413 0 stevel SUBDIR64_i386 = amd64 414 0 stevel SUBDIR64 = $(SUBDIR64_$(MACH)) 415 0 stevel 416 0 stevel ROOT_MOD_DIR = $(ROOT)/kernel 417 0 stevel 418 0 stevel ROOT_KERN_DIR_32 = $(ROOT_MOD_DIR) 419 2712 nn35248 ROOT_BRAND_DIR_32 = $(ROOT_MOD_DIR)/brand 420 0 stevel ROOT_DRV_DIR_32 = $(ROOT_MOD_DIR)/drv 421 0 stevel ROOT_DTRACE_DIR_32 = $(ROOT_MOD_DIR)/dtrace 422 0 stevel ROOT_EXEC_DIR_32 = $(ROOT_MOD_DIR)/exec 423 0 stevel ROOT_FS_DIR_32 = $(ROOT_MOD_DIR)/fs 424 0 stevel ROOT_SCHED_DIR_32 = $(ROOT_MOD_DIR)/sched 425 8348 Eric ROOT_SOCK_DIR_32 = $(ROOT_MOD_DIR)/socketmod 426 0 stevel ROOT_STRMOD_DIR_32 = $(ROOT_MOD_DIR)/strmod 427 0 stevel ROOT_IPP_DIR_32 = $(ROOT_MOD_DIR)/ipp 428 0 stevel ROOT_SYS_DIR_32 = $(ROOT_MOD_DIR)/sys 429 0 stevel ROOT_MISC_DIR_32 = $(ROOT_MOD_DIR)/misc 430 0 stevel ROOT_KGSS_DIR_32 = $(ROOT_MOD_DIR)/misc/kgss 431 4851 cth ROOT_SCSI_VHCI_DIR_32 = $(ROOT_MOD_DIR)/misc/scsi_vhci 432 7836 John ROOT_QLC_FW_DIR_32 = $(ROOT_MOD_DIR)/misc/qlc 433 8815 Sukumar ROOT_EMLXS_FW_DIR_32 = $(ROOT_MOD_DIR)/misc/emlxs 434 0 stevel ROOT_NLMISC_DIR_32 = $(ROOT_MOD_DIR)/misc 435 0 stevel ROOT_MACH_DIR_32 = $(ROOT_MOD_DIR)/mach 436 0 stevel ROOT_CPU_DIR_32 = $(ROOT_MOD_DIR)/cpu 437 0 stevel ROOT_TOD_DIR_32 = $(ROOT_MOD_DIR)/tod 438 0 stevel ROOT_FONT_DIR_32 = $(ROOT_MOD_DIR)/fonts 439 0 stevel ROOT_DACF_DIR_32 = $(ROOT_MOD_DIR)/dacf 440 0 stevel ROOT_CRYPTO_DIR_32 = $(ROOT_MOD_DIR)/crypto 441 2311 seb ROOT_MAC_DIR_32 = $(ROOT_MOD_DIR)/mac 442 5206 is ROOT_KICONV_DIR_32 = $(ROOT_MOD_DIR)/kiconv 443 0 stevel 444 0 stevel ROOT_KERN_DIR_64 = $(ROOT_MOD_DIR)/$(SUBDIR64) 445 2712 nn35248 ROOT_BRAND_DIR_64 = $(ROOT_MOD_DIR)/brand/$(SUBDIR64) 446 0 stevel ROOT_DRV_DIR_64 = $(ROOT_MOD_DIR)/drv/$(SUBDIR64) 447 0 stevel ROOT_DTRACE_DIR_64 = $(ROOT_MOD_DIR)/dtrace/$(SUBDIR64) 448 0 stevel ROOT_EXEC_DIR_64 = $(ROOT_MOD_DIR)/exec/$(SUBDIR64) 449 0 stevel ROOT_FS_DIR_64 = $(ROOT_MOD_DIR)/fs/$(SUBDIR64) 450 0 stevel ROOT_SCHED_DIR_64 = $(ROOT_MOD_DIR)/sched/$(SUBDIR64) 451 8348 Eric ROOT_SOCK_DIR_64 = $(ROOT_MOD_DIR)/socketmod/$(SUBDIR64) 452 0 stevel ROOT_STRMOD_DIR_64 = $(ROOT_MOD_DIR)/strmod/$(SUBDIR64) 453 0 stevel ROOT_IPP_DIR_64 = $(ROOT_MOD_DIR)/ipp/$(SUBDIR64) 454 0 stevel ROOT_SYS_DIR_64 = $(ROOT_MOD_DIR)/sys/$(SUBDIR64) 455 0 stevel ROOT_MISC_DIR_64 = $(ROOT_MOD_DIR)/misc/$(SUBDIR64) 456 0 stevel ROOT_KGSS_DIR_64 = $(ROOT_MOD_DIR)/misc/kgss/$(SUBDIR64) 457 4851 cth ROOT_SCSI_VHCI_DIR_64 = $(ROOT_MOD_DIR)/misc/scsi_vhci/$(SUBDIR64) 458 7836 John ROOT_QLC_FW_DIR_64 = $(ROOT_MOD_DIR)/misc/qlc/$(SUBDIR64) 459 8815 Sukumar ROOT_EMLXS_FW_DIR_64 = $(ROOT_MOD_DIR)/misc/emlxs/$(SUBDIR64) 460 0 stevel ROOT_NLMISC_DIR_64 = $(ROOT_MOD_DIR)/misc/$(SUBDIR64) 461 0 stevel ROOT_MACH_DIR_64 = $(ROOT_MOD_DIR)/mach/$(SUBDIR64) 462 0 stevel ROOT_CPU_DIR_64 = $(ROOT_MOD_DIR)/cpu/$(SUBDIR64) 463 0 stevel ROOT_TOD_DIR_64 = $(ROOT_MOD_DIR)/tod/$(SUBDIR64) 464 0 stevel ROOT_FONT_DIR_64 = $(ROOT_MOD_DIR)/fonts/$(SUBDIR64) 465 0 stevel ROOT_DACF_DIR_64 = $(ROOT_MOD_DIR)/dacf/$(SUBDIR64) 466 0 stevel ROOT_CRYPTO_DIR_64 = $(ROOT_MOD_DIR)/crypto/$(SUBDIR64) 467 2311 seb ROOT_MAC_DIR_64 = $(ROOT_MOD_DIR)/mac/$(SUBDIR64) 468 5206 is ROOT_KICONV_DIR_64 = $(ROOT_MOD_DIR)/kiconv/$(SUBDIR64) 469 0 stevel 470 0 stevel ROOT_KERN_DIR = $(ROOT_KERN_DIR_$(CLASS)) 471 2712 nn35248 ROOT_BRAND_DIR = $(ROOT_BRAND_DIR_$(CLASS)) 472 0 stevel ROOT_DRV_DIR = $(ROOT_DRV_DIR_$(CLASS)) 473 0 stevel ROOT_DTRACE_DIR = $(ROOT_DTRACE_DIR_$(CLASS)) 474 0 stevel ROOT_EXEC_DIR = $(ROOT_EXEC_DIR_$(CLASS)) 475 0 stevel ROOT_FS_DIR = $(ROOT_FS_DIR_$(CLASS)) 476 0 stevel ROOT_SCHED_DIR = $(ROOT_SCHED_DIR_$(CLASS)) 477 8348 Eric ROOT_SOCK_DIR = $(ROOT_SOCK_DIR_$(CLASS)) 478 0 stevel ROOT_STRMOD_DIR = $(ROOT_STRMOD_DIR_$(CLASS)) 479 0 stevel ROOT_IPP_DIR = $(ROOT_IPP_DIR_$(CLASS)) 480 0 stevel ROOT_SYS_DIR = $(ROOT_SYS_DIR_$(CLASS)) 481 0 stevel ROOT_MISC_DIR = $(ROOT_MISC_DIR_$(CLASS)) 482 0 stevel ROOT_KGSS_DIR = $(ROOT_KGSS_DIR_$(CLASS)) 483 4851 cth ROOT_SCSI_VHCI_DIR = $(ROOT_SCSI_VHCI_DIR_$(CLASS)) 484 7836 John ROOT_QLC_FW_DIR = $(ROOT_QLC_FW_DIR_$(CLASS)) 485 8815 Sukumar ROOT_EMLXS_FW_DIR = $(ROOT_EMLXS_FW_DIR_$(CLASS)) 486 0 stevel ROOT_NLMISC_DIR = $(ROOT_NLMISC_DIR_$(CLASS)) 487 0 stevel ROOT_MACH_DIR = $(ROOT_MACH_DIR_$(CLASS)) 488 0 stevel ROOT_CPU_DIR = $(ROOT_CPU_DIR_$(CLASS)) 489 0 stevel ROOT_TOD_DIR = $(ROOT_TOD_DIR_$(CLASS)) 490 0 stevel ROOT_FONT_DIR = $(ROOT_FONT_DIR_$(CLASS)) 491 0 stevel ROOT_DACF_DIR = $(ROOT_DACF_DIR_$(CLASS)) 492 0 stevel ROOT_CRYPTO_DIR = $(ROOT_CRYPTO_DIR_$(CLASS)) 493 2311 seb ROOT_MAC_DIR = $(ROOT_MAC_DIR_$(CLASS)) 494 5206 is ROOT_KICONV_DIR = $(ROOT_KICONV_DIR_$(CLASS)) 495 0 stevel 496 2712 nn35248 ROOT_MOD_DIRS_32 = $(ROOT_BRAND_DIR_32) $(ROOT_DRV_DIR_32) 497 2712 nn35248 ROOT_MOD_DIRS_32 = $(ROOT_BRAND_DIR_32) $(ROOT_DRV_DIR_32) 498 2712 nn35248 ROOT_MOD_DIRS_32 += $(ROOT_EXEC_DIR_32) $(ROOT_DTRACE_DIR_32) 499 0 stevel ROOT_MOD_DIRS_32 += $(ROOT_FS_DIR_32) $(ROOT_SCHED_DIR_32) 500 0 stevel ROOT_MOD_DIRS_32 += $(ROOT_STRMOD_DIR_32) $(ROOT_SYS_DIR_32) 501 8348 Eric ROOT_MOD_DIRS_32 += $(ROOT_IPP_DIR_32) $(ROOT_SOCK_DIR_32) 502 0 stevel ROOT_MOD_DIRS_32 += $(ROOT_MISC_DIR_32) $(ROOT_MACH_DIR_32) 503 0 stevel ROOT_MOD_DIRS_32 += $(ROOT_KGSS_DIR_32) 504 4851 cth ROOT_MOD_DIRS_32 += $(ROOT_SCSI_VHCI_DIR_32) 505 7836 John ROOT_MOD_DIRS_32 += $(ROOT_QLC_FW_DIR_32) 506 8815 Sukumar ROOT_MOD_DIRS_32 += $(ROOT_EMLXS_FW_DIR_32) 507 0 stevel ROOT_MOD_DIRS_32 += $(ROOT_CPU_DIR_32) $(ROOT_FONT_DIR_32) 508 0 stevel ROOT_MOD_DIRS_32 += $(ROOT_TOD_DIR_32) $(ROOT_DACF_DIR_32) 509 2311 seb ROOT_MOD_DIRS_32 += $(ROOT_CRYPTO_DIR_32) $(ROOT_MAC_DIR_32) 510 10097 Eric ROOT_MOD_DIRS_32 += $(ROOT_KICONV_DIR_32) 511 0 stevel 512 0 stevel USR_MOD_DIR = $(ROOT)/usr/kernel 513 0 stevel 514 0 stevel USR_DRV_DIR_32 = $(USR_MOD_DIR)/drv 515 0 stevel USR_EXEC_DIR_32 = $(USR_MOD_DIR)/exec 516 0 stevel USR_FS_DIR_32 = $(USR_MOD_DIR)/fs 517 0 stevel USR_SCHED_DIR_32 = $(USR_MOD_DIR)/sched 518 8348 Eric USR_SOCK_DIR_32 = $(USR_MOD_DIR)/socketmod 519 0 stevel USR_STRMOD_DIR_32 = $(USR_MOD_DIR)/strmod 520 0 stevel USR_SYS_DIR_32 = $(USR_MOD_DIR)/sys 521 0 stevel USR_MISC_DIR_32 = $(USR_MOD_DIR)/misc 522 0 stevel USR_DACF_DIR_32 = $(USR_MOD_DIR)/dacf 523 0 stevel USR_PCBE_DIR_32 = $(USR_MOD_DIR)/pcbe 524 8347 Jordan USR_DTRACE_DIR_32 = $(USR_MOD_DIR)/dtrace 525 8347 Jordan USR_BRAND_DIR_32 = $(USR_MOD_DIR)/brand 526 0 stevel 527 0 stevel USR_DRV_DIR_64 = $(USR_MOD_DIR)/drv/$(SUBDIR64) 528 0 stevel USR_EXEC_DIR_64 = $(USR_MOD_DIR)/exec/$(SUBDIR64) 529 0 stevel USR_FS_DIR_64 = $(USR_MOD_DIR)/fs/$(SUBDIR64) 530 0 stevel USR_SCHED_DIR_64 = $(USR_MOD_DIR)/sched/$(SUBDIR64) 531 8348 Eric USR_SOCK_DIR_64 = $(USR_MOD_DIR)/socketmod/$(SUBDIR64) 532 0 stevel USR_STRMOD_DIR_64 = $(USR_MOD_DIR)/strmod/$(SUBDIR64) 533 0 stevel USR_SYS_DIR_64 = $(USR_MOD_DIR)/sys/$(SUBDIR64) 534 0 stevel USR_MISC_DIR_64 = $(USR_MOD_DIR)/misc/$(SUBDIR64) 535 0 stevel USR_DACF_DIR_64 = $(USR_MOD_DIR)/dacf/$(SUBDIR64) 536 0 stevel USR_PCBE_DIR_64 = $(USR_MOD_DIR)/pcbe/$(SUBDIR64) 537 8347 Jordan USR_DTRACE_DIR_64 = $(USR_MOD_DIR)/dtrace/$(SUBDIR64) 538 8347 Jordan USR_BRAND_DIR_64 = $(USR_MOD_DIR)/brand/$(SUBDIR64) 539 0 stevel 540 0 stevel USR_DRV_DIR = $(USR_DRV_DIR_$(CLASS)) 541 0 stevel USR_EXEC_DIR = $(USR_EXEC_DIR_$(CLASS)) 542 0 stevel USR_FS_DIR = $(USR_FS_DIR_$(CLASS)) 543 0 stevel USR_SCHED_DIR = $(USR_SCHED_DIR_$(CLASS)) 544 8348 Eric USR_SOCK_DIR = $(USR_SOCK_DIR_$(CLASS)) 545 0 stevel USR_STRMOD_DIR = $(USR_STRMOD_DIR_$(CLASS)) 546 0 stevel USR_SYS_DIR = $(USR_SYS_DIR_$(CLASS)) 547 0 stevel USR_MISC_DIR = $(USR_MISC_DIR_$(CLASS)) 548 0 stevel USR_DACF_DIR = $(USR_DACF_DIR_$(CLASS)) 549 0 stevel USR_PCBE_DIR = $(USR_PCBE_DIR_$(CLASS)) 550 8347 Jordan USR_DTRACE_DIR = $(USR_DTRACE_DIR_$(CLASS)) 551 8347 Jordan USR_BRAND_DIR = $(USR_BRAND_DIR_$(CLASS)) 552 0 stevel 553 0 stevel USR_MOD_DIRS_32 = $(USR_DRV_DIR_32) $(USR_EXEC_DIR_32) 554 0 stevel USR_MOD_DIRS_32 += $(USR_FS_DIR_32) $(USR_SCHED_DIR_32) 555 0 stevel USR_MOD_DIRS_32 += $(USR_STRMOD_DIR_32) $(USR_SYS_DIR_32) 556 0 stevel USR_MOD_DIRS_32 += $(USR_MISC_DIR_32) $(USR_DACF_DIR_32) 557 10097 Eric USR_MOD_DIRS_32 += $(USR_PCBE_DIR_32) 558 8347 Jordan USR_MOD_DIRS_32 += $(USR_DTRACE_DIR_32) $(USR_BRAND_DIR_32) 559 10639 Darren USR_MOD_DIRS_32 += $(USR_SOCK_DIR_32) 560 0 stevel 561 0 stevel # 562 0 stevel # 563 0 stevel # 564 0 stevel include $(SRC)/Makefile.psm 565 0 stevel 566 0 stevel # 567 0 stevel # The "-r" on the remove may be considered temporary, but is required 568 0 stevel # while the replacement of the SUNW,SPARCstation-10,SX directory by 569 0 stevel # a symbolic link is being propagated. 570 0 stevel # 571 10207 James INS.slink1= $(RM) -r $@; $(SYMLINK) $(PLATFORM) $@ 572 10207 James INS.slink2= $(RM) -r $@; $(SYMLINK) ../$(PLATFORM)/$(@F) $@ 573 10207 James INS.slink3= $(RM) -r $@; $(SYMLINK) $(IMPLEMENTED_PLATFORM) $@ 574 10207 James INS.slink4= $(RM) -r $@; $(SYMLINK) ../$(PLATFORM)/include $@ 575 10207 James INS.slink5= $(RM) -r $@; $(SYMLINK) ../$(PLATFORM)/sbin $@ 576 10207 James INS.slink6= $(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/lib/$(MODULE) $@ 577 10207 James INS.slink7= $(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/$(@F) $@ 578 0 stevel 579 0 stevel ROOT_PLAT_LINKS = $(PLAT_LINKS:%=$(ROOT_PLAT_DIR)/%) 580 0 stevel ROOT_PLAT_LINKS_2 = $(PLAT_LINKS_2:%=$(ROOT_PLAT_DIR)/%) 581 0 stevel USR_PLAT_LINKS = $(PLAT_LINKS:%=$(USR_PLAT_DIR)/%) 582 0 stevel USR_PLAT_LINKS_2 = $(PLAT_LINKS_2:%=$(USR_PLAT_DIR)/%) 583 0 stevel 584 0 stevel # 585 3446 mrj # Collection of all relevant, delivered kernel modules. 586 0 stevel # 587 3446 mrj # Note that we insist on building genunix first, because everything else 588 3446 mrj # uniquifies against it. When doing a 'make' from usr/src/uts/, we'll enter 589 3446 mrj # the platform directories first. These will cd into the corresponding genunix 590 3446 mrj # directory and build it. So genunix /shouldn't/ get rebuilt when we get to 591 3446 mrj # building all the kernel modules. However, due to an as-yet-unexplained 592 3446 mrj # problem with dependencies, sometimes it does get rebuilt, which then messes 593 3446 mrj # up the other modules. So we always force the issue here rather than try to 594 3446 mrj # build genunix in parallel with everything else. 595 3446 mrj # 596 3446 mrj PARALLEL_KMODS = $(DRV_KMODS) $(EXEC_KMODS) $(FS_KMODS) $(SCHED_KMODS) \ 597 3446 mrj $(TOD_KMODS) $(STRMOD_KMODS) $(SYS_KMODS) $(MISC_KMODS) \ 598 3446 mrj $(NLMISC_KMODS) $(MACH_KMODS) $(CPU_KMODS) $(GSS_KMODS) \ 599 3446 mrj $(MMU_KMODS) $(DACF_KMODS) $(EXPORT_KMODS) $(IPP_KMODS) \ 600 6125 bubbva $(CRYPTO_KMODS) $(PCBE_KMODS) \ 601 3446 mrj $(DRV_KMODS_$(CLASS)) $(MISC_KMODS_$(CLASS)) $(MAC_KMODS) \ 602 10097 Eric $(BRAND_KMODS) $(KICONV_KMODS) \ 603 8348 Eric $(SOCKET_KMODS) 604 3446 mrj 605 3446 mrj KMODS = $(GENUNIX_KMODS) $(PARALLEL_KMODS) 606 3446 mrj 607 3446 mrj $(PARALLEL_KMODS): $(GENUNIX_KMODS) 608 0 stevel 609 1167 kupfer $(CLOSED_BUILD)CLOSED_KMODS = $(CLOSED_DRV_KMODS) $(CLOSED_TOD_KMODS) \ 610 10831 Yanmin $(CLOSED_MISC_KMODS) $(CLOSED_CPU_KMODS) \ 611 1167 kupfer $(CLOSED_NLMISC_KMODS) $(CLOSED_DRV_KMODS_$(CLASS)) 612 1167 kupfer 613 0 stevel LINT_KMODS = $(DRV_KMODS) $(EXEC_KMODS) $(FS_KMODS) $(SCHED_KMODS) \ 614 0 stevel $(TOD_KMODS) $(STRMOD_KMODS) $(SYS_KMODS) $(MISC_KMODS) \ 615 0 stevel $(MACH_KMODS) $(GSS_KMODS) $(DACF_KMODS) $(IPP_KMODS) \ 616 10097 Eric $(CRYPTO_KMODS) $(PCBE_KMODS) \ 617 4127 edp $(DRV_KMODS_$(CLASS)) $(MISC_KMODS_$(CLASS)) $(MAC_KMODS) \ 618 8348 Eric $(BRAND_KMODS) $(KICONV_KMODS) $(SOCKET_KMODS) 619 1167 kupfer 620 1167 kupfer $(CLOSED_BUILD)CLOSED_LINT_KMODS = $(CLOSED_DRV_KMODS) $(CLOSED_TOD_KMODS) \ 621 1167 kupfer $(CLOSED_MISC_KMODS) $(CLOSED_DRV_KMODS_$(CLASS)) 622 0 stevel 623 0 stevel THIS_YEAR:sh= /bin/date +%Y 624 0 stevel $(OBJS_DIR)/logsubr.o := CPPFLAGS += -DTHIS_YEAR=$(THIS_YEAR) 625 0 stevel $(OBJS_DIR)/logsubr.ln := CPPFLAGS += -DTHIS_YEAR=$(THIS_YEAR) 626 0 stevel 627 0 stevel # 628 0 stevel # Files to be compiled with -xa, to generate basic block execution 629 0 stevel # count data. 630 0 stevel # 631 0 stevel # There are several ways to compile parts of the kernel for kcov: 632 0 stevel # 1) Add targets to BB_FILES here or in other Makefiles 633 0 stevel # (they must in the form of $(OBJS_DIR)/target.o) 634 0 stevel # 2) setenv BB_FILES '$(XXX_OBJS:%=$(OBJS_DIR)/%)' 635 0 stevel # 3) setenv BB_FILES '$(OBJECTS)' 636 0 stevel # 637 0 stevel # Do NOT setenv CFLAGS -xa, as that will cause infinite recursion 638 0 stevel # in unix_bb.o 639 0 stevel # 640 0 stevel BB_FILES = 641 0 stevel $(BB_FILES) := XAOPT = -xa 642 0 stevel 643 0 stevel # 644 0 stevel # The idea here is for unix_bb.o to be in all kernels except the 645 0 stevel # kernel which actually gets shipped to customers. In practice, 646 0 stevel # $(RELEASE_BUILD) is on for a number of the late beta and fcs builds. 647 0 stevel # 648 0 stevel CODE_COVERAGE= 649 0 stevel $(RELEASE_BUILD)CODE_COVERAGE:sh= echo \\043 650 0 stevel $(CODE_COVERAGE)$(OBJS_DIR)/unix_bb.o := CPPFLAGS += -DKCOV 651 0 stevel $(CODE_COVERAGE)$(OBJS_DIR)/unix_bb.ln := CPPFLAGS += -DKCOV 652 0 stevel 653 0 stevel # 654 0 stevel # Do not let unix_bb.o get compiled with -xa! 655 0 stevel # 656 0 stevel $(OBJS_DIR)/unix_bb.o := XAOPT = 657 0 stevel 658 0 stevel # 659 0 stevel # Privilege files 660 0 stevel # 661 0 stevel PRIVS_AWK = $(SRC)/uts/common/os/privs.awk 662 0 stevel PRIVS_DEF = $(SRC)/uts/common/os/priv_defs 663 9354 Tim 664 9354 Tim # 665 9354 Tim # USB device data 666 9354 Tim # 667 9354 Tim USBDEVS_AWK = $(SRC)/uts/common/io/usb/usbdevs2h.awk 668 9354 Tim USBDEVS_DATA = $(SRC)/uts/common/io/usb/usbdevs 669