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