2002-06-05 01:39:09 +04:00
|
|
|
# $NetBSD: Makefile.mips,v 1.27 2002/06/04 21:39:11 thorpej Exp $
|
2000-06-14 19:39:55 +04:00
|
|
|
|
|
|
|
# Makefile for NetBSD
|
|
|
|
#
|
|
|
|
# This makefile is constructed from a machine description:
|
|
|
|
# config machineid
|
|
|
|
# Most changes should be made in the machine description
|
2000-12-03 05:07:04 +03:00
|
|
|
# /sys/arch/<machine>/conf/``machineid''
|
2000-06-14 19:39:55 +04:00
|
|
|
# after which you should do
|
|
|
|
# config machineid
|
|
|
|
# Machine generic makefile changes should be made in
|
2000-12-03 05:07:04 +03:00
|
|
|
# /sys/arch/mips/conf/Makefile.mips
|
2000-06-14 19:39:55 +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_*"
|
2000-06-14 19:39:55 +04:00
|
|
|
|
2001-10-26 10:45:33 +04:00
|
|
|
USETOOLS?= no
|
2001-12-09 08:00:40 +03:00
|
|
|
NEED_OWN_INSTALL_TARGET?=no
|
2001-05-23 06:35:40 +04:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
2000-12-03 10:55:12 +03:00
|
|
|
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
|
2001-03-28 21:03:48 +04:00
|
|
|
OBJCOPY?= ${CROSSDIR}objcopy
|
2000-06-14 19:39:55 +04:00
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
##
|
|
|
|
## (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
|
2000-06-14 19:39:55 +04:00
|
|
|
.ifndef S
|
2001-12-09 08:00:40 +03:00
|
|
|
S= ../../../..
|
2000-06-14 19:39:55 +04:00
|
|
|
.endif
|
2001-10-23 22:57:32 +04:00
|
|
|
THISMIPS= $S/arch/${MACHINE}
|
2000-12-03 05:07:04 +03:00
|
|
|
MIPS= $S/arch/mips
|
2001-12-09 08:00:40 +03:00
|
|
|
GENASSYM= ${MIPS}/mips/genassym.cf
|
2001-10-23 22:57:32 +04:00
|
|
|
.-include "${THISMIPS}/conf/Makefile.${MACHINE}.inc"
|
2000-12-03 05:07:04 +03:00
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
##
|
|
|
|
## (2) compile settings
|
|
|
|
##
|
|
|
|
CPPFLAGS+= -D${MACHINE}
|
|
|
|
DEFGP?= -G 0
|
|
|
|
GP?= ${DEFGP}
|
|
|
|
CFLAGS+= ${ENDIAN} ${GP} -mno-abicalls -mno-half-pic
|
2002-06-05 01:39:09 +04:00
|
|
|
.if defined(HAVE_GCC3)
|
|
|
|
AFLAGS+= ${ENDIAN} -x assembler-with-cpp
|
|
|
|
.else
|
2001-12-09 08:00:40 +03:00
|
|
|
AFLAGS+= ${ENDIAN} -x assembler-with-cpp -traditional-cpp
|
2002-06-05 01:39:09 +04:00
|
|
|
.endif
|
2000-06-14 19:39:55 +04:00
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
##
|
|
|
|
## (3) libkern and compat
|
|
|
|
##
|
2000-06-14 19:39:55 +04:00
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
##
|
|
|
|
## (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
|
2000-06-14 19:39:55 +04:00
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
locore.o: ${MIPS}/mips/locore.S assym.h
|
|
|
|
${NORMAL_S}
|
2000-06-14 19:39:55 +04:00
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
locore_machdep.o: ${THISMIPS}/${MACHINE}/locore_machdep.S assym.h
|
|
|
|
${NORMAL_S}
|
2000-06-14 19:39:55 +04:00
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
##
|
|
|
|
## (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
|
2000-06-14 19:39:55 +04:00
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
##
|
|
|
|
## (6) port specific target dependencies
|
|
|
|
##
|
2000-06-14 19:39:55 +04:00
|
|
|
|
|
|
|
# depend on CPU configuration
|
|
|
|
machdep.o mainbus.o trap.o: Makefile
|
|
|
|
|
|
|
|
# depend on System V IPC/shmem options
|
|
|
|
mips_machdep.o pmap.o: Makefile
|
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
##
|
|
|
|
## (7) misc settings
|
|
|
|
##
|
2000-06-14 19:39:55 +04:00
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
##
|
|
|
|
## (8) config(8) generated machinery
|
|
|
|
##
|
|
|
|
%INCLUDES
|
2001-10-16 20:31:32 +04:00
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
%OBJS
|
2001-10-16 20:31:32 +04:00
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
%CFILES
|
2000-12-03 05:07:04 +03:00
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
%SFILES
|
2000-12-03 05:07:04 +03:00
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
%LOAD
|
2000-06-14 19:39:55 +04:00
|
|
|
|
|
|
|
%RULES
|
2001-12-09 08:00:40 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
## (9) port independent kernel machinery
|
|
|
|
##
|
|
|
|
.include "$S/conf/Makefile.kern.inc"
|