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/ioat/%.c 61 $(COMPILE.c) -o $@ $< 62 $(CTFCONVERT_O) 63 64$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/pci/%.c 65 $(COMPILE.c) -o $@ $< 66 $(CTFCONVERT_O) 67 68$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/pciex/%.c 69 $(COMPILE.c) -o $@ $< 70 $(CTFCONVERT_O) 71 72$(OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/io/psm/%.c 73 $(COMPILE.c) -o $@ $< 74 $(CTFCONVERT_O) 75 76$(OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/ml/%.s 77 $(COMPILE.s) -o $@ $< 78 79$(OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/os/%.c 80 $(COMPILE.c) -o $@ $< 81 $(CTFCONVERT_O) 82 83$(OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/vm/%.c 84 $(COMPILE.c) -o $@ $< 85 $(CTFCONVERT_O) 86 87$(OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/boot/%.c 88 $(COMPILE.c) -o $@ $< 89 $(CTFCONVERT_O) 90 91$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/boot/%.c 92 $(COMPILE.c) -o $@ $< 93 $(CTFCONVERT_O) 94 95$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/gfx_private/%.c 96 $(COMPILE.c) -o $@ $< 97 $(CTFCONVERT_O) 98 99$(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/xsvc/%.c 100 $(COMPILE.c) -o $@ $< 101 $(CTFCONVERT_O) 102 103# We need this one to make sure we share dtrace_subr.c with i86pc 104# Otherwise we pick up common/os/dtrace_subr.c instead :( 105# Note that only the non-commented versions of this hack end up 106# in the lint section below. 107 108$(OBJS_DIR)/dtrace_subr.o: $(UTSBASE)/i86pc/os/dtrace_subr.c 109 $(COMPILE.c) -o $@ $(UTSBASE)/i86pc/os/dtrace_subr.c 110 $(CTFCONVERT_O) 111 112# 113$(OBJS_DIR)/%.o: $(UTSBASE)/common/cpr/%.c 114 $(COMPILE.c) -o $@ $< 115 $(CTFCONVERT_O) 116 117$(OBJS_DIR)/%.o: $(UTSBASE)/common/xen/io/%.c 118 $(COMPILE.c) -o $@ $< 119 $(CTFCONVERT_O) 120 121$(OBJS_DIR)/%.o: $(UTSBASE)/common/xen/os/%.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# See note above. 153 154$(LINTS_DIR)/dtrace_subr.ln: $(UTSBASE)/i86pc/os/dtrace_subr.c 155 @($(LHEAD) $(LINT.c) $(UTSBASE)/i86pc/os/dtrace_subr.c $(LTAIL)) 156 157# 158# stuff for dboot 159# 160# This is different from i86pc - uses 64 bit compiler for 64 bit 161# 162# Note that we *don't* want to use the definitions that have been augmented 163# by various bits of the context of the kernel build environment; so we 164# start constructing flags and things afresh. 165 166DBOOT_OBJS_DIR= dboot/$(OBJS_DIR) 167 168DBOOT_XARCH_32 = $(i386_XARCH) 169DBOOT_XARCH_64 = $(amd64_XARCH) 170DBOOT_CFLAGS = $(DBOOT_XARCH_$(CLASS)) $(CERRWARN) -O 171 172DBOOT_AS_XARCH_32 = $(i386_AS_XARCH) 173DBOOT_AS_XARCH_64 = $(amd64_AS_XARCH) 174DBOOT_ASFLAGS = $(DBOOT_AS_XARCH_$(CLASS)) -P -D_ASM 175 176DBOOT_LINTFLAGS_i86xpv = $(LINTFLAGS_i386_$(CLASS)) $(LINTTAGS_i386_$(CLASS)) 177 178$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/common/xen/os/%.c 179 $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $< 180 181$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/boot/%.c 182 $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $< 183 184$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86pc/boot/%.c 185 $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $< 186 187$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86pc/dboot/%.c 188 $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $< 189 190$(DBOOT_OBJS_DIR)/%.o: $(COMMONBASE)/util/%.c 191 $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $< 192 193$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/os/%.c 194 $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $< 195 196$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/intel/ia32/ml/%.s 197 $(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $< 198 199$(DBOOT_OBJS_DIR)/%.o: $(COMMONBASE)/util/i386/%.s 200 $(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $< 201 202$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/ml/%.s 203 $(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $< 204 205$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86pc/dboot/%.s 206 $(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $< 207 208include $(UTSBASE)/i86pc/Makefile.rules 209 210DBOOT_DEFS += -D__xpv 211 212$(LINTS_DIR)/%.ln: $(UTSBASE)/common/cpr/%.c 213 @($(LHEAD) $(LINT.c) $< $(LTAIL)) 214 215$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/ioat/%.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