Makefile.amd64 revision 1.41
1#	$NetBSD: Makefile.amd64,v 1.41 2012/12/14 16:37:55 christos Exp $
2
3# Makefile for NetBSD
4#
5# This makefile is constructed from a machine description:
6#	config machineid
7# Most changes should be made in the machine description
8#	/sys/arch/amd64/conf/``machineid''
9# after which you should do
10#	config machineid
11# Machine generic makefile changes should be made in
12#	/sys/arch/amd64/conf/Makefile.amd64
13# after which config should be rerun for all machines of that type.
14#
15# To specify debugging, add the config line: makeoptions DEBUG="-g"
16# A better way is to specify -g only for a few files.
17#
18#	makeoptions DEBUGLIST="uvm* trap if_*"
19
20MACHINE_ARCH=x86_64
21USETOOLS?=	no
22NEED_OWN_INSTALL_TARGET?=no
23.include <bsd.own.mk>
24
25USE_SSP?=	yes
26
27##
28## (1) port identification
29##
30AMD64=		$S/arch/amd64
31GENASSYM_CONF=	${AMD64}/amd64/genassym.cf
32
33##
34## (2) compile settings
35##
36DEFCOPTS=	-O2
37CPPFLAGS+=	-Damd64 -Dx86_64
38CFLAGS+=	-mcmodel=kernel
39CFLAGS+=	-mno-red-zone -mno-sse -mno-sse2 -mno-sse3
40
41##
42## (3) libkern and compat
43##
44OPT_MODULAR=	%MODULAR%
45.if !empty(OPT_MODULAR)
46KERN_AS=	obj
47.else
48KERN_AS=	library
49.endif
50
51##
52## (4) local objects, compile rules, and dependencies
53##
54MD_OBJS=	locore.o vector.o copy.o spl.o
55MD_CFILES=
56MD_SFILES=	${AMD64}/amd64/locore.S ${AMD64}/amd64/vector.S \
57		${AMD64}/amd64/copy.S ${AMD64}/amd64/spl.S
58
59locore.o: ${AMD64}/amd64/locore.S assym.h
60	${NORMAL_S}
61
62vector.o: ${AMD64}/amd64/vector.S assym.h
63	${NORMAL_S}
64
65copy.o: ${AMD64}/amd64/copy.S assym.h
66	${NORMAL_S}
67
68spl.o: ${AMD64}/amd64/spl.S assym.h
69	${NORMAL_S}
70
71AFLAGS.locore.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}
72AFLAGS.mptramp.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}
73AFLAGS.spl.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}
74
75##
76## (5) link settings
77##
78TEXTADDR?=	0xffffffff80100000
79EXTRA_LINKFLAGS=	-z max-page-size=0x100000
80LINKFLAGS_NORMAL=	-X
81KERN_LDSCRIPT?= kern.ldscript
82LINKFORMAT=	-T ${AMD64}/conf/${KERN_LDSCRIPT}
83
84##
85## (6) port specific target dependencies
86##
87
88# depend on CPU configuration
89locore.o machdep.o: Makefile
90
91acpi_wakeup_low.o amd64func.o busfunc.o cpufunc.o cpu_in_cksum.o: assym.h
92linux_support.o linux32_sigcode.o lock_stubs.o mptramp.o: assym.h
93netbsd32_sigcode.o: assym.h
94
95##
96## (7) misc settings
97##
98
99##
100## (8) config(8) generated machinery
101##
102%INCLUDES
103
104%OBJS
105
106%CFILES
107
108%SFILES
109
110%LOAD
111
112%RULES
113
114##
115## (9) port independent kernel machinery
116##
117.include "$S/conf/Makefile.kern.inc"
118
119## Include rules for ACPI wakecode
120.include "$S/arch/x86/acpi/Makefile.wakecode.inc"
121
122##
123## (10) Appending make options.
124##
125%MAKEOPTIONSAPPEND
126