xref: /netbsd-src/sys/arch/xen/conf/Makefile.xen (revision 4b71a66d0f279143147d63ebfcfd8a59499a3684)
1#	$NetBSD: Makefile.xen,v 1.26 2008/01/25 21:12:13 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"
22USETOOLS?=	no
23NEED_OWN_INSTALL_TARGET?=no
24.include <bsd.own.mk>
25
26##
27## (1) port identification
28##
29XEN=		$S/arch/xen
30I386=		$S/arch/i386
31AMD64=          $S/arch/amd64
32GENASSYM_CONF=	$S/arch/${XEN_BUILD}/${XEN_BUILD}/genassym.cf
33
34ARCH_INC=	$S/arch/xen/include/${XEN_BUILD}
35
36##
37## (2) compile settings
38##
39DEFCOPTS=	-O2
40CPPFLAGS+=	-D${XEN_BUILD}
41AFLAGS+=	-x assembler-with-cpp -traditional-cpp ${DBG} -D__XEN__
42EXTRA_INCLUDES=	-I${.CURDIR}/xen-ma
43
44.if ${XEN_BUILD} == "amd64"
45CPPFLAGS+=	-Dx86_64
46CFLAGS+=	-mcmodel=kernel
47CFLAGS+=	-mno-red-zone
48.endif
49
50
51##
52## (3) libkern and compat
53##
54KERN_AS=	obj
55
56##
57## (4) local objects, compile rules, and dependencies
58##
59MD_OBJS=	locore.o spl.o copy.o vector.o
60MD_CFILES=
61
62MD_SFILES=	$S/arch/${XEN_BUILD}/${XEN_BUILD}/locore.S \
63		$S/arch/${XEN_BUILD}/${XEN_BUILD}/spl.S \
64		$S/arch/${XEN_BUILD}/${XEN_BUILD}/vector.S \
65		$S/arch/${XEN_BUILD}/${XEN_BUILD}/copy.S
66
67copy.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/copy.S assym.h
68	${NORMAL_S}
69
70locore.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/locore.S assym.h
71	${NORMAL_S}
72
73spl.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/spl.S assym.h
74	${NORMAL_S}
75
76vector.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/vector.S assym.h
77	${NORMAL_S}
78.ifndef noBEGIN
79.if !make(obj) && !make(clean) && !make(cleandir)
80.BEGIN:
81.for A in ${XEN_MACHINE_ARCHS}
82	rm -f ${A}
83	ln -s $S/arch/${A}/include ${A}
84.endfor
85	-rm -rf xen-ma
86	mkdir xen-ma
87	ln -s ../${XEN_BUILD} xen-ma/machine
88	rm -f machine
89	ln -s ${ARCH_INC} machine
90.endif
91.endif
92
93##
94## (5) link settings
95##
96.if ${XEN_BUILD} == i386
97TEXTADDR?=	0xc0100000
98.elif ${XEN_BUILD} == amd64
99TEXTADDR?=	0xffffffff80100000
100.endif
101LINKFLAGS_NORMAL=	-X
102.if (${OBJECT_FMT} == "ELF")
103KERN_LDSCRIPT?=	kern.ldscript.Xen
104LINKFORMAT=	-T $S/arch/${XEN_BUILD}/conf/${KERN_LDSCRIPT}
105.else
106LINKFORMAT=	-z
107.endif
108
109##
110## (6) port specific target dependencies
111##
112
113.if ${XEN_BUILD} == i386
114freebsd_sigcode.o ibcs2_sigcode.o linux_sigcode.o: assym.h
115svr4_sigcode.o mach_sigcode.o: assym.h
116apmcall.o pnpbioscall.o bioscall.o: assym.h
117mptramp.o: assym.h
118.elif  ${XEN_BUILD} == amd64
119locore.o machdep.o: Makefile
120linux32_sigcode.o netbsd32_sigcode.o: assym.h
121.endif
122busfunc.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## Include rules for Atheros WLAN
144.include "$S/contrib/dev/ath/netbsd/Makefile.ath.inc"
145
146##
147## (9) port independent kernel machinery
148##
149.include "$S/conf/Makefile.kern.inc"
150
151##
152## (10) Appending make options.
153##
154%MAKEOPTIONSAPPEND
155