1 # $NetBSD: Makefile.xen,v 1.10 2005/11/07 11:42:34 yamt 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 MACHINE_ARCH?= i386 23 USETOOLS?= no 24 NEED_OWN_INSTALL_TARGET?=no 25 .include <bsd.own.mk> 26 27 ## 28 ## (1) port identification 29 ## 30 XEN= $S/arch/xen 31 I386= $S/arch/i386 32 GENASSYM_CONF= ${XEN}/${XEN_BUILD}/genassym.cf 33 34 ## 35 ## (2) compile settings 36 ## 37 CPPFLAGS+= -D${XEN_BUILD} 38 AFLAGS+= -x assembler-with-cpp -traditional-cpp ${DBG} 39 EXTRA_INCLUDES= -I${.CURDIR}/xen-ma 40 41 ## 42 ## (3) libkern and compat 43 ## 44 KERN_AS= obj 45 46 ## 47 ## (4) local objects, compile rules, and dependencies 48 ## 49 MD_OBJS= locore.o spl.o vector.o 50 MD_CFILES= 51 MD_SFILES= ${XEN}/${XEN_BUILD}/locore.S \ 52 ${XEN}/${XEN_BUILD}/spl.S \ 53 ${XEN}/${XEN_BUILD}/vector.S 54 55 .if ${MACHINE_ARCH} == i386 56 MD_OBJS+= copy.o 57 MD_CFILES+= ${I386}/i386/copy.S 58 59 copy.o: ${I386}/i386/copy.S assym.h 60 ${NORMAL_S} 61 .endif 62 63 locore.o: ${XEN}/${XEN_BUILD}/locore.S assym.h 64 ${NORMAL_S} 65 66 spl.o: ${XEN}/${XEN_BUILD}/spl.S assym.h 67 ${NORMAL_S} 68 69 vector.o: ${XEN}/${XEN_BUILD}/vector.S assym.h 70 ${NORMAL_S} 71 72 .ifndef noBEGIN 73 .if !make(obj) && !make(clean) && !make(cleandir) 74 .BEGIN: 75 .for A in ${XEN_MACHINE_ARCHS} 76 rm -f ${A} 77 ln -s $S/arch/${A}/include ${A} 78 .endfor 79 -rm -rf xen-ma 80 mkdir xen-ma 81 ln -s ../${XEN_BUILD} xen-ma/machine 82 .endif 83 .endif 84 85 ## 86 ## (5) link settings 87 ## 88 TEXTADDR?= c0100000 89 LINKFLAGS_NORMAL= -X 90 .if (${OBJECT_FMT} == "ELF") 91 KERN_LDSCRIPT?= kern.ldscript 92 LINKFORMAT= -T $S/arch/${XEN_BUILD}/conf/${KERN_LDSCRIPT} 93 .else 94 LINKFORMAT= -z 95 .endif 96 97 ## 98 ## (6) port specific target dependencies 99 ## 100 101 freebsd_sigcode.o ibcs2_sigcode.o linux_sigcode.o: assym.h 102 svr4_sigcode.o mach_sigcode.o: assym.h 103 apmcall.o in_cksum.o pnpbioscall.o bioscall.o: assym.h 104 mptramp.o: assym.h 105 clock.o: config_time.h 106 107 ## 108 ## (7) misc settings 109 ## 110 111 ## 112 ## (8) config(8) generated machinery 113 ## 114 %INCLUDES 115 116 %OBJS 117 118 %CFILES 119 120 %SFILES 121 122 %LOAD 123 124 %RULES 125 126 # XXX - Ugly, but make doesn't easily handle .o.uue (assumes it's a suffix) 127 # XXX - Also, config has no simple was to just add foo.o to the Makefile. 128 # It needs a pathname of some sort for "object" 129 .if !empty(OBJS:M\/athhal-i386-elf.hal.o) 130 OBJS:=${OBJS:C/\/athhal-i386-elf.hal.o/athhal-i386-elf.hal.o/} 131 132 .PATH: $S/contrib/arch/i386/dev 133 ATH_UUDEC?= @${_MKSHMSG} "uudecode ${.CURDIR:T}/${.TARGET}"; \ 134 ${_MKSHECHO}\ 135 ${UUDECODE} -p $> \> ${.TARGET}; \ 136 rm -f ${.TARGET}; \ 137 ${UUDECODE} -p $> > ${.TARGET} 138 athhal-i386-elf.hal.o: athhal-i386-elf.hal.o.uue 139 ${ATH_UUDEC} 140 all depend: opt_ah.h 141 opt_ah.h: athhal-i386-elf.opt_ah.h 142 ln -s ${.ALLSRC} ${.TARGET} 143 .endif 144 145 ## 146 ## (9) port independent kernel machinery 147 ## 148 .include "$S/conf/Makefile.kern.inc" 149 150 ## 151 ## (10) Appending make options. 152 ## 153 %MAKEOPTIONSAPPEND 154