Home | History | Annotate | Line # | Download | only in conf
Makefile.xen revision 1.20.6.3
      1 #	$NetBSD: Makefile.xen,v 1.20.6.3 2008/01/08 22:10:41 bouyer 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 GENASSYM_CONF=	$S/arch/${XEN_BUILD}/${XEN_BUILD}/genassym.cf
     33 
     34 .if ${XEN_BUILD} == "amd64"
     35 ARCH_INC=	$S/arch/xen/include/amd64
     36 .elif ${XEN_BUILD} == "i386"
     37 ARCH_INC=	$S/arch/xen/include
     38 .endif
     39 
     40 ##
     41 ## (2) compile settings
     42 ##
     43 DEFCOPTS=	-O2
     44 CPPFLAGS+=	-D${XEN_BUILD}
     45 AFLAGS+=	-x assembler-with-cpp -traditional-cpp ${DBG} -D__XEN__
     46 EXTRA_INCLUDES=	-I${.CURDIR}/xen-ma
     47 
     48 .if ${XEN_BUILD} == "amd64"
     49 CPPFLAGS+=	-Dx86_64
     50 CFLAGS+=	-mcmodel=kernel
     51 CFLAGS+=	-mno-red-zone
     52 .endif
     53 
     54 
     55 ##
     56 ## (3) libkern and compat
     57 ##
     58 KERN_AS=	obj
     59 
     60 ##
     61 ## (4) local objects, compile rules, and dependencies
     62 ##
     63 MD_OBJS=	locore.o spl.o copy.o vector.o
     64 MD_CFILES=
     65 
     66 .if ${XEN_BUILD} == i386
     67 MD_SFILES=	${I386}/i386/locore.S \
     68 		${XEN}/${XEN_BUILD}/spl.S \
     69 		${XEN}/${XEN_BUILD}/vector.S \
     70 		${I386}/i386/copy.S
     71 
     72 copy.o: ${I386}/i386/copy.S assym.h
     73 	${NORMAL_S}
     74 
     75 locore.o: ${I386}/i386/locore.S assym.h
     76 	${NORMAL_S}
     77 
     78 spl.o: ${XEN}/${XEN_BUILD}/spl.S assym.h
     79 	${NORMAL_S}
     80 
     81 vector.o: ${XEN}/${XEN_BUILD}/vector.S assym.h
     82 	${NORMAL_S}
     83 .elif ${XEN_BUILD} == amd64
     84 MD_SFILES=	${AMD64}/amd64/locore.S \
     85 		${AMD64}/amd64/spl.S \
     86 		${AMD64}/amd64/copy.S \
     87 		${AMD64}/amd64/vector.S
     88 
     89 locore.o: ${AMD64}/amd64/locore.S assym.h
     90 	${NORMAL_S}
     91 
     92 spl.o: ${AMD64}/amd64/spl.S assym.h
     93 	${NORMAL_S}
     94 
     95 copy.o: ${AMD64}/amd64/copy.S assym.h
     96 	${NORMAL_S}
     97 
     98 vector.o: ${AMD64}/amd64/vector.S assym.h
     99 	${NORMAL_S}
    100 .endif
    101 
    102 .ifndef noBEGIN
    103 .if !make(obj) && !make(clean) && !make(cleandir)
    104 .BEGIN:
    105 .for A in ${XEN_MACHINE_ARCHS}
    106 	rm -f ${A}
    107 	ln -s $S/arch/${A}/include ${A}
    108 .endfor
    109 	-rm -rf xen-ma
    110 	mkdir xen-ma
    111 	ln -s ../${XEN_BUILD} xen-ma/machine
    112 	rm -f machine
    113 	ln -s ${ARCH_INC} machine
    114 .endif
    115 .endif
    116 
    117 ##
    118 ## (5) link settings
    119 ##
    120 .if ${XEN_BUILD} == i386
    121 TEXTADDR?=	0xc0100000
    122 .elif ${XEN_BUILD} == amd64
    123 TEXTADDR?=	0xffffffff80100000
    124 .endif
    125 LINKFLAGS_NORMAL=	-X
    126 .if (${OBJECT_FMT} == "ELF")
    127 KERN_LDSCRIPT?=	kern.ldscript.Xen
    128 LINKFORMAT=	-T $S/arch/${XEN_BUILD}/conf/${KERN_LDSCRIPT}
    129 .else
    130 LINKFORMAT=	-z
    131 .endif
    132 
    133 ##
    134 ## (6) port specific target dependencies
    135 ##
    136 
    137 .if ${XEN_BUILD} == i386
    138 freebsd_sigcode.o ibcs2_sigcode.o linux_sigcode.o: assym.h
    139 lock_stubs.o svr4_sigcode.o mach_sigcode.o: assym.h
    140 apmcall.o in_cksum.o pnpbioscall.o bioscall.o: assym.h
    141 mptramp.o: assym.h
    142 .elif  ${XEN_BUILD} == amd64
    143 locore.o machdep.o: Makefile
    144 cpufunc.o linux32_sigcode.o lock_stubs.o netbsd32_sigcode.o: assym.h
    145 .endif
    146 busfunc.o cpufunc.o: assym.h
    147 clock.o: config_time.h
    148 
    149 ##
    150 ## (7) misc settings
    151 ##
    152 
    153 ##
    154 ## (8) config(8) generated machinery
    155 ##
    156 %INCLUDES
    157 
    158 %OBJS
    159 
    160 %CFILES
    161 
    162 %SFILES
    163 
    164 %LOAD
    165 
    166 %RULES
    167 
    168 ## Include rules for Atheros WLAN
    169 .include "$S/contrib/dev/ath/netbsd/Makefile.ath.inc"
    170 
    171 ##
    172 ## (9) port independent kernel machinery
    173 ##
    174 .include "$S/conf/Makefile.kern.inc"
    175 
    176 ##
    177 ## (10) Appending make options.
    178 ##
    179 %MAKEOPTIONSAPPEND
    180