e33c2bb5d5
common Makefile.kern.inc has been included.
135 lines
2.8 KiB
Makefile
135 lines
2.8 KiB
Makefile
# $NetBSD: Makefile.sh5,v 1.14 2004/06/04 04:45:51 thorpej Exp $
|
|
|
|
# Makefile for NetBSD/sh5
|
|
#
|
|
# 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
|
|
# CPU generic makefile changes should be made in
|
|
# /sys/arch/sh5/conf/Makefile.sh5
|
|
# 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>
|
|
|
|
##
|
|
## (1) port identification
|
|
##
|
|
THISSH5= $S/arch/${MACHINE}
|
|
SH5= $S/arch/sh5
|
|
GENASSYM= ${SH5}/sh5/genassym.cf
|
|
.-include "${THISSH5}/conf/Makefile.${MACHINE}.inc"
|
|
|
|
##
|
|
## (2) compile settings
|
|
##
|
|
## The kernel must be compiled to *not* use FPU registers.
|
|
##
|
|
SH5_ABI?=32
|
|
.if (${SH5_ABI} == 32 || ${SH5_ABI} == 0x20)
|
|
SH5_ABI=32
|
|
SH5_ABI_DEF=-D_ILP32
|
|
SH5_TEXT_ADDR=0xc0000000
|
|
.elif (${SH5_ABI} == 64 || ${SH5_ABI} == 0x40)
|
|
SH5_ABI=64
|
|
SH5_ABI_DEF=-D_LP64
|
|
SH5_TEXT_ADDR=0xffffffffc0000000
|
|
.else
|
|
.BEGIN:
|
|
@echo "SH5_ABI must be either 32 or 64"
|
|
@false
|
|
.endif
|
|
|
|
.if (${MACHINE_ARCH} == sh5el)
|
|
SH5_ENDIAN_CC= -ml
|
|
SH5_ENDIAN_LD= shlelf${SH5_ABI}_nbsd
|
|
.elif (${MACHINE_ARCH} == sh5eb)
|
|
SH5_ENDIAN_CC= -mb
|
|
SH5_ENDIAN_LD= shelf${SH5_ABI}_nbsd
|
|
.else
|
|
.BEGIN:
|
|
@echo "MACHINE_ARCH must be either sh5el or sh5eb"
|
|
@false
|
|
.endif
|
|
|
|
CPPFLAGS+= -D__NetBSD__ -D${MACHINE} ${SH5_ABI_DEF}
|
|
CFLAGS+= ${SH5_ENDIAN_CC} -m5-${SH5_ABI}media-nofpu
|
|
AFLAGS+= ${SH5_ENDIAN_CC} -m5-${SH5_ABI}media-nofpu
|
|
AFLAGS+= -x assembler-with-cpp -traditional-cpp
|
|
|
|
# The sh5 gcc version 3.3.3 (NetBSD nb2 20040502) gets an internal
|
|
# compiler error with higher optimizations on a few files:
|
|
CC_NOOPT= ${NORMAL_C:C/-O./-O0/}
|
|
|
|
##
|
|
## (3) libkern and compat
|
|
##
|
|
|
|
##
|
|
## (4) local objects, compile rules, and dependencies
|
|
##
|
|
## locore.S must be assembled with the -no-expand option to prevent
|
|
## the assembler from synthesising instructions which use r25.
|
|
## Otherwise, interrupt/tlb handlers will lose.
|
|
##
|
|
MD_OBJS= locore.o
|
|
MD_CFILES=
|
|
MD_SFILES= ${THISSH5}/${MACHINE}/locore.S
|
|
|
|
locore.o: ${THISSH5}/${MACHINE}/locore.S assym.h
|
|
${NORMAL_S} -Wa,-no-expand
|
|
|
|
##
|
|
## (5) link settings
|
|
##
|
|
# LINKTEXT possibly set by individual sh5 port
|
|
LINKTEXT?= -Ttext ${SH5_TEXT_ADDR}
|
|
LINKFORMAT?= -m ${SH5_ENDIAN_LD}
|
|
LD+= ${LINKFORMAT}
|
|
|
|
|
|
##
|
|
## (6) port specific target dependencies
|
|
##
|
|
|
|
# depend on CPU configuration
|
|
locore.o machdep.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"
|
|
|
|
##
|
|
## (10) Appending make options.
|
|
##
|
|
%MAKEOPTIONSAPPEND
|