NetBSD/sys/arch/xen/conf/Makefile.xen
tron 7395068839 Enable SSP (Stack Smash Protection) in x86 kernels by default (except
in i386 *TINY kernels). The NetBSD/i386 "ALL" kernel is unconditionally
compiled with SSP enabled.

Change approved by the core team.
2009-11-25 17:08:08 +00:00

154 lines
3.1 KiB
Makefile

# $NetBSD: Makefile.xen,v 1.29 2009/11/25 17:08:09 tron Exp $
# NetBSD: Makefile.i386,v 1.132 2003/07/05 16:56:10 simonb Exp
# Makefile for NetBSD
#
# This makefile is constructed from a machine description:
# config machineid
# Most changes should be made in the machine description
# /sys/arch/xen/conf/``machineid''
# after which you should do
# config machineid
# Machine generic makefile changes should be made in
# /sys/arch/xen/conf/Makefile.xen
# after which config should be rerun for all machines of that type.
#
# To specify debugging, add the config line: makeoptions DEBUG="-g"
# A better way is to specify -g only for a few files.
#
# makeoptions DEBUGLIST="uvm* trap if_*"
.include "$S/arch/xen/conf/Makefile.arch.inc"
USETOOLS?= no
NEED_OWN_INSTALL_TARGET?=no
.include <bsd.own.mk>
USE_SSP?= yes
##
## (1) port identification
##
XEN= $S/arch/xen
I386= $S/arch/i386
AMD64= $S/arch/amd64
GENASSYM_CONF= $S/arch/${XEN_BUILD}/${XEN_BUILD}/genassym.cf
ARCH_INC= $S/arch/xen/include/${XEN_BUILD}
##
## (2) compile settings
##
DEFCOPTS= -O2
CPPFLAGS+= -D${XEN_BUILD}
AFLAGS+= -x assembler-with-cpp -traditional-cpp ${DBG} -D__XEN__
EXTRA_INCLUDES= -I${.CURDIR}/xen-ma
.if ${XEN_BUILD} == "amd64"
CPPFLAGS+= -Dx86_64
CFLAGS+= -mcmodel=kernel
CFLAGS+= -mno-red-zone
.endif
##
## (3) libkern and compat
##
KERN_AS= obj
##
## (4) local objects, compile rules, and dependencies
##
MD_OBJS= locore.o spl.o copy.o vector.o
MD_CFILES=
MD_SFILES= $S/arch/${XEN_BUILD}/${XEN_BUILD}/locore.S \
$S/arch/${XEN_BUILD}/${XEN_BUILD}/spl.S \
$S/arch/${XEN_BUILD}/${XEN_BUILD}/vector.S \
$S/arch/${XEN_BUILD}/${XEN_BUILD}/copy.S
copy.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/copy.S assym.h
${NORMAL_S}
locore.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/locore.S assym.h
${NORMAL_S}
spl.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/spl.S assym.h
${NORMAL_S}
vector.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/vector.S assym.h
${NORMAL_S}
.ifndef noBEGIN
.if !make(obj) && !make(clean) && !make(cleandir)
.BEGIN:
.for A in ${XEN_MACHINE_ARCHS}
rm -f ${A}
ln -s $S/arch/${A}/include ${A}
.endfor
-rm -rf xen-ma
mkdir xen-ma
ln -s ../${XEN_BUILD} xen-ma/machine
rm -f machine
ln -s ${ARCH_INC} machine
.endif
.endif
##
## (5) link settings
##
.if ${XEN_BUILD} == i386
TEXTADDR?= 0xc0100000
.elif ${XEN_BUILD} == amd64
TEXTADDR?= 0xffffffff80100000
.endif
LINKFLAGS_NORMAL= -X
.if (${OBJECT_FMT} == "ELF")
KERN_LDSCRIPT?= kern.ldscript.Xen
LINKFORMAT= -T $S/arch/${XEN_BUILD}/conf/${KERN_LDSCRIPT}
.else
LINKFORMAT= -z
.endif
##
## (6) port specific target dependencies
##
.if ${XEN_BUILD} == i386
freebsd_sigcode.o ibcs2_sigcode.o linux_sigcode.o: assym.h
svr4_sigcode.o mach_sigcode.o: assym.h
apmcall.o pnpbioscall.o bioscall.o: assym.h
mptramp.o: assym.h
.elif ${XEN_BUILD} == amd64
locore.o machdep.o: Makefile
linux_support.o linux32_sigcode.o netbsd32_sigcode.o: assym.h
.endif
busfunc.o cpu_in_cksum.o cpufunc.o lock_stubs.o: assym.h
##
## (7) misc settings
##
##
## (8) config(8) generated machinery
##
%INCLUDES
%OBJS
%CFILES
%SFILES
%LOAD
%RULES
##
## (9) port independent kernel machinery
##
.include "$S/conf/Makefile.kern.inc"
##
## (10) Appending make options.
##
%MAKEOPTIONSAPPEND