1 # $NetBSD: Makefile.xen,v 1.28 2008/12/11 05:27:42 alc Exp $
2 # NetBSD: Makefile.i386,v 1.132 2003/07/05 16:56:10 simonb Exp
6 # This makefile is constructed from a machine description:
8 # Most changes should be made in the machine description
9 # /sys/arch/xen/conf/``machineid''
10 # after which you should do
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.
16 # To specify debugging, add the config line: makeoptions DEBUG="-g"
17 # A better way is to specify -g only for a few files.
19 # makeoptions DEBUGLIST="uvm* trap if_*"
21 .include "$S/arch/xen/conf/Makefile.arch.inc"
23 NEED_OWN_INSTALL_TARGET?=no
29 ## (1) port identification
34 GENASSYM_CONF= $S/arch/${XEN_BUILD}/${XEN_BUILD}/genassym.cf
36 ARCH_INC= $S/arch/xen/include/${XEN_BUILD}
39 ## (2) compile settings
42 CPPFLAGS+= -D${XEN_BUILD}
43 AFLAGS+= -x assembler-with-cpp -traditional-cpp ${DBG} -D__XEN__
44 EXTRA_INCLUDES= -I${.CURDIR}/xen-ma
46 .if ${XEN_BUILD} == "amd64"
48 CFLAGS+= -mcmodel=kernel
49 CFLAGS+= -mno-red-zone
54 ## (3) libkern and compat
59 ## (4) local objects, compile rules, and dependencies
61 MD_OBJS= locore.o spl.o copy.o vector.o
64 MD_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
69 copy.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/copy.S assym.h
72 locore.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/locore.S assym.h
75 spl.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/spl.S assym.h
78 vector.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/vector.S assym.h
81 .if !make(obj) && !make(clean) && !make(cleandir)
83 .for A in ${XEN_MACHINE_ARCHS}
85 ln -s $S/arch/${A}/include ${A}
89 ln -s ../${XEN_BUILD} xen-ma/machine
91 ln -s ${ARCH_INC} machine
98 .if ${XEN_BUILD} == i386
100 .elif ${XEN_BUILD} == amd64
101 TEXTADDR?= 0xffffffff80100000
104 .if (${OBJECT_FMT} == "ELF")
105 KERN_LDSCRIPT?= kern.ldscript.Xen
106 LINKFORMAT= -T $S/arch/${XEN_BUILD}/conf/${KERN_LDSCRIPT}
112 ## (6) port specific target dependencies
115 .if ${XEN_BUILD} == i386
116 freebsd_sigcode.o ibcs2_sigcode.o linux_sigcode.o: assym.h
117 svr4_sigcode.o mach_sigcode.o: assym.h
118 apmcall.o pnpbioscall.o bioscall.o: assym.h
120 .elif ${XEN_BUILD} == amd64
121 locore.o machdep.o: Makefile
122 linux_support.o linux32_sigcode.o netbsd32_sigcode.o: assym.h
124 busfunc.o cpu_in_cksum.o cpufunc.o lock_stubs.o: assym.h
131 ## (8) config(8) generated machinery
146 ## (9) port independent kernel machinery
148 .include "$S/conf/Makefile.kern.inc"
151 ## (10) Appending make options.