11.197Schristos#	$NetBSD: Makefile.i386,v 1.197 2023/01/06 15:35:05 christos Exp $
21.62Smycroft
31.8Scgd# Makefile for NetBSD
41.1Scgd#
51.1Scgd# This makefile is constructed from a machine description:
61.1Scgd#	config machineid
71.1Scgd# Most changes should be made in the machine description
81.36Sderaadt#	/sys/arch/i386/conf/``machineid''
91.1Scgd# after which you should do
101.62Smycroft#	config machineid
111.62Smycroft# Machine generic makefile changes should be made in
121.36Sderaadt#	/sys/arch/i386/conf/Makefile.i386
131.42Smycroft# after which config should be rerun for all machines of that type.
141.119Satatat#
151.120Slukem# To specify debugging, add the config line: makeoptions DEBUG="-g"
161.119Satatat# A better way is to specify -g only for a few files.
171.119Satatat#
181.119Satatat#	makeoptions DEBUGLIST="uvm* trap if_*"
191.117Sthorpej
201.192SchristosNOSANITIZER=	# defined
211.119SatatatMACHINE_ARCH=	i386
221.118SjmcUSETOOLS?=	no
231.119SatatatNEED_OWN_INSTALL_TARGET?=no
241.119Satatat.include <bsd.own.mk>
251.42Smycroft
261.166StronUSE_SSP?=	yes
271.166Stron
281.119Satatat##
291.119Satatat## (1) port identification
301.119Satatat##
311.119SatatatI386=		$S/arch/i386
321.138SchristosGENASSYM_CONF=	${I386}/i386/genassym.cf
331.119Satatat
341.119Satatat##
351.119Satatat## (2) compile settings
361.119Satatat##
371.182SjakllschDEFCOPTS=	-O2 -fno-omit-frame-pointer
381.121SatatatCPPFLAGS+=	-Di386
391.189SmaxvCFLAGS+=	-msoft-float
401.180Sdsl## no-sse implies no-sse2 but not no-avx
411.180SdslCFLAGS+=	-mno-mmx -mno-sse -mno-avx
421.170Sjoerg
431.196Sjoerg.if ${SPECTRE_V2_GCC_MITIGATION:U0} > 0
441.196SjoergCFLAGS+=	${${ACTIVE_CC} == "gcc" :? -mindirect-branch=thunk :}
451.196SjoergCFLAGS+=	${${ACTIVE_CC} == "gcc" :? -mindirect-branch-register :}
461.190Smrg.endif
471.195SbouyerEXTRA_INCLUDES= -I$S/external/mit/xen-include-public/dist/
481.197SchristosEXTRA_LINKFLAGS= -z noseparate-code
491.190Smrg
501.119Satatat##
511.120Slukem## (3) libkern and compat
521.119Satatat##
531.164ScubeOPT_MODULAR=	%MODULAR%
541.62Smycroft
551.119Satatat##
561.119Satatat## (4) local objects, compile rules, and dependencies
571.119Satatat##
581.150SchristosMD_OBJS=	locore.o copy.o spl.o vector.o lock_stubs.o
591.119SatatatMD_CFILES=
601.141SyamtMD_SFILES=	${I386}/i386/locore.S ${I386}/i386/copy.S ${I386}/i386/spl.S \
611.150Schristos		${I386}/i386/vector.S ${I386}/i386/lock_stubs.S
621.1Scgd
631.125Sfvdllocore.o: ${I386}/i386/locore.S assym.h
641.125Sfvdl	${NORMAL_S}
651.125Sfvdl
661.141Syamtcopy.o: ${I386}/i386/copy.S assym.h
671.141Syamt	${NORMAL_S}
681.141Syamt
691.125Sfvdlspl.o: ${I386}/i386/spl.S assym.h
701.125Sfvdl	${NORMAL_S}
711.125Sfvdl
721.125Sfvdlvector.o: ${I386}/i386/vector.S assym.h
731.129Schristos	${NORMAL_S}
741.129Schristos
751.150Schristoslock_stubs.o: ${I386}/i386/lock_stubs.S assym.h
761.150Schristos	${NORMAL_S}
771.150Schristos
781.119Satatat##
791.119Satatat## (5) link settings
801.119Satatat##
811.116SthorpejTEXTADDR?=	c0100000
821.122SatatatLINKFLAGS_NORMAL=	-X
831.184SuebayasiKERNLDSCRIPT?=	${I386}/conf/kern.ldscript
841.107Sthorpej
851.119Satatat##
861.119Satatat## (6) port specific target dependencies
871.119Satatat##
881.98Smrg
891.186Smaxvi386func.o: assym.h
901.186Smaxvlinux_sigcode.o lock_stubs.o: assym.h
911.177Sdslcpufunc.o cpu_in_cksum.o pnpbioscall.o bioscall.o: assym.h
921.132Ssimonbmptramp.o: assym.h
931.178Sdslacpi_wakeup_low.o busfunc.o: assym.h
941.119Satatat
951.119Satatat##
961.119Satatat## (7) misc settings
971.119Satatat##
981.119Satatat
991.165Stsutsui.if !make(obj) && !make(clean) && !make(cleandir)
1001.187Schristos.BEGIN::
1011.187Schristos	-@rm -f i386 && \
1021.159Smrg		ln -s $S/arch/i386/include i386
1031.159Smrg.endif
1041.159Smrg
1051.119Satatat##
1061.119Satatat## (8) config(8) generated machinery
1071.119Satatat##
1081.98Smrg%INCLUDES
1091.74Smycroft
1101.1Scgd%OBJS
1111.1Scgd
1121.1Scgd%CFILES
1131.1Scgd
1141.62Smycroft%SFILES
1151.62Smycroft
1161.1Scgd%LOAD
1171.50Smycroft
1181.119Satatat%RULES
1191.1Scgd
1201.119Satatat##
1211.119Satatat## (9) port independent kernel machinery
1221.119Satatat##
1231.119Satatat.include "$S/conf/Makefile.kern.inc"
1241.135Sthorpej
1251.175Schristos## Include rules for ACPI wakecode
1261.175Schristos.include "$S/arch/x86/acpi/Makefile.wakecode.inc"
1271.175Schristos
1281.135Sthorpej##
1291.135Sthorpej## (10) Appending make options.
1301.135Sthorpej##
1311.135Sthorpej%MAKEOPTIONSAPPEND
132