Makefile.i386 revision 1.192
11.192Schristos#	$NetBSD: Makefile.i386,v 1.192 2018/06/04 20:28:44 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.192SchristosNORELRO=	# defined
221.119SatatatMACHINE_ARCH=	i386
231.118SjmcUSETOOLS?=	no
241.119SatatatNEED_OWN_INSTALL_TARGET?=no
251.119Satatat.include <bsd.own.mk>
261.42Smycroft
271.166StronUSE_SSP?=	yes
281.166Stron
291.119Satatat##
301.119Satatat## (1) port identification
311.119Satatat##
321.119SatatatI386=		$S/arch/i386
331.138SchristosGENASSYM_CONF=	${I386}/i386/genassym.cf
341.119Satatat
351.119Satatat##
361.119Satatat## (2) compile settings
371.119Satatat##
381.182SjakllschDEFCOPTS=	-O2 -fno-omit-frame-pointer
391.121SatatatCPPFLAGS+=	-Di386
401.189SmaxvCFLAGS+=	-msoft-float
411.180Sdsl## no-sse implies no-sse2 but not no-avx
421.180SdslCFLAGS+=	-mno-mmx -mno-sse -mno-avx
431.170Sjoerg
441.191Smartin.if ${SPECTRE_V2_GCC_MITIGATION:U0} > 0 && ${HAVE_GCC:U0} > 0
451.190SmrgCFLAGS+=	-mindirect-branch=thunk
461.190SmrgCFLAGS+=	-mindirect-branch-register
471.190Smrg.endif
481.190Smrg
491.119Satatat##
501.120Slukem## (3) libkern and compat
511.119Satatat##
521.164ScubeOPT_MODULAR=	%MODULAR%
531.163Sapb.if !empty(OPT_MODULAR)
541.119SatatatKERN_AS=	obj
551.137Sdsl.else
561.137SdslKERN_AS=	library
571.137Sdsl.endif
581.62Smycroft
591.119Satatat##
601.119Satatat## (4) local objects, compile rules, and dependencies
611.119Satatat##
621.150SchristosMD_OBJS=	locore.o copy.o spl.o vector.o lock_stubs.o
631.119SatatatMD_CFILES=
641.141SyamtMD_SFILES=	${I386}/i386/locore.S ${I386}/i386/copy.S ${I386}/i386/spl.S \
651.150Schristos		${I386}/i386/vector.S ${I386}/i386/lock_stubs.S
661.1Scgd
671.125Sfvdllocore.o: ${I386}/i386/locore.S assym.h
681.125Sfvdl	${NORMAL_S}
691.125Sfvdl
701.141Syamtcopy.o: ${I386}/i386/copy.S assym.h
711.141Syamt	${NORMAL_S}
721.141Syamt
731.125Sfvdlspl.o: ${I386}/i386/spl.S assym.h
741.125Sfvdl	${NORMAL_S}
751.125Sfvdl
761.125Sfvdlvector.o: ${I386}/i386/vector.S assym.h
771.129Schristos	${NORMAL_S}
781.129Schristos
791.150Schristoslock_stubs.o: ${I386}/i386/lock_stubs.S assym.h
801.150Schristos	${NORMAL_S}
811.150Schristos
821.119Satatat##
831.119Satatat## (5) link settings
841.119Satatat##
851.116SthorpejTEXTADDR?=	c0100000
861.122SatatatLINKFLAGS_NORMAL=	-X
871.184SuebayasiKERNLDSCRIPT?=	${I386}/conf/kern.ldscript
881.107Sthorpej
891.119Satatat##
901.119Satatat## (6) port specific target dependencies
911.119Satatat##
921.98Smrg
931.186Smaxvi386func.o: assym.h
941.186Smaxvlinux_sigcode.o lock_stubs.o: assym.h
951.177Sdslcpufunc.o cpu_in_cksum.o pnpbioscall.o bioscall.o: assym.h
961.132Ssimonbmptramp.o: assym.h
971.178Sdslacpi_wakeup_low.o busfunc.o: assym.h
981.119Satatat
991.119Satatat##
1001.119Satatat## (7) misc settings
1011.119Satatat##
1021.119Satatat
1031.165Stsutsui.if !make(obj) && !make(clean) && !make(cleandir)
1041.187Schristos.BEGIN::
1051.187Schristos	-@rm -f i386 && \
1061.159Smrg		ln -s $S/arch/i386/include i386
1071.159Smrg.endif
1081.159Smrg
1091.119Satatat##
1101.119Satatat## (8) config(8) generated machinery
1111.119Satatat##
1121.98Smrg%INCLUDES
1131.74Smycroft
1141.1Scgd%OBJS
1151.1Scgd
1161.1Scgd%CFILES
1171.1Scgd
1181.62Smycroft%SFILES
1191.62Smycroft
1201.1Scgd%LOAD
1211.50Smycroft
1221.119Satatat%RULES
1231.1Scgd
1241.119Satatat##
1251.119Satatat## (9) port independent kernel machinery
1261.119Satatat##
1271.119Satatat.include "$S/conf/Makefile.kern.inc"
1281.135Sthorpej
1291.175Schristos## Include rules for ACPI wakecode
1301.175Schristos.include "$S/arch/x86/acpi/Makefile.wakecode.inc"
1311.175Schristos
1321.135Sthorpej##
1331.135Sthorpej## (10) Appending make options.
1341.135Sthorpej##
1351.135Sthorpej%MAKEOPTIONSAPPEND
136