1 # $NetBSD: Makefile.xen,v 1.34 2011/08/17 21:42:16 joerg 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 DEFCOPTS= -O2 42 CPPFLAGS+= -D${XEN_BUILD} 43 AFLAGS+= -x assembler-with-cpp ${DBG} -D__XEN__ 44 EXTRA_INCLUDES= -I${.CURDIR}/xen-ma 45 46 .if ${XEN_BUILD} == "amd64" 47 CPPFLAGS+= -Dx86_64 48 CFLAGS+= -mcmodel=kernel 49 CFLAGS+= -mno-red-zone 50 .endif 51 52 53 ## 54 ## (3) libkern and compat 55 ## 56 KERN_AS= obj 57 58 CWARNFLAGS.ah_regdomain.c= ${${ACTIVE_CC} == "clang":?-Wno-error:} 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 MD_SFILES= $S/arch/${XEN_BUILD}/${XEN_BUILD}/locore.S \ 67 $S/arch/${XEN_BUILD}/${XEN_BUILD}/spl.S \ 68 $S/arch/${XEN_BUILD}/${XEN_BUILD}/vector.S \ 69 $S/arch/${XEN_BUILD}/${XEN_BUILD}/copy.S 70 71 copy.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/copy.S assym.h 72 ${NORMAL_S} 73 74 locore.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/locore.S assym.h 75 ${NORMAL_S} 76 77 spl.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/spl.S assym.h 78 ${NORMAL_S} 79 80 vector.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/vector.S assym.h 81 ${NORMAL_S} 82 .ifndef noBEGIN 83 .if !make(obj) && !make(clean) && !make(cleandir) 84 .BEGIN: 85 .for A in ${XEN_MACHINE_ARCHS} 86 rm -f ${A} 87 ln -s $S/arch/${A}/include ${A} 88 .endfor 89 -rm -rf xen-ma 90 mkdir xen-ma 91 ln -s ../${XEN_BUILD} xen-ma/machine 92 rm -f machine 93 ln -s ${ARCH_INC} machine 94 .endif 95 .endif 96 97 ## 98 ## (5) link settings 99 ## 100 .if ${XEN_BUILD} == i386 101 TEXTADDR?= 0xc0100000 102 .elif ${XEN_BUILD} == amd64 103 TEXTADDR?= 0xffffffff80100000 104 .endif 105 LINKFLAGS_NORMAL= -X 106 KERN_LDSCRIPT?= kern.ldscript.Xen 107 LINKFORMAT= -T $S/arch/${XEN_BUILD}/conf/${KERN_LDSCRIPT} 108 109 ## 110 ## (6) port specific target dependencies 111 ## 112 113 .if ${XEN_BUILD} == i386 114 freebsd_sigcode.o ibcs2_sigcode.o linux_sigcode.o: assym.h 115 svr4_sigcode.o mach_sigcode.o: assym.h 116 apmcall.o pnpbioscall.o bioscall.o: assym.h 117 mptramp.o: assym.h 118 .elif ${XEN_BUILD} == amd64 119 locore.o machdep.o: Makefile 120 linux_support.o linux32_sigcode.o netbsd32_sigcode.o: assym.h 121 .endif 122 busfunc.o cpu_in_cksum.o cpufunc.o lock_stubs.o: assym.h 123 124 ## 125 ## (7) misc settings 126 ## 127 128 ## 129 ## (8) config(8) generated machinery 130 ## 131 %INCLUDES 132 133 %OBJS 134 135 %CFILES 136 137 %SFILES 138 139 %LOAD 140 141 %RULES 142 143 ## 144 ## (9) port independent kernel machinery 145 ## 146 .include "$S/conf/Makefile.kern.inc" 147 148 ## 149 ## (10) Appending make options. 150 ## 151 %MAKEOPTIONSAPPEND 152