Makefile.i386 revision 1.196
1#	$NetBSD: Makefile.i386,v 1.196 2020/05/11 15:15:15 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
20NOSANITIZER=	# defined
21MACHINE_ARCH=	i386
22USETOOLS?=	no
23NEED_OWN_INSTALL_TARGET?=no
24.include <bsd.own.mk>
25
26USE_SSP?=	yes
27
28##
29## (1) port identification
30##
31I386=		$S/arch/i386
32GENASSYM_CONF=	${I386}/i386/genassym.cf
33
34##
35## (2) compile settings
36##
37DEFCOPTS=	-O2 -fno-omit-frame-pointer
38CPPFLAGS+=	-Di386
39CFLAGS+=	-msoft-float
40## no-sse implies no-sse2 but not no-avx
41CFLAGS+=	-mno-mmx -mno-sse -mno-avx
42
43.if ${SPECTRE_V2_GCC_MITIGATION:U0} > 0
44CFLAGS+=	${${ACTIVE_CC} == "gcc" :? -mindirect-branch=thunk :}
45CFLAGS+=	${${ACTIVE_CC} == "gcc" :? -mindirect-branch-register :}
46.endif
47EXTRA_INCLUDES= -I$S/external/mit/xen-include-public/dist/
48
49##
50## (3) libkern and compat
51##
52OPT_MODULAR=	%MODULAR%
53
54##
55## (4) local objects, compile rules, and dependencies
56##
57MD_OBJS=	locore.o copy.o spl.o vector.o lock_stubs.o
58MD_CFILES=
59MD_SFILES=	${I386}/i386/locore.S ${I386}/i386/copy.S ${I386}/i386/spl.S \
60		${I386}/i386/vector.S ${I386}/i386/lock_stubs.S
61
62locore.o: ${I386}/i386/locore.S assym.h
63	${NORMAL_S}
64
65copy.o: ${I386}/i386/copy.S assym.h
66	${NORMAL_S}
67
68spl.o: ${I386}/i386/spl.S assym.h
69	${NORMAL_S}
70
71vector.o: ${I386}/i386/vector.S assym.h
72	${NORMAL_S}
73
74lock_stubs.o: ${I386}/i386/lock_stubs.S assym.h
75	${NORMAL_S}
76
77##
78## (5) link settings
79##
80TEXTADDR?=	c0100000
81LINKFLAGS_NORMAL=	-X
82KERNLDSCRIPT?=	${I386}/conf/kern.ldscript
83
84##
85## (6) port specific target dependencies
86##
87
88i386func.o: assym.h
89linux_sigcode.o lock_stubs.o: assym.h
90cpufunc.o cpu_in_cksum.o pnpbioscall.o bioscall.o: assym.h
91mptramp.o: assym.h
92acpi_wakeup_low.o busfunc.o: assym.h
93
94##
95## (7) misc settings
96##
97
98.if !make(obj) && !make(clean) && !make(cleandir)
99.BEGIN::
100	-@rm -f i386 && \
101		ln -s $S/arch/i386/include i386
102.endif
103
104##
105## (8) config(8) generated machinery
106##
107%INCLUDES
108
109%OBJS
110
111%CFILES
112
113%SFILES
114
115%LOAD
116
117%RULES
118
119##
120## (9) port independent kernel machinery
121##
122.include "$S/conf/Makefile.kern.inc"
123
124## Include rules for ACPI wakecode
125.include "$S/arch/x86/acpi/Makefile.wakecode.inc"
126
127##
128## (10) Appending make options.
129##
130%MAKEOPTIONSAPPEND
131