Makefile.i386 revision 1.167
1#	$NetBSD: Makefile.i386,v 1.167 2010/07/06 05:59:59 mrg 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 -traditional-cpp
38
39##
40## (3) libkern and compat
41##
42OPT_MODULAR=	%MODULAR%
43.if !empty(OPT_MODULAR)
44KERN_AS=	obj
45.else
46KERN_AS=	library
47.endif
48
49##
50## (4) local objects, compile rules, and dependencies
51##
52MD_OBJS=	locore.o copy.o spl.o vector.o lock_stubs.o
53MD_CFILES=
54MD_SFILES=	${I386}/i386/locore.S ${I386}/i386/copy.S ${I386}/i386/spl.S \
55		${I386}/i386/vector.S ${I386}/i386/lock_stubs.S
56
57locore.o: ${I386}/i386/locore.S assym.h
58	${NORMAL_S}
59
60copy.o: ${I386}/i386/copy.S assym.h
61	${NORMAL_S}
62
63spl.o: ${I386}/i386/spl.S assym.h
64	${NORMAL_S}
65
66vector.o: ${I386}/i386/vector.S assym.h
67	${NORMAL_S}
68
69lock_stubs.o: ${I386}/i386/lock_stubs.S assym.h
70	${NORMAL_S}
71
72##
73## (5) link settings
74##
75TEXTADDR?=	c0100000
76LINKFLAGS_NORMAL=	-X
77KERN_LDSCRIPT?=	kern.ldscript
78LINKFORMAT=	-T ${I386}/conf/${KERN_LDSCRIPT}
79
80##
81## (6) port specific target dependencies
82##
83
84freebsd_sigcode.o i386func.o ibcs2_sigcode.o linux_support.o: assym.h
85linux_sigcode.o lock_stubs.o svr4_sigcode.o mach_sigcode.o: assym.h
86apmcall.o cpufunc.o cpu_in_cksum.o pnpbioscall.o bioscall.o: assym.h
87mptramp.o: assym.h
88acpi_wakeup_low.o busfunc.o kvm86call.o: assym.h
89
90##
91## (7) misc settings
92##
93
94.if !make(obj) && !make(clean) && !make(cleandir)
95.BEGIN:
96	@rm -f i386 && \
97		ln -s $S/arch/i386/include i386
98.endif
99
100##
101## (8) config(8) generated machinery
102##
103%INCLUDES
104
105%OBJS
106
107%CFILES
108
109%SFILES
110
111%LOAD
112
113%RULES
114
115## Include rules for ACPI wakecode
116.include "$S/arch/x86/acpi/Makefile.wakecode.inc"
117
118##
119## (9) port independent kernel machinery
120##
121.include "$S/conf/Makefile.kern.inc"
122
123##
124## (10) Appending make options.
125##
126%MAKEOPTIONSAPPEND
127