xref: /netbsd/sys/arch/amd64/conf/Makefile.amd64 (revision 681da605)
1*681da605Smaxv#	$NetBSD: Makefile.amd64,v 1.60 2017/11/01 09:31:24 maxv Exp $
281918bf8Sfvdl
381918bf8Sfvdl# Makefile for NetBSD
481918bf8Sfvdl#
581918bf8Sfvdl# This makefile is constructed from a machine description:
681918bf8Sfvdl#	config machineid
781918bf8Sfvdl# Most changes should be made in the machine description
881918bf8Sfvdl#	/sys/arch/amd64/conf/``machineid''
981918bf8Sfvdl# after which you should do
1081918bf8Sfvdl#	config machineid
1181918bf8Sfvdl# Machine generic makefile changes should be made in
1281918bf8Sfvdl#	/sys/arch/amd64/conf/Makefile.amd64
1381918bf8Sfvdl# after which config should be rerun for all machines of that type.
1481918bf8Sfvdl#
1581918bf8Sfvdl# To specify debugging, add the config line: makeoptions DEBUG="-g"
1681918bf8Sfvdl# A better way is to specify -g only for a few files.
1781918bf8Sfvdl#
1881918bf8Sfvdl#	makeoptions DEBUGLIST="uvm* trap if_*"
1981918bf8Sfvdl
2081918bf8SfvdlMACHINE_ARCH=x86_64
2181918bf8SfvdlUSETOOLS?=	no
2281918bf8SfvdlNEED_OWN_INSTALL_TARGET?=no
2381918bf8Sfvdl.include <bsd.own.mk>
2481918bf8Sfvdl
2573950688StronUSE_SSP?=	yes
2673950688Stron
2781918bf8Sfvdl##
2881918bf8Sfvdl## (1) port identification
2981918bf8Sfvdl##
3081918bf8SfvdlAMD64=		$S/arch/amd64
31f6b4c20fSchristosGENASSYM_CONF=	${AMD64}/amd64/genassym.cf
3281918bf8Sfvdl
3381918bf8Sfvdl##
3481918bf8Sfvdl## (2) compile settings
3581918bf8Sfvdl##
36a4cdc791SjakllschDEFCOPTS=	-O2 -fno-omit-frame-pointer
3781918bf8SfvdlCPPFLAGS+=	-Damd64 -Dx86_64
3881918bf8SfvdlCFLAGS+=	-mcmodel=kernel
398e4cbbd3Sdsl# -mno-sse implies -mno-sse2 (etc), explicitly disable avx to be extra sure
40d74c3e3bSdslCFLAGS+=	-mno-red-zone -mno-mmx -mno-sse -mno-avx
41d74c3e3bSdsl# make absolutely sure we don't get x87 registers used as well
428e4cbbd3SdslCFLAGS+=	-msoft-float
438e4cbbd3Sdsl# For gcc we might need this, but other compilers barf
448e4cbbd3Sdsl# CFLAGS+=	-mno-fp-ret-in-387
4581918bf8Sfvdl
4681918bf8Sfvdl##
4781918bf8Sfvdl## (3) libkern and compat
4881918bf8Sfvdl##
493c479c5aSchristosOPT_MODULAR=	%MODULAR%
503c479c5aSchristos.if !empty(OPT_MODULAR)
5181918bf8SfvdlKERN_AS=	obj
523c479c5aSchristos.else
533c479c5aSchristosKERN_AS=	library
543c479c5aSchristos.endif
5581918bf8Sfvdl
5681918bf8Sfvdl##
5781918bf8Sfvdl## (4) local objects, compile rules, and dependencies
5881918bf8Sfvdl##
5981918bf8Sfvdl
6081918bf8Sfvdl##
6181918bf8Sfvdl## (5) link settings
6281918bf8Sfvdl##
637276bb8bSmaxvTEXTADDR?=	0xffffffff80200000
6470dee003Smaxv.if defined(KASLR)
6570dee003SmaxvEXTRA_LINKFLAGS=	-z max-page-size=0x200000 -r -d
6670dee003Smaxv.else
67e5b5f123SmaxvEXTRA_LINKFLAGS=	-z max-page-size=0x200000
6870dee003Smaxv.endif
6981918bf8SfvdlLINKFLAGS_NORMAL=	-X
7062c59b6eSuebayasiKERNLDSCRIPT?= ${AMD64}/conf/kern.ldscript
7181918bf8Sfvdl
7281918bf8Sfvdl##
7381918bf8Sfvdl## (6) port specific target dependencies
7481918bf8Sfvdl##
7581918bf8Sfvdl
7681918bf8Sfvdl# depend on CPU configuration
7781918bf8Sfvdllocore.o machdep.o: Makefile
7881918bf8Sfvdl
7977a5d439Sjoergacpi_wakeup_low.o amd64func.o busfunc.o cpufunc.o cpu_in_cksum.o: assym.h
80*681da605Smaxvlinux_sigcode.o linux32_sigcode.o lock_stubs.o mptramp.o: assym.h
8177a5d439Sjoergnetbsd32_sigcode.o: assym.h
8281918bf8Sfvdl
8381918bf8Sfvdl##
8481918bf8Sfvdl## (7) misc settings
8581918bf8Sfvdl##
8681918bf8Sfvdl
8781918bf8Sfvdl##
8881918bf8Sfvdl## (8) config(8) generated machinery
8981918bf8Sfvdl##
9081918bf8Sfvdl%INCLUDES
9181918bf8Sfvdl
9281918bf8Sfvdl%OBJS
9381918bf8Sfvdl
9481918bf8Sfvdl%CFILES
9581918bf8Sfvdl
9681918bf8Sfvdl%SFILES
9781918bf8Sfvdl
9881918bf8Sfvdl%LOAD
9981918bf8Sfvdl
10081918bf8Sfvdl%RULES
10131f44cb2Salc
10281918bf8Sfvdl##
10381918bf8Sfvdl## (9) port independent kernel machinery
10481918bf8Sfvdl##
10581918bf8Sfvdl.include "$S/conf/Makefile.kern.inc"
106e33c2bb5Sthorpej
1071b91baa7Schristos## Include rules for ACPI wakecode
1081b91baa7Schristos.include "$S/arch/x86/acpi/Makefile.wakecode.inc"
1091b91baa7Schristos
110e33c2bb5Sthorpej##
111e33c2bb5Sthorpej## (10) Appending make options.
112e33c2bb5Sthorpej##
113e33c2bb5Sthorpej%MAKEOPTIONSAPPEND
114