1# $NetBSD: Makefile.xen,v 1.29 2009/11/25 17:08:09 tron 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" 22USETOOLS?= no 23NEED_OWN_INSTALL_TARGET?=no 24.include <bsd.own.mk> 25 26USE_SSP?= yes 27 28## 29## (1) port identification 30## 31XEN= $S/arch/xen 32I386= $S/arch/i386 33AMD64= $S/arch/amd64 34GENASSYM_CONF= $S/arch/${XEN_BUILD}/${XEN_BUILD}/genassym.cf 35 36ARCH_INC= $S/arch/xen/include/${XEN_BUILD} 37 38## 39## (2) compile settings 40## 41DEFCOPTS= -O2 42CPPFLAGS+= -D${XEN_BUILD} 43AFLAGS+= -x assembler-with-cpp -traditional-cpp ${DBG} -D__XEN__ 44EXTRA_INCLUDES= -I${.CURDIR}/xen-ma 45 46.if ${XEN_BUILD} == "amd64" 47CPPFLAGS+= -Dx86_64 48CFLAGS+= -mcmodel=kernel 49CFLAGS+= -mno-red-zone 50.endif 51 52 53## 54## (3) libkern and compat 55## 56KERN_AS= obj 57 58## 59## (4) local objects, compile rules, and dependencies 60## 61MD_OBJS= locore.o spl.o copy.o vector.o 62MD_CFILES= 63 64MD_SFILES= $S/arch/${XEN_BUILD}/${XEN_BUILD}/locore.S \ 65 $S/arch/${XEN_BUILD}/${XEN_BUILD}/spl.S \ 66 $S/arch/${XEN_BUILD}/${XEN_BUILD}/vector.S \ 67 $S/arch/${XEN_BUILD}/${XEN_BUILD}/copy.S 68 69copy.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/copy.S assym.h 70 ${NORMAL_S} 71 72locore.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/locore.S assym.h 73 ${NORMAL_S} 74 75spl.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/spl.S assym.h 76 ${NORMAL_S} 77 78vector.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/vector.S assym.h 79 ${NORMAL_S} 80.ifndef noBEGIN 81.if !make(obj) && !make(clean) && !make(cleandir) 82.BEGIN: 83.for A in ${XEN_MACHINE_ARCHS} 84 rm -f ${A} 85 ln -s $S/arch/${A}/include ${A} 86.endfor 87 -rm -rf xen-ma 88 mkdir xen-ma 89 ln -s ../${XEN_BUILD} xen-ma/machine 90 rm -f machine 91 ln -s ${ARCH_INC} machine 92.endif 93.endif 94 95## 96## (5) link settings 97## 98.if ${XEN_BUILD} == i386 99TEXTADDR?= 0xc0100000 100.elif ${XEN_BUILD} == amd64 101TEXTADDR?= 0xffffffff80100000 102.endif 103LINKFLAGS_NORMAL= -X 104.if (${OBJECT_FMT} == "ELF") 105KERN_LDSCRIPT?= kern.ldscript.Xen 106LINKFORMAT= -T $S/arch/${XEN_BUILD}/conf/${KERN_LDSCRIPT} 107.else 108LINKFORMAT= -z 109.endif 110 111## 112## (6) port specific target dependencies 113## 114 115.if ${XEN_BUILD} == i386 116freebsd_sigcode.o ibcs2_sigcode.o linux_sigcode.o: assym.h 117svr4_sigcode.o mach_sigcode.o: assym.h 118apmcall.o pnpbioscall.o bioscall.o: assym.h 119mptramp.o: assym.h 120.elif ${XEN_BUILD} == amd64 121locore.o machdep.o: Makefile 122linux_support.o linux32_sigcode.o netbsd32_sigcode.o: assym.h 123.endif 124busfunc.o cpu_in_cksum.o cpufunc.o lock_stubs.o: assym.h 125 126## 127## (7) misc settings 128## 129 130## 131## (8) config(8) generated machinery 132## 133%INCLUDES 134 135%OBJS 136 137%CFILES 138 139%SFILES 140 141%LOAD 142 143%RULES 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