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