NetBSD-5.0.2/sys/arch/mips/conf/Makefile.mips

#	$NetBSD: Makefile.mips,v 1.50 2008/02/18 15:21:04 tsutsui 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/<machine>/conf/``machineid''
# after which you should do
#	config machineid
# Machine generic makefile changes should be made in
#	/sys/arch/mips/conf/Makefile.mips
# 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_*"

USETOOLS?=	no
NEED_OWN_INSTALL_TARGET?=no
.include <bsd.own.mk>

##
## (0) toolchain settings for things that aren't part of the standard
## toolchain
##
ELF2ECOFF?=	elf2ecoff

##
## (1) port identification
##
.ifndef S
S=		../../../..
.endif
THISMIPS=	$S/arch/${MACHINE}
MIPS=		$S/arch/mips
GENASSYM_CONF=	${MIPS}/mips/genassym.cf
.-include "${THISMIPS}/conf/Makefile.${MACHINE}.inc"

##
## (2) compile settings
##
## Note: -ffixed-?? must be kept in sync with cpu.h.
##
CPPFLAGS+=	-D${MACHINE}
DEFGP?=		-G 0
GP?=		${DEFGP}
CFLAGS+=	${GP} -mno-abicalls -msoft-float -ffixed-23
.if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el"
CFLAGS+=	-msym32
.endif
AFLAGS+=	-mno-abicalls -x assembler-with-cpp -traditional-cpp ${AOPTS}

##
## (3) libkern and compat
##
.if !empty(IDENT:M-DLKM)
KERN_AS=	obj
.endif

##
## (4) local objects, compile rules, and dependencies
##
MD_OBJS=	locore.o locore_machdep.o
MD_CFILES=
MD_SFILES=	${MIPS}/mips/locore.S ${THISMIPS}/${MACHINE}/locore_machdep.S	

locore.o: ${MIPS}/mips/locore.S assym.h
	${NORMAL_S}

locore_machdep.o: ${THISMIPS}/${MACHINE}/locore_machdep.S assym.h
	${NORMAL_S}

##
## (5) link settings
##
.if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el"
TEXTADDR?=              ${DEFTEXTADDR:C/0x8/0xFFFFFFFF8/}
.else   
TEXTADDR?=		${DEFTEXTADDR}
.endif
KERNLDSCRIPT?=		${MIPS}/conf/kern.ldscript
# some mips ports specify a "magic" format
LINKFORMAT+=		-T ${KERNLDSCRIPT}
EXTRA_LINKFLAGS=	${GP} ${LDOPTS}
LINKFLAGS_NORMAL=	-X
STRIPFLAGS=		-g -X

##
## (6) port specific target dependencies
##

# depend on CPU configuration
machdep.o mainbus.o trap.o: Makefile

# depend on System V IPC/shmem options
mips_machdep.o pmap.o: Makefile

# various assembly files that depend on assym.h
copy.o fp.o locore.o locore_mips1.o locore_mips3.o: assym.h
lock_stubs.o mips32_subr.o mips3_subr.o mips5900_subr.o: assym.h
mips64_subr.o mipsX_subr.o sigcode.o: assym.h


##
## (7) misc settings
##

##
## (8) config(8) generated machinery
##
%INCLUDES

%OBJS

%CFILES

%SFILES

%LOAD

%RULES

## Include rules for Atheros WLAN
.include "$S/contrib/dev/ath/netbsd/Makefile.ath.inc"

##
## (9) port independent kernel machinery
##
.include "$S/conf/Makefile.kern.inc"

##
## (10) Appending make options.
##
%MAKEOPTIONSAPPEND