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