Makefile.i386 revision 1.169
1#	$NetBSD: Makefile.i386,v 1.169 2011/05/20 13:22:30 joerg 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/i386/conf/``machineid''
9# after which you should do
10#	config machineid
11# Machine generic makefile changes should be made in
12#	/sys/arch/i386/conf/Makefile.i386
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=	i386
21USETOOLS?=	no
22NEED_OWN_INSTALL_TARGET?=no
23.include <bsd.own.mk>
24
25USE_SSP?=	yes
26
27##
28## (1) port identification
29##
30I386=		$S/arch/i386
31GENASSYM_CONF=	${I386}/i386/genassym.cf
32
33##
34## (2) compile settings
35##
36CPPFLAGS+=	-Di386
37AFLAGS+=	-x assembler-with-cpp
38AFLAGS.mptramp.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}
39
40##
41## (3) libkern and compat
42##
43OPT_MODULAR=	%MODULAR%
44.if !empty(OPT_MODULAR)
45KERN_AS=	obj
46.else
47KERN_AS=	library
48.endif
49
50##
51## (4) local objects, compile rules, and dependencies
52##
53MD_OBJS=	locore.o copy.o spl.o vector.o lock_stubs.o
54MD_CFILES=
55MD_SFILES=	${I386}/i386/locore.S ${I386}/i386/copy.S ${I386}/i386/spl.S \
56		${I386}/i386/vector.S ${I386}/i386/lock_stubs.S
57
58locore.o: ${I386}/i386/locore.S assym.h
59	${NORMAL_S}
60
61copy.o: ${I386}/i386/copy.S assym.h
62	${NORMAL_S}
63
64spl.o: ${I386}/i386/spl.S assym.h
65	${NORMAL_S}
66
67vector.o: ${I386}/i386/vector.S assym.h
68	${NORMAL_S}
69
70lock_stubs.o: ${I386}/i386/lock_stubs.S assym.h
71	${NORMAL_S}
72
73##
74## (5) link settings
75##
76TEXTADDR?=	c0100000
77LINKFLAGS_NORMAL=	-X
78KERN_LDSCRIPT?=	kern.ldscript
79LINKFORMAT=	-T ${I386}/conf/${KERN_LDSCRIPT}
80
81##
82## (6) port specific target dependencies
83##
84
85freebsd_sigcode.o i386func.o ibcs2_sigcode.o linux_support.o: assym.h
86linux_sigcode.o lock_stubs.o svr4_sigcode.o mach_sigcode.o: assym.h
87apmcall.o cpufunc.o cpu_in_cksum.o pnpbioscall.o bioscall.o: assym.h
88mptramp.o: assym.h
89acpi_wakeup_low.o busfunc.o kvm86call.o: assym.h
90
91##
92## (7) misc settings
93##
94
95.if !make(obj) && !make(clean) && !make(cleandir)
96.BEGIN:
97	@rm -f i386 && \
98		ln -s $S/arch/i386/include i386
99.endif
100
101##
102## (8) config(8) generated machinery
103##
104%INCLUDES
105
106%OBJS
107
108%CFILES
109
110%SFILES
111
112%LOAD
113
114%RULES
115
116## Include rules for ACPI wakecode
117.include "$S/arch/x86/acpi/Makefile.wakecode.inc"
118
119##
120## (9) port independent kernel machinery
121##
122.include "$S/conf/Makefile.kern.inc"
123
124##
125## (10) Appending make options.
126##
127%MAKEOPTIONSAPPEND
128