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# 23# Copyright 2008 Sun Microsystems, Inc. All rights reserved. 24# Use is subject to license terms. 25# 26# ident "%Z%%M% %I% %E% SMI" 27# 28 29# 30# This Makefile defines the build rules for the directory uts/i86xpv 31# and its children. These are the source files which are i86xpv 32# "implementation architecture" dependent. 33# 34# The following two-level ordering must be maintained in this file. 35# 36# - Lines are sorted first in order of decreasing specificity based on 37# the first directory component. That is, sun4u rules come before 38# sparc rules come before common rules. 39# 40# - Lines whose initial directory components are equal are sorted 41# alphabetically by the remaining components. 42# 43 44# 45# We share many files with the i86pc implementation to reduce 46# the amount of merge work 47# 48 49# 50# Section 1a: C object build rules 51# 52$(OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/conf/%.c 53 $(COMPILE.c) -o $@ $< 54 $(CTFCONVERT_O) 55 56$(OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/io/%.c 57 $(COMPILE.c) -o $@ $< 58 $(CTFCONVERT_O) 59 60$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/pci/%.c 61 $(COMPILE.c) -o $@ $< 62 $(CTFCONVERT_O) 63 64$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/pciex/%.c 65 $(COMPILE.c) -o $@ $< 66 $(CTFCONVERT_O) 67 68$(OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/io/psm/%.c 69 $(COMPILE.c) -o $@ $< 70 $(CTFCONVERT_O) 71 72$(OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/ml/%.s 73 $(COMPILE.s) -o $@ $< 74 75$(OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/os/%.c 76 $(COMPILE.c) -o $@ $< 77 $(CTFCONVERT_O) 78 79$(OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/vm/%.c 80 $(COMPILE.c) -o $@ $< 81 $(CTFCONVERT_O) 82 83$(OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/boot/%.c 84 $(COMPILE.c) -o $@ $< 85 $(CTFCONVERT_O) 86 87$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/boot/%.c 88 $(COMPILE.c) -o $@ $< 89 $(CTFCONVERT_O) 90 91$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/gfx_private/%.c 92 $(COMPILE.c) -o $@ $< 93 $(CTFCONVERT_O) 94 95$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/xsvc/%.c 96 $(COMPILE.c) -o $@ $< 97 $(CTFCONVERT_O) 98 99# We need this one to make sure we share dtrace_subr.c with i86pc 100# Otherwise we pick up common/os/dtrace_subr.c instead :( 101# Note that only the non-commented versions of this hack end up 102# in the lint section below. 103 104$(OBJS_DIR)/dtrace_subr.o: $(UTSBASE)/i86pc/os/dtrace_subr.c 105 $(COMPILE.c) -o $@ $(UTSBASE)/i86pc/os/dtrace_subr.c 106 $(CTFCONVERT_O) 107 108# 109$(OBJS_DIR)/%.o: $(UTSBASE)/common/cpr/%.c 110 $(COMPILE.c) -o $@ $< 111 $(CTFCONVERT_O) 112 113$(OBJS_DIR)/%.o: $(UTSBASE)/common/xen/io/%.c 114 $(COMPILE.c) -o $@ $< 115 $(CTFCONVERT_O) 116 117$(OBJS_DIR)/%.o: $(UTSBASE)/common/xen/os/%.c 118 $(COMPILE.c) -o $@ $< 119 $(CTFCONVERT_O) 120 121$(OBJS_DIR)/%.o: $(UTSBASE)/common/xen/dtrace/%.c 122 $(COMPILE.c) -o $@ $< 123 $(CTFCONVERT_O) 124 125# 126# Section 1b: Lint `object' build rules 127# 128$(LINTS_DIR)/%.ln: $(UTSBASE)/i86xpv/conf/%.c 129 @($(LHEAD) $(LINT.c) $< $(LTAIL)) 130 131$(LINTS_DIR)/%.ln: $(UTSBASE)/i86xpv/io/%.c 132 @($(LHEAD) $(LINT.c) $< $(LTAIL)) 133 134$(LINTS_DIR)/%.ln: $(UTSBASE)/i86xpv/io/psm/%.c 135 @($(LHEAD) $(LINT.c) $< $(LTAIL)) 136 137$(LINTS_DIR)/%.ln: $(UTSBASE)/i86xpv/ml/%.s 138 @($(LHEAD) $(LINT.s) $< $(LTAIL)) 139 140$(LINTS_DIR)/%.ln: $(UTSBASE)/i86xpv/os/%.c 141 @($(LHEAD) $(LINT.c) $< $(LTAIL)) 142 143$(LINTS_DIR)/%.ln: $(UTSBASE)/i86xpv/vm/%.c 144 @($(LHEAD) $(LINT.c) $< $(LTAIL)) 145 146$(LINTS_DIR)/%.ln: $(UTSBASE)/i86xpv/boot/%.c 147 @($(LHEAD) $(LINT.c) $< $(LTAIL)) 148 149$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/boot/%.c 150 @($(LHEAD) $(LINT.c) $< $(LTAIL)) 151 152$(LINTS_DIR)/%.ln: $(UTSBASE)/common/xen/dtrace/%.c 153 @($(LHEAD) $(LINT.c) $< $(LTAIL)) 154 155# See note above. 156 157$(LINTS_DIR)/dtrace_subr.ln: $(UTSBASE)/i86pc/os/dtrace_subr.c 158 @($(LHEAD) $(LINT.c) $(UTSBASE)/i86pc/os/dtrace_subr.c $(LTAIL)) 159 160# 161# stuff for dboot 162# 163# This is different from i86pc - uses 64 bit compiler for 64 bit 164# 165# Note that we *don't* want to use the definitions that have been augmented 166# by various bits of the context of the kernel build environment; so we 167# start constructing flags and things afresh. 168 169DBOOT_OBJS_DIR= dboot/$(OBJS_DIR) 170 171DBOOT_XARCH_32 = $(i386_XARCH) 172DBOOT_XARCH_64 = $(amd64_XARCH) 173DBOOT_CFLAGS = $(DBOOT_XARCH_$(CLASS)) $(CERRWARN) -O 174 175DBOOT_AS_XARCH_32 = $(i386_AS_XARCH) 176DBOOT_AS_XARCH_64 = $(amd64_AS_XARCH) 177DBOOT_ASFLAGS = $(DBOOT_AS_XARCH_$(CLASS)) -P -D_ASM 178 179DBOOT_LINTFLAGS_i86xpv = $(LINTFLAGS_i386_$(CLASS)) $(LINTTAGS_i386_$(CLASS)) 180 181$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/common/xen/os/%.c 182 $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $< 183 184$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/boot/%.c 185 $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $< 186 187$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86pc/boot/%.c 188 $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $< 189 190$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86pc/dboot/%.c 191 $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $< 192 193$(DBOOT_OBJS_DIR)/%.o: $(COMMONBASE)/util/%.c 194 $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $< 195 196$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/os/%.c 197 $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $< 198 199$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/intel/ia32/ml/%.s 200 $(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $< 201 202$(DBOOT_OBJS_DIR)/%.o: $(COMMONBASE)/util/i386/%.s 203 $(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $< 204 205$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/ml/%.s 206 $(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $< 207 208$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86pc/dboot/%.s 209 $(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $< 210 211include $(UTSBASE)/i86pc/Makefile.rules 212 213DBOOT_DEFS += -D__xpv 214 215$(LINTS_DIR)/%.ln: $(UTSBASE)/common/cpr/%.c 216 @($(LHEAD) $(LINT.c) $< $(LTAIL)) 217 218$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/pci/%.c 219 @($(LHEAD) $(LINT.c) $< $(LTAIL)) 220 221$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/pciex/%.c 222 @($(LHEAD) $(LINT.c) $< $(LTAIL)) 223 224$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/gfx_private/%.c 225 @($(LHEAD) $(LINT.c) $< $(LTAIL)) 226 227$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/xsvc/%.c 228 @($(LHEAD) $(LINT.c) $< $(LTAIL)) 229 230$(LINTS_DIR)/%.ln: $(UTSBASE)/common/xen/io/%.c 231 @($(LHEAD) $(LINT.c) $< $(LTAIL)) 232 233$(LINTS_DIR)/%.ln: $(UTSBASE)/common/xen/os/%.c 234 @($(LHEAD) $(LINT.c) $< $(LTAIL)) 235 236$(DBOOT_LINTS_DIR)/%.ln: $(UTSBASE)/intel/ia32/ml/%.s 237 @($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL)) 238 239$(DBOOT_LINTS_DIR)/%.ln: $(UTSBASE)/common/xen/os/%.c 240 @($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL)) 241 242$(DBOOT_LINTS_DIR)/%.ln: $(UTSBASE)/i86xpv/os/%.c 243 @($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL)) 244 245$(DBOOT_LINTS_DIR)/%.ln: $(UTSBASE)/i86xpv/ml/%.s 246 @($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL)) 247 248$(DBOOT_LINTS_DIR)/%.ln: $(UTSBASE)/i86xpv/boot/%.c 249 @($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL)) 250