2006-06-08 02:37:14 +04:00
|
|
|
# $NetBSD: Makefile.amd64,v 1.14 2006/06/07 22:37:14 kardel Exp $
|
2001-06-19 04:19:12 +04:00
|
|
|
|
|
|
|
# Makefile for NetBSD
|
|
|
|
#
|
|
|
|
# This makefile is constructed from a machine description:
|
|
|
|
# config machineid
|
|
|
|
# Most changes should be made in the machine description
|
2003-04-26 22:39:25 +04:00
|
|
|
# /sys/arch/amd64/conf/``machineid''
|
2001-06-19 04:19:12 +04:00
|
|
|
# after which you should do
|
|
|
|
# config machineid
|
|
|
|
# Machine generic makefile changes should be made in
|
2003-04-26 22:39:25 +04:00
|
|
|
# /sys/arch/amd64/conf/Makefile.amd64
|
2001-06-19 04:19:12 +04:00
|
|
|
# after which config should be rerun for all machines of that type.
|
2001-12-09 08:00:40 +03:00
|
|
|
#
|
|
|
|
# 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_*"
|
2001-06-19 04:19:12 +04:00
|
|
|
|
2001-10-23 23:26:41 +04:00
|
|
|
MACHINE_ARCH=x86_64
|
2001-10-26 10:45:33 +04:00
|
|
|
USETOOLS?= no
|
2001-12-09 08:00:40 +03:00
|
|
|
NEED_OWN_INSTALL_TARGET?=no
|
2001-06-19 04:19:12 +04:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
##
|
|
|
|
## (1) port identification
|
|
|
|
##
|
2003-04-26 22:39:25 +04:00
|
|
|
AMD64= $S/arch/amd64
|
2005-05-31 08:03:08 +04:00
|
|
|
GENASSYM_CONF= ${AMD64}/amd64/genassym.cf
|
2001-06-19 04:19:12 +04:00
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
##
|
|
|
|
## (2) compile settings
|
|
|
|
##
|
2003-05-04 16:03:41 +04:00
|
|
|
DEFCOPTS= -O2
|
2003-04-26 22:39:25 +04:00
|
|
|
CPPFLAGS+= -Damd64 -Dx86_64
|
2002-05-26 04:23:49 +04:00
|
|
|
CFLAGS+= -mcmodel=kernel
|
2001-12-29 05:24:06 +03:00
|
|
|
CFLAGS+= -mno-red-zone
|
2001-12-09 08:00:40 +03:00
|
|
|
AFLAGS+= -x assembler-with-cpp -traditional-cpp
|
2001-06-19 04:19:12 +04:00
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
##
|
|
|
|
## (3) libkern and compat
|
|
|
|
##
|
2001-06-19 04:19:12 +04:00
|
|
|
KERN_AS= obj
|
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
##
|
|
|
|
## (4) local objects, compile rules, and dependencies
|
|
|
|
##
|
2006-06-08 02:37:14 +04:00
|
|
|
MD_OBJS= locore.o vector.o copy.o spl.o
|
2001-12-09 08:00:40 +03:00
|
|
|
MD_CFILES=
|
2003-04-26 22:39:25 +04:00
|
|
|
MD_SFILES= ${AMD64}/amd64/locore.S ${AMD64}/amd64/vector.S \
|
2006-06-08 02:37:14 +04:00
|
|
|
${AMD64}/amd64/copy.S ${AMD64}/amd64/spl.S
|
2001-06-19 04:19:12 +04:00
|
|
|
|
2003-04-26 22:39:25 +04:00
|
|
|
locore.o: ${AMD64}/amd64/locore.S assym.h
|
2001-06-19 04:19:12 +04:00
|
|
|
${NORMAL_S}
|
|
|
|
|
2003-04-26 22:39:25 +04:00
|
|
|
vector.o: ${AMD64}/amd64/vector.S assym.h
|
2001-06-19 04:19:12 +04:00
|
|
|
${NORMAL_S}
|
|
|
|
|
2003-04-26 22:39:25 +04:00
|
|
|
copy.o: ${AMD64}/amd64/copy.S assym.h
|
2001-06-19 04:19:12 +04:00
|
|
|
${NORMAL_S}
|
|
|
|
|
2003-04-26 22:39:25 +04:00
|
|
|
spl.o: ${AMD64}/amd64/spl.S assym.h
|
2003-03-06 02:55:57 +03:00
|
|
|
${NORMAL_S}
|
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
##
|
|
|
|
## (5) link settings
|
|
|
|
##
|
2002-05-26 04:23:49 +04:00
|
|
|
TEXTADDR?= 0xffffffff80100000
|
2001-12-09 08:00:40 +03:00
|
|
|
LINKFLAGS_NORMAL= -X
|
2001-12-29 05:24:06 +03:00
|
|
|
KERN_LDSCRIPT?= kern.ldscript
|
2003-04-26 22:39:25 +04:00
|
|
|
LINKFORMAT= -T ${AMD64}/conf/${KERN_LDSCRIPT}
|
2001-12-09 08:00:40 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
## (6) port specific target dependencies
|
|
|
|
##
|
|
|
|
|
|
|
|
# depend on CPU configuration
|
|
|
|
locore.o machdep.o: Makefile
|
|
|
|
|
2003-05-27 20:46:03 +04:00
|
|
|
mptramp.o netbsd32_sigcode.o: assym.h
|
2003-05-17 09:39:35 +04:00
|
|
|
clock.o: config_time.h
|
2001-06-19 04:19:12 +04:00
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
##
|
|
|
|
## (7) misc settings
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
## (8) config(8) generated machinery
|
|
|
|
##
|
|
|
|
%INCLUDES
|
|
|
|
|
|
|
|
%OBJS
|
|
|
|
|
|
|
|
%CFILES
|
|
|
|
|
|
|
|
%SFILES
|
|
|
|
|
|
|
|
%LOAD
|
2001-06-19 04:19:12 +04:00
|
|
|
|
|
|
|
%RULES
|
2006-04-04 07:13:12 +04:00
|
|
|
## Include rules for Atheros WLAN
|
|
|
|
.include "$S/contrib/dev/ath/netbsd/Makefile.ath.inc"
|
|
|
|
|
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
|
2006-04-02 09:52:14 +04:00
|
|
|
# XXX - Ugly, but make doesn't easily handle .o.uu (assumes it's a suffix)
|
2005-07-13 00:22:45 +04:00
|
|
|
# XXX - Also, config has no simple was to just add foo.o to the Makefile.
|
|
|
|
# It needs a pathname of some sort for "object"
|
2006-04-04 07:13:12 +04:00
|
|
|
.if !empty(OBJS:M\/athhal.o)
|
|
|
|
OBJS:=${OBJS:C/\/athhal.o/athhal.o/}
|
2005-07-13 00:22:45 +04:00
|
|
|
|
2006-04-02 09:52:14 +04:00
|
|
|
.PATH: $S/contrib/dev/ath/public
|
2005-07-13 00:22:45 +04:00
|
|
|
ATH_UUDEC?= @${_MKSHMSG} "uudecode ${.CURDIR:T}/${.TARGET}"; \
|
|
|
|
${_MKSHECHO}\
|
|
|
|
${UUDECODE} -p $> \> ${.TARGET}; \
|
|
|
|
rm -f ${.TARGET}; \
|
|
|
|
${UUDECODE} -p $> > ${.TARGET}
|
2005-11-27 16:30:27 +03:00
|
|
|
|
2006-04-04 07:13:12 +04:00
|
|
|
athhal.o: x86_64-elf.hal.o.uu
|
2005-07-13 00:22:45 +04:00
|
|
|
${ATH_UUDEC}
|
2005-12-01 00:50:47 +03:00
|
|
|
.if defined(COPTS) && !empty(COPTS:M-fno-asynchronous-unwind-tables)
|
2005-11-27 16:30:27 +03:00
|
|
|
${_MKSHECHO}\
|
2005-12-01 00:50:47 +03:00
|
|
|
${OBJCOPY} -R .eh_frame $@
|
|
|
|
${OBJCOPY} -R .eh_frame $@
|
2005-11-27 16:30:27 +03:00
|
|
|
.endif
|
2005-07-13 00:22:45 +04:00
|
|
|
.endif
|
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
##
|
|
|
|
## (9) port independent kernel machinery
|
|
|
|
##
|
|
|
|
.include "$S/conf/Makefile.kern.inc"
|
2004-06-04 08:45:49 +04:00
|
|
|
|
|
|
|
##
|
|
|
|
## (10) Appending make options.
|
|
|
|
##
|
|
|
|
%MAKEOPTIONSAPPEND
|