1# $NetBSD: Makefile.amd64,v 1.55 2016/04/29 02:17:25 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/amd64/conf/``machineid'' 9# after which you should do 10# config machineid 11# Machine generic makefile changes should be made in 12# /sys/arch/amd64/conf/Makefile.amd64 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 20MACHINE_ARCH=x86_64 21USETOOLS?= no 22NEED_OWN_INSTALL_TARGET?=no 23.include <bsd.own.mk> 24 25USE_SSP?= yes 26 27## 28## (1) port identification 29## 30AMD64= $S/arch/amd64 31GENASSYM_CONF= ${AMD64}/amd64/genassym.cf 32 33## 34## (2) compile settings 35## 36DEFCOPTS= -O2 -fno-omit-frame-pointer 37CPPFLAGS+= -Damd64 -Dx86_64 38CFLAGS+= -mcmodel=kernel 39# -mno-sse implies -mno-sse2 (etc), explicitly disable avx to be extra sure 40CFLAGS+= -mno-red-zone -mno-mmx -mno-sse -mno-avx 41# make absolutely sure we don't get x87 registers used as well 42CFLAGS+= -msoft-float 43# For gcc we might need this, but other compilers barf 44# CFLAGS+= -mno-fp-ret-in-387 45 46## 47## (3) libkern and compat 48## 49OPT_MODULAR= %MODULAR% 50.if !empty(OPT_MODULAR) 51KERN_AS= obj 52.else 53KERN_AS= library 54.endif 55 56## 57## (4) local objects, compile rules, and dependencies 58## 59 60## 61## (5) link settings 62## 63TEXTADDR?= 0xffffffff80100000 64EXTRA_LINKFLAGS= -z max-page-size=0x100000 65LINKFLAGS_NORMAL= -X 66KERNLDSCRIPT?= ${AMD64}/conf/kern.ldscript 67 68## 69## (6) port specific target dependencies 70## 71 72# depend on CPU configuration 73locore.o machdep.o: Makefile 74 75acpi_wakeup_low.o amd64func.o busfunc.o cpufunc.o cpu_in_cksum.o: assym.h 76linux_support.o linux32_sigcode.o lock_stubs.o mptramp.o: assym.h 77netbsd32_sigcode.o: assym.h 78 79## 80## (7) misc settings 81## 82 83## 84## (8) config(8) generated machinery 85## 86%INCLUDES 87 88%OBJS 89 90%CFILES 91 92%SFILES 93 94%LOAD 95 96%RULES 97 98## 99## (9) port independent kernel machinery 100## 101.include "$S/conf/Makefile.kern.inc" 102 103## Include rules for ACPI wakecode 104.include "$S/arch/x86/acpi/Makefile.wakecode.inc" 105 106## 107## (10) Appending make options. 108## 109%MAKEOPTIONSAPPEND 110