Makefile.amd64 revision 1.16
1#	$NetBSD: Makefile.amd64,v 1.16 2007/10/17 19:53:03 garbled 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
25##
26## (1) port identification
27##
28AMD64=		$S/arch/amd64
29GENASSYM_CONF=	${AMD64}/amd64/genassym.cf
30
31##
32## (2) compile settings
33##
34DEFCOPTS=	-O2
35CPPFLAGS+=	-Damd64 -Dx86_64
36CFLAGS+=	-mcmodel=kernel
37CFLAGS+=	-mno-red-zone
38AFLAGS+=	-x assembler-with-cpp -traditional-cpp
39
40##
41## (3) libkern and compat
42##
43KERN_AS=	obj
44
45##
46## (4) local objects, compile rules, and dependencies
47##
48MD_OBJS=	locore.o vector.o copy.o spl.o
49MD_CFILES=
50MD_SFILES=	${AMD64}/amd64/locore.S ${AMD64}/amd64/vector.S \
51		${AMD64}/amd64/copy.S ${AMD64}/amd64/spl.S
52
53locore.o: ${AMD64}/amd64/locore.S assym.h
54	${NORMAL_S}
55
56vector.o: ${AMD64}/amd64/vector.S assym.h
57	${NORMAL_S}
58
59copy.o: ${AMD64}/amd64/copy.S assym.h
60	${NORMAL_S}
61
62spl.o: ${AMD64}/amd64/spl.S assym.h
63	${NORMAL_S}
64
65##
66## (5) link settings
67##
68TEXTADDR?=	0xffffffff80100000
69LINKFLAGS_NORMAL=	-X
70KERN_LDSCRIPT?= kern.ldscript
71LINKFORMAT=	-T ${AMD64}/conf/${KERN_LDSCRIPT}
72
73##
74## (6) port specific target dependencies
75##
76
77# depend on CPU configuration
78locore.o machdep.o: Makefile
79
80busfunc.o mptramp.o netbsd32_sigcode.o: assym.h
81clock.o: config_time.h
82
83##
84## (7) misc settings
85##
86
87##
88## (8) config(8) generated machinery
89##
90%INCLUDES
91
92%OBJS
93
94%CFILES
95
96%SFILES
97
98%LOAD
99
100%RULES
101## Include rules for Atheros WLAN
102.include "$S/contrib/dev/ath/netbsd/Makefile.ath.inc"
103
104
105
106# XXX -	Ugly, but make doesn't easily handle .o.uu (assumes it's a suffix)
107# XXX -	Also, config has no simple was to just add foo.o to the Makefile.
108#	It needs a pathname of some sort for "object"
109.if !empty(OBJS:M\/athhal.o)
110OBJS:=${OBJS:C/\/athhal.o/athhal.o/}
111
112.PATH: $S/contrib/dev/ath/public
113ATH_UUDEC?=	@${_MKSHMSG} "uudecode ${.CURDIR:T}/${.TARGET}"; \
114		${_MKSHECHO}\
115		${UUDECODE} -p $> \> ${.TARGET}; \
116		rm -f ${.TARGET}; \
117		${UUDECODE} -p $> > ${.TARGET}
118
119athhal.o: x86_64-elf.hal.o.uu
120	${ATH_UUDEC}
121.if defined(COPTS) && !empty(COPTS:M-fno-asynchronous-unwind-tables)
122	${_MKSHECHO}\
123	${OBJCOPY} -R .eh_frame $@
124	${OBJCOPY} -R .eh_frame $@
125.endif
126.endif
127
128##
129## (9) port independent kernel machinery
130##
131.include "$S/conf/Makefile.kern.inc"
132
133##
134## (10) Appending make options.
135##
136%MAKEOPTIONSAPPEND
137