130 lines
2.6 KiB
Makefile
130 lines
2.6 KiB
Makefile
# $NetBSD: Makefile.mips,v 1.26 2002/03/05 14:28:31 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/<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>
|
|
|
|
AR?= ${CROSSDIR}ar
|
|
AS?= ${CROSSDIR}as
|
|
CC?= ${CROSSDIR}cc
|
|
LD?= ${CROSSDIR}ld
|
|
NM?= ${CROSSDIR}nm
|
|
RANLIB?= ${CROSSDIR}ranlib
|
|
SIZE?= ${CROSSDIR}size
|
|
STRIP?= ${CROSSDIR}strip
|
|
TSORT?= ${CROSSDIR}tsort -q
|
|
OBJCOPY?= ${CROSSDIR}objcopy
|
|
|
|
##
|
|
## (1) port identification
|
|
##
|
|
.if ${MACHINE_ARCH} == "mipsel"
|
|
ENDIAN=-EL
|
|
.elif ${MACHINE_ARCH} == "mipseb"
|
|
ENDIAN=-EB
|
|
.else
|
|
.BEGIN:
|
|
@echo "MACHINE_ARCH ${MACHINE_ARCH} is invalid"
|
|
@false
|
|
.endif
|
|
.ifndef S
|
|
S= ../../../..
|
|
.endif
|
|
THISMIPS= $S/arch/${MACHINE}
|
|
MIPS= $S/arch/mips
|
|
GENASSYM= ${MIPS}/mips/genassym.cf
|
|
.-include "${THISMIPS}/conf/Makefile.${MACHINE}.inc"
|
|
|
|
##
|
|
## (2) compile settings
|
|
##
|
|
CPPFLAGS+= -D${MACHINE}
|
|
DEFGP?= -G 0
|
|
GP?= ${DEFGP}
|
|
CFLAGS+= ${ENDIAN} ${GP} -mno-abicalls -mno-half-pic
|
|
AFLAGS+= ${ENDIAN} -x assembler-with-cpp -traditional-cpp
|
|
|
|
##
|
|
## (3) libkern and compat
|
|
##
|
|
|
|
##
|
|
## (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
|
|
##
|
|
TEXTADDR?= ${DEFTEXTADDR}
|
|
KERNLDSCRIPT?= ${MIPS}/conf/kern.ldscript
|
|
# some mips ports specify a "magic" format
|
|
LINKFORMAT+= -T ${KERNLDSCRIPT}
|
|
EXTRA_LINKFLAGS= ${ENDIAN} ${GP}
|
|
.if (${ENDIAN} == "-EB")
|
|
EXTRA_LINKFLAGS+= --oformat elf32-bigmips
|
|
.else
|
|
EXTRA_LINKFLAGS+= --oformat elf32-littlemips
|
|
.endif
|
|
LINKFLAGS_NORMAL= -x
|
|
STRIPFLAGS= -g -X -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
|
|
|
|
##
|
|
## (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"
|