xref: /netbsd/sys/arch/amd64/conf/Makefile.amd64 (revision 3c479c5a)
1*3c479c5aSchristos#	$NetBSD: Makefile.amd64,v 1.41 2012/12/14 16:37:55 christos 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##
36041046e7SfvdlDEFCOPTS=	-O2
3781918bf8SfvdlCPPFLAGS+=	-Damd64 -Dx86_64
3881918bf8SfvdlCFLAGS+=	-mcmodel=kernel
390e47d1b7SjoergCFLAGS+=	-mno-red-zone -mno-sse -mno-sse2 -mno-sse3
4081918bf8Sfvdl
4181918bf8Sfvdl##
4281918bf8Sfvdl## (3) libkern and compat
4381918bf8Sfvdl##
44*3c479c5aSchristosOPT_MODULAR=	%MODULAR%
45*3c479c5aSchristos.if !empty(OPT_MODULAR)
4681918bf8SfvdlKERN_AS=	obj
47*3c479c5aSchristos.else
48*3c479c5aSchristosKERN_AS=	library
49*3c479c5aSchristos.endif
5081918bf8Sfvdl
5181918bf8Sfvdl##
5281918bf8Sfvdl## (4) local objects, compile rules, and dependencies
5381918bf8Sfvdl##
5409b51ec9SkardelMD_OBJS=	locore.o vector.o copy.o spl.o
5581918bf8SfvdlMD_CFILES=
5681918bf8SfvdlMD_SFILES=	${AMD64}/amd64/locore.S ${AMD64}/amd64/vector.S \
5709b51ec9Skardel		${AMD64}/amd64/copy.S ${AMD64}/amd64/spl.S
5881918bf8Sfvdl
5981918bf8Sfvdllocore.o: ${AMD64}/amd64/locore.S assym.h
6081918bf8Sfvdl	${NORMAL_S}
6181918bf8Sfvdl
6281918bf8Sfvdlvector.o: ${AMD64}/amd64/vector.S assym.h
6381918bf8Sfvdl	${NORMAL_S}
6481918bf8Sfvdl
6581918bf8Sfvdlcopy.o: ${AMD64}/amd64/copy.S assym.h
6681918bf8Sfvdl	${NORMAL_S}
6781918bf8Sfvdl
6881918bf8Sfvdlspl.o: ${AMD64}/amd64/spl.S assym.h
6981918bf8Sfvdl	${NORMAL_S}
7081918bf8Sfvdl
716d3869b8SjoergAFLAGS.locore.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}
726d3869b8SjoergAFLAGS.mptramp.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}
73e7109671SjoergAFLAGS.spl.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}
7475ef25b5Sjoerg
7581918bf8Sfvdl##
7681918bf8Sfvdl## (5) link settings
7781918bf8Sfvdl##
7881918bf8SfvdlTEXTADDR?=	0xffffffff80100000
79980b1066SskrllEXTRA_LINKFLAGS=	-z max-page-size=0x100000
8081918bf8SfvdlLINKFLAGS_NORMAL=	-X
8181918bf8SfvdlKERN_LDSCRIPT?= kern.ldscript
8281918bf8SfvdlLINKFORMAT=	-T ${AMD64}/conf/${KERN_LDSCRIPT}
8381918bf8Sfvdl
8481918bf8Sfvdl##
8581918bf8Sfvdl## (6) port specific target dependencies
8681918bf8Sfvdl##
8781918bf8Sfvdl
8881918bf8Sfvdl# depend on CPU configuration
8981918bf8Sfvdllocore.o machdep.o: Makefile
9081918bf8Sfvdl
9177a5d439Sjoergacpi_wakeup_low.o amd64func.o busfunc.o cpufunc.o cpu_in_cksum.o: assym.h
9277a5d439Sjoerglinux_support.o linux32_sigcode.o lock_stubs.o mptramp.o: assym.h
9377a5d439Sjoergnetbsd32_sigcode.o: assym.h
9481918bf8Sfvdl
9581918bf8Sfvdl##
9681918bf8Sfvdl## (7) misc settings
9781918bf8Sfvdl##
9881918bf8Sfvdl
9981918bf8Sfvdl##
10081918bf8Sfvdl## (8) config(8) generated machinery
10181918bf8Sfvdl##
10281918bf8Sfvdl%INCLUDES
10381918bf8Sfvdl
10481918bf8Sfvdl%OBJS
10581918bf8Sfvdl
10681918bf8Sfvdl%CFILES
10781918bf8Sfvdl
10881918bf8Sfvdl%SFILES
10981918bf8Sfvdl
11081918bf8Sfvdl%LOAD
11181918bf8Sfvdl
11281918bf8Sfvdl%RULES
11331f44cb2Salc
11481918bf8Sfvdl##
11581918bf8Sfvdl## (9) port independent kernel machinery
11681918bf8Sfvdl##
11781918bf8Sfvdl.include "$S/conf/Makefile.kern.inc"
118e33c2bb5Sthorpej
1191b91baa7Schristos## Include rules for ACPI wakecode
1201b91baa7Schristos.include "$S/arch/x86/acpi/Makefile.wakecode.inc"
1211b91baa7Schristos
122e33c2bb5Sthorpej##
123e33c2bb5Sthorpej## (10) Appending make options.
124e33c2bb5Sthorpej##
125e33c2bb5Sthorpej%MAKEOPTIONSAPPEND
126