Home | History | Annotate | Download | only in i86xpv
      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 $(OBJS_DIR)/%.o:		$(UTSBASE)/common/xen/dtrace/%.c
    126 	$(COMPILE.c) -o $@ $<
    127 	$(CTFCONVERT_O)
    128 
    129 #
    130 #	Section 1b: Lint `object' build rules
    131 #
    132 $(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/conf/%.c
    133 	@($(LHEAD) $(LINT.c) $< $(LTAIL))
    134 
    135 $(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/io/%.c
    136 	@($(LHEAD) $(LINT.c) $< $(LTAIL))
    137 
    138 $(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/io/psm/%.c
    139 	@($(LHEAD) $(LINT.c) $< $(LTAIL))
    140 
    141 $(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/ml/%.s
    142 	@($(LHEAD) $(LINT.s) $< $(LTAIL))
    143 
    144 $(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/os/%.c
    145 	@($(LHEAD) $(LINT.c) $< $(LTAIL))
    146 
    147 $(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/vm/%.c
    148 	@($(LHEAD) $(LINT.c) $< $(LTAIL))
    149 
    150 $(LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/boot/%.c
    151 	@($(LHEAD) $(LINT.c) $< $(LTAIL))
    152 
    153 $(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/boot/%.c
    154 	@($(LHEAD) $(LINT.c) $< $(LTAIL))
    155 
    156 $(LINTS_DIR)/%.ln:		$(UTSBASE)/common/xen/dtrace/%.c
    157 	@($(LHEAD) $(LINT.c) $< $(LTAIL))
    158 
    159 #	See note above.
    160 
    161 $(LINTS_DIR)/dtrace_subr.ln:	$(UTSBASE)/i86pc/os/dtrace_subr.c
    162 	@($(LHEAD) $(LINT.c) $(UTSBASE)/i86pc/os/dtrace_subr.c $(LTAIL))
    163 
    164 #
    165 # stuff for dboot
    166 #
    167 # This is different from i86pc - uses 64 bit compiler for 64 bit
    168 #
    169 # Note that we *don't* want to use the definitions that have been augmented
    170 # by various bits of the context of the kernel build environment; so we
    171 # start constructing flags and things afresh.
    172 
    173 DBOOT_OBJS_DIR= dboot/$(OBJS_DIR)
    174 
    175 DBOOT_XARCH_32 = $(i386_XARCH)
    176 DBOOT_XARCH_64 = $(amd64_XARCH)
    177 DBOOT_CFLAGS = $(DBOOT_XARCH_$(CLASS)) $(CERRWARN) -O
    178 
    179 DBOOT_AS_XARCH_32 = $(i386_AS_XARCH)
    180 DBOOT_AS_XARCH_64 = $(amd64_AS_XARCH)
    181 DBOOT_ASFLAGS = $(DBOOT_AS_XARCH_$(CLASS)) -P -D_ASM
    182 
    183 DBOOT_LINTFLAGS_i86xpv	= $(LINTFLAGS_i386_$(CLASS)) $(LINTTAGS_i386_$(CLASS))
    184 
    185 $(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/common/xen/os/%.c
    186 	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
    187 
    188 $(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/boot/%.c
    189 	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
    190 
    191 $(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/boot/%.c
    192 	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
    193 
    194 $(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/dboot/%.c
    195 	$(CC) $(DBOOT_CFLAGS)  $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
    196 
    197 $(DBOOT_OBJS_DIR)/%.o:		$(COMMONBASE)/util/%.c
    198 	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
    199 
    200 $(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/os/%.c
    201 	$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
    202 
    203 $(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/intel/ia32/ml/%.s
    204 	$(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
    205 
    206 $(DBOOT_OBJS_DIR)/%.o:		$(COMMONBASE)/util/i386/%.s
    207 	$(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
    208 
    209 $(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86xpv/ml/%.s
    210 	$(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
    211 
    212 $(DBOOT_OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/dboot/%.s
    213 	$(AS) $(DBOOT_ASFLAGS) $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
    214 
    215 include $(UTSBASE)/i86pc/Makefile.rules
    216 
    217 DBOOT_DEFS += -D__xpv
    218 
    219 $(LINTS_DIR)/%.ln:		$(UTSBASE)/common/cpr/%.c
    220 	@($(LHEAD) $(LINT.c) $< $(LTAIL))
    221 
    222 $(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/ioat/%.c
    223 	@($(LHEAD) $(LINT.c) $< $(LTAIL))
    224 
    225 $(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/pci/%.c
    226 	@($(LHEAD) $(LINT.c) $< $(LTAIL))
    227 
    228 $(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/pciex/%.c
    229 	@($(LHEAD) $(LINT.c) $< $(LTAIL))
    230 
    231 $(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/gfx_private/%.c
    232 	@($(LHEAD) $(LINT.c) $< $(LTAIL))
    233 
    234 $(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/xsvc/%.c
    235 	@($(LHEAD) $(LINT.c) $< $(LTAIL))
    236 
    237 $(LINTS_DIR)/%.ln:		$(UTSBASE)/common/xen/io/%.c
    238 	@($(LHEAD) $(LINT.c) $< $(LTAIL))
    239 
    240 $(LINTS_DIR)/%.ln:		$(UTSBASE)/common/xen/os/%.c
    241 	@($(LHEAD) $(LINT.c) $< $(LTAIL))
    242 
    243 $(DBOOT_LINTS_DIR)/%.ln:		$(UTSBASE)/intel/ia32/ml/%.s
    244 	@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
    245 
    246 $(DBOOT_LINTS_DIR)/%.ln:		$(UTSBASE)/common/xen/os/%.c
    247 	@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
    248 
    249 $(DBOOT_LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/os/%.c
    250 	@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
    251 
    252 $(DBOOT_LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/ml/%.s
    253 	@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
    254 
    255 $(DBOOT_LINTS_DIR)/%.ln:		$(UTSBASE)/i86xpv/boot/%.c
    256 	@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
    257