Home | History | Annotate | Line # | Download | only in conf
Makefile.xen revision 1.21
      1 #	$NetBSD: Makefile.xen,v 1.21 2008/01/01 11:35:33 yamt Exp $
      2 #	NetBSD: Makefile.i386,v 1.132 2003/07/05 16:56:10 simonb Exp 
      3 
      4 # Makefile for NetBSD
      5 #
      6 # This makefile is constructed from a machine description:
      7 #	config machineid
      8 # Most changes should be made in the machine description
      9 #	/sys/arch/xen/conf/``machineid''
     10 # after which you should do
     11 #	config machineid
     12 # Machine generic makefile changes should be made in
     13 #	/sys/arch/xen/conf/Makefile.xen
     14 # after which config should be rerun for all machines of that type.
     15 #
     16 # To specify debugging, add the config line: makeoptions DEBUG="-g"
     17 # A better way is to specify -g only for a few files.
     18 #
     19 #	makeoptions DEBUGLIST="uvm* trap if_*"
     20 
     21 .include "$S/arch/xen/conf/Makefile.arch.inc"
     22 USETOOLS?=	no
     23 NEED_OWN_INSTALL_TARGET?=no
     24 .include <bsd.own.mk>
     25 
     26 ##
     27 ## (1) port identification
     28 ##
     29 XEN=		$S/arch/xen
     30 I386=		$S/arch/i386
     31 AMD64=          $S/arch/amd64
     32 .if ${XEN_BUILD} == "i386"
     33 GENASSYM_CONF=	$S/arch/xen/i386/genassym.cf
     34 .else
     35 GENASSYM_CONF=	$S/arch/${XEN_BUILD}/${XEN_BUILD}/genassym.cf
     36 .endif
     37 
     38 .if ${XEN_BUILD} == "amd64"
     39 ARCH_INC=	$S/arch/xen/include/amd64
     40 .elif ${XEN_BUILD} == "i386"
     41 ARCH_INC=	$S/arch/xen/include
     42 .endif
     43 
     44 ##
     45 ## (2) compile settings
     46 ##
     47 DEFCOPTS=	-O2
     48 CPPFLAGS+=	-D${XEN_BUILD}
     49 AFLAGS+=	-x assembler-with-cpp -traditional-cpp ${DBG} -D__XEN__
     50 EXTRA_INCLUDES=	-I${.CURDIR}/xen-ma
     51 
     52 .if ${XEN_BUILD} == "amd64"
     53 CPPFLAGS+=	-Dx86_64
     54 CFLAGS+=	-mcmodel=kernel
     55 CFLAGS+=	-mno-red-zone
     56 .endif
     57 
     58 
     59 ##
     60 ## (3) libkern and compat
     61 ##
     62 KERN_AS=	obj
     63 
     64 ##
     65 ## (4) local objects, compile rules, and dependencies
     66 ##
     67 MD_OBJS=	locore.o spl.o copy.o vector.o
     68 MD_CFILES=
     69 
     70 .if ${XEN_BUILD} == i386
     71 MD_SFILES=	${XEN}/${XEN_BUILD}/locore.S \
     72 		${XEN}/${XEN_BUILD}/spl.S \
     73 		${XEN}/${XEN_BUILD}/vector.S \
     74 		${I386}/i386/copy.S
     75 
     76 copy.o: ${I386}/i386/copy.S assym.h
     77 	${NORMAL_S}
     78 
     79 locore.o: ${XEN}/${XEN_BUILD}/locore.S assym.h
     80 	${NORMAL_S}
     81 
     82 spl.o: ${XEN}/${XEN_BUILD}/spl.S assym.h
     83 	${NORMAL_S}
     84 
     85 vector.o: ${XEN}/${XEN_BUILD}/vector.S assym.h
     86 	${NORMAL_S}
     87 .elif ${XEN_BUILD} == amd64
     88 MD_SFILES=	${AMD64}/amd64/locore.S \
     89 		${AMD64}/amd64/spl.S \
     90 		${AMD64}/amd64/copy.S \
     91 		${AMD64}/amd64/vector.S
     92 
     93 locore.o: ${AMD64}/amd64/locore.S assym.h
     94 	${NORMAL_S}
     95 
     96 spl.o: ${AMD64}/amd64/spl.S assym.h
     97 	${NORMAL_S}
     98 
     99 copy.o: ${AMD64}/amd64/copy.S assym.h
    100 	${NORMAL_S}
    101 
    102 vector.o: ${AMD64}/amd64/vector.S assym.h
    103 	${NORMAL_S}
    104 .endif
    105 
    106 .ifndef noBEGIN
    107 .if !make(obj) && !make(clean) && !make(cleandir)
    108 .BEGIN:
    109 .for A in ${XEN_MACHINE_ARCHS}
    110 	rm -f ${A}
    111 	ln -s $S/arch/${A}/include ${A}
    112 .endfor
    113 	-rm -rf xen-ma
    114 	mkdir xen-ma
    115 	ln -s ../${XEN_BUILD} xen-ma/machine
    116 	rm -f machine
    117 	ln -s ${ARCH_INC} machine
    118 .endif
    119 .endif
    120 
    121 ##
    122 ## (5) link settings
    123 ##
    124 .if ${XEN_BUILD} == i386
    125 TEXTADDR?=	0xc0100000
    126 .elif ${XEN_BUILD} == amd64
    127 TEXTADDR?=	0xffffffff80100000
    128 .endif
    129 LINKFLAGS_NORMAL=	-X
    130 .if (${OBJECT_FMT} == "ELF")
    131 KERN_LDSCRIPT?=	kern.ldscript.Xen
    132 LINKFORMAT=	-T $S/arch/${XEN_BUILD}/conf/${KERN_LDSCRIPT}
    133 .else
    134 LINKFORMAT=	-z
    135 .endif
    136 
    137 ##
    138 ## (6) port specific target dependencies
    139 ##
    140 
    141 .if ${XEN_BUILD} == i386
    142 freebsd_sigcode.o ibcs2_sigcode.o linux_sigcode.o: assym.h
    143 svr4_sigcode.o mach_sigcode.o: assym.h
    144 apmcall.o in_cksum.o pnpbioscall.o bioscall.o: assym.h
    145 mptramp.o: assym.h
    146 .elif  ${XEN_BUILD} == amd64
    147 locore.o machdep.o: Makefile
    148 netbsd32_sigcode.o: assym.h
    149 .endif
    150 busfunc.o cpufunc.o: assym.h
    151 clock.o: config_time.h
    152 
    153 ##
    154 ## (7) misc settings
    155 ##
    156 
    157 ##
    158 ## (8) config(8) generated machinery
    159 ##
    160 %INCLUDES
    161 
    162 %OBJS
    163 
    164 %CFILES
    165 
    166 %SFILES
    167 
    168 %LOAD
    169 
    170 %RULES
    171 
    172 ## Include rules for Atheros WLAN
    173 .include "$S/contrib/dev/ath/netbsd/Makefile.ath.inc"
    174 
    175 ##
    176 ## (9) port independent kernel machinery
    177 ##
    178 .include "$S/conf/Makefile.kern.inc"
    179 
    180 ##
    181 ## (10) Appending make options.
    182 ##
    183 %MAKEOPTIONSAPPEND
    184