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