1 1.41.6.1 martin # $NetBSD: Makefile.xen,v 1.41.6.1 2018/03/07 14:50:57 martin Exp $ 2 1.1 cl # NetBSD: Makefile.i386,v 1.132 2003/07/05 16:56:10 simonb Exp 3 1.1 cl 4 1.1 cl # Makefile for NetBSD 5 1.1 cl # 6 1.1 cl # This makefile is constructed from a machine description: 7 1.1 cl # config machineid 8 1.1 cl # Most changes should be made in the machine description 9 1.1 cl # /sys/arch/xen/conf/``machineid'' 10 1.1 cl # after which you should do 11 1.1 cl # config machineid 12 1.1 cl # Machine generic makefile changes should be made in 13 1.1 cl # /sys/arch/xen/conf/Makefile.xen 14 1.1 cl # after which config should be rerun for all machines of that type. 15 1.1 cl # 16 1.1 cl # To specify debugging, add the config line: makeoptions DEBUG="-g" 17 1.1 cl # A better way is to specify -g only for a few files. 18 1.1 cl # 19 1.1 cl # makeoptions DEBUGLIST="uvm* trap if_*" 20 1.1 cl 21 1.2 cl .include "$S/arch/xen/conf/Makefile.arch.inc" 22 1.1 cl USETOOLS?= no 23 1.1 cl NEED_OWN_INSTALL_TARGET?=no 24 1.1 cl .include <bsd.own.mk> 25 1.1 cl 26 1.29 tron USE_SSP?= yes 27 1.29 tron 28 1.1 cl ## 29 1.1 cl ## (1) port identification 30 1.1 cl ## 31 1.1 cl XEN= $S/arch/xen 32 1.10 yamt I386= $S/arch/i386 33 1.20 bouyer AMD64= $S/arch/amd64 34 1.20 bouyer GENASSYM_CONF= $S/arch/${XEN_BUILD}/${XEN_BUILD}/genassym.cf 35 1.20 bouyer 36 1.24 bouyer ARCH_INC= $S/arch/xen/include/${XEN_BUILD} 37 1.1 cl 38 1.1 cl ## 39 1.1 cl ## (2) compile settings 40 1.1 cl ## 41 1.2 cl CPPFLAGS+= -D${XEN_BUILD} 42 1.31 joerg AFLAGS+= -x assembler-with-cpp ${DBG} -D__XEN__ 43 1.1 cl EXTRA_INCLUDES= -I${.CURDIR}/xen-ma 44 1.1 cl 45 1.20 bouyer .if ${XEN_BUILD} == "amd64" 46 1.36 bouyer DEFCOPTS= -O2 -fno-omit-frame-pointer 47 1.20 bouyer CPPFLAGS+= -Dx86_64 48 1.20 bouyer CFLAGS+= -mcmodel=kernel 49 1.36 bouyer CFLAGS+= -mno-red-zone -mno-mmx -mno-sse -mno-avx 50 1.36 bouyer CFLAGS+= -msoft-float 51 1.37 joerg CFLAGS+= ${${ACTIVE_CC} == "gcc":? -mno-fp-ret-in-387 :} 52 1.20 bouyer .endif 53 1.20 bouyer 54 1.36 bouyer .if ${XEN_BUILD} == "i386" 55 1.36 bouyer DEFCOPTS= -O2 -fno-omit-frame-pointer 56 1.36 bouyer CFLAGS+= -msoft-float 57 1.36 bouyer CFLAGS+= -mno-mmx -mno-sse -mno-avx 58 1.36 bouyer .endif 59 1.20 bouyer 60 1.1 cl ## 61 1.1 cl ## (3) libkern and compat 62 1.1 cl ## 63 1.1 cl KERN_AS= obj 64 1.1 cl 65 1.1 cl ## 66 1.1 cl ## (4) local objects, compile rules, and dependencies 67 1.1 cl ## 68 1.20 bouyer MD_OBJS= locore.o spl.o copy.o vector.o 69 1.41.6.1 martin .if ${XEN_BUILD} == amd64 70 1.41.6.1 martin MD_OBJS+= amd64_trap.o 71 1.41.6.1 martin .endif 72 1.1 cl MD_CFILES= 73 1.20 bouyer 74 1.24 bouyer MD_SFILES= $S/arch/${XEN_BUILD}/${XEN_BUILD}/locore.S \ 75 1.24 bouyer $S/arch/${XEN_BUILD}/${XEN_BUILD}/spl.S \ 76 1.24 bouyer $S/arch/${XEN_BUILD}/${XEN_BUILD}/vector.S \ 77 1.24 bouyer $S/arch/${XEN_BUILD}/${XEN_BUILD}/copy.S 78 1.20 bouyer 79 1.41.6.1 martin .if ${XEN_BUILD} == amd64 80 1.41.6.1 martin MD_SFILES+= $S/arch/${XEN_BUILD}/${XEN_BUILD}/amd64_trap.S 81 1.41.6.1 martin .endif 82 1.41.6.1 martin 83 1.24 bouyer copy.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/copy.S assym.h 84 1.20 bouyer ${NORMAL_S} 85 1.20 bouyer 86 1.24 bouyer locore.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/locore.S assym.h 87 1.20 bouyer ${NORMAL_S} 88 1.20 bouyer 89 1.24 bouyer spl.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/spl.S assym.h 90 1.20 bouyer ${NORMAL_S} 91 1.20 bouyer 92 1.24 bouyer vector.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/vector.S assym.h 93 1.20 bouyer ${NORMAL_S} 94 1.41.6.1 martin 95 1.41.6.1 martin .if ${XEN_BUILD} == amd64 96 1.41.6.1 martin amd64_trap.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/amd64_trap.S assym.h 97 1.41.6.1 martin ${NORMAL_S} 98 1.41.6.1 martin .endif 99 1.41.6.1 martin 100 1.7 sjg .ifndef noBEGIN 101 1.1 cl .if !make(obj) && !make(clean) && !make(cleandir) 102 1.1 cl .BEGIN: 103 1.2 cl .for A in ${XEN_MACHINE_ARCHS} 104 1.2 cl rm -f ${A} 105 1.2 cl ln -s $S/arch/${A}/include ${A} 106 1.2 cl .endfor 107 1.5 jmc -rm -rf xen-ma 108 1.1 cl mkdir xen-ma 109 1.3 cl ln -s ../${XEN_BUILD} xen-ma/machine 110 1.20 bouyer rm -f machine 111 1.20 bouyer ln -s ${ARCH_INC} machine 112 1.1 cl .endif 113 1.7 sjg .endif 114 1.1 cl 115 1.1 cl ## 116 1.1 cl ## (5) link settings 117 1.1 cl ## 118 1.20 bouyer .if ${XEN_BUILD} == i386 119 1.20 bouyer TEXTADDR?= 0xc0100000 120 1.20 bouyer .elif ${XEN_BUILD} == amd64 121 1.41 maxv TEXTADDR?= 0xffffffff80200000 122 1.20 bouyer .endif 123 1.1 cl LINKFLAGS_NORMAL= -X 124 1.39 uebayasi KERNLDSCRIPT?= $S/arch/${XEN_BUILD}/conf/kern.ldscript.Xen 125 1.1 cl 126 1.1 cl ## 127 1.1 cl ## (6) port specific target dependencies 128 1.1 cl ## 129 1.1 cl 130 1.20 bouyer .if ${XEN_BUILD} == i386 131 1.1 cl freebsd_sigcode.o ibcs2_sigcode.o linux_sigcode.o: assym.h 132 1.26 joerg svr4_sigcode.o mach_sigcode.o: assym.h 133 1.26 joerg apmcall.o pnpbioscall.o bioscall.o: assym.h 134 1.1 cl mptramp.o: assym.h 135 1.20 bouyer .elif ${XEN_BUILD} == amd64 136 1.20 bouyer locore.o machdep.o: Makefile 137 1.27 joerg linux_support.o linux32_sigcode.o netbsd32_sigcode.o: assym.h 138 1.20 bouyer .endif 139 1.26 joerg busfunc.o cpu_in_cksum.o cpufunc.o lock_stubs.o: assym.h 140 1.1 cl 141 1.1 cl ## 142 1.1 cl ## (7) misc settings 143 1.1 cl ## 144 1.1 cl 145 1.1 cl ## 146 1.1 cl ## (8) config(8) generated machinery 147 1.1 cl ## 148 1.1 cl %INCLUDES 149 1.1 cl 150 1.1 cl %OBJS 151 1.1 cl 152 1.1 cl %CFILES 153 1.1 cl 154 1.1 cl %SFILES 155 1.1 cl 156 1.1 cl %LOAD 157 1.1 cl 158 1.1 cl %RULES 159 1.1 cl 160 1.1 cl ## 161 1.1 cl ## (9) port independent kernel machinery 162 1.1 cl ## 163 1.1 cl .include "$S/conf/Makefile.kern.inc" 164 1.4 thorpej 165 1.4 thorpej ## 166 1.4 thorpej ## (10) Appending make options. 167 1.4 thorpej ## 168 1.4 thorpej %MAKEOPTIONSAPPEND 169