2003-09-29 09:14:23 +04:00
|
|
|
# $NetBSD: Makefile.powerpc,v 1.28 2003/09/29 05:14:23 simonb Exp $
|
2001-08-26 06:47:33 +04:00
|
|
|
#
|
2001-02-04 21:32:10 +03:00
|
|
|
# Makefile for NetBSD
|
|
|
|
#
|
|
|
|
# This makefile is constructed from a machine description:
|
|
|
|
# config machineid
|
|
|
|
# Most changes should be made in the machine description
|
2001-08-26 06:47:33 +04:00
|
|
|
# /sys/arch/powerpc/conf/``machineid''
|
2001-02-04 21:32:10 +03:00
|
|
|
# after which you should do
|
|
|
|
# config machineid
|
|
|
|
# Machine generic makefile changes should be made in
|
2001-08-26 06:47:33 +04:00
|
|
|
# /sys/arch/powerpc/conf/Makefile.powerpc
|
2001-02-04 21:32:10 +03: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.
|
2001-02-04 21:32:10 +03:00
|
|
|
#
|
2001-12-09 08:00:40 +03:00
|
|
|
# makeoptions DEBUGLIST="uvm* trap if_*"
|
2001-02-04 21:32:10 +03:00
|
|
|
|
2001-10-23 23:26:41 +04:00
|
|
|
MACHINE_ARCH=powerpc
|
2001-10-26 10:45:33 +04:00
|
|
|
USETOOLS?= no
|
2001-12-09 08:00:40 +03:00
|
|
|
NEED_OWN_INSTALL_TARGET?=no
|
2001-10-22 01:13:11 +04:00
|
|
|
.include <bsd.own.mk>
|
2001-02-04 21:32:10 +03:00
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
##
|
|
|
|
## (1) port identification
|
|
|
|
##
|
2001-10-23 22:57:32 +04:00
|
|
|
THISPPC= $S/arch/${MACHINE}
|
2001-08-26 06:47:33 +04:00
|
|
|
POWERPC= $S/arch/powerpc
|
2002-04-19 00:08:05 +04:00
|
|
|
.if exists(${THISPPC}/${MACHINE}/genassym.cf)
|
2001-12-09 08:00:40 +03:00
|
|
|
GENASSYM= ${THISPPC}/${MACHINE}/genassym.cf
|
2002-04-19 00:08:05 +04:00
|
|
|
.else
|
|
|
|
GENASSYM= ${POWERPC}/${PPCDIR}/genassym.cf
|
|
|
|
.endif
|
2001-12-09 08:00:40 +03:00
|
|
|
.-include "${THISPPC}/conf/Makefile.${MACHINE}.inc"
|
|
|
|
|
|
|
|
##
|
|
|
|
## (2) compile settings
|
|
|
|
##
|
|
|
|
CPPFLAGS+= -D${MACHINE}
|
|
|
|
CWARNFLAGS+= -Wreturn-type
|
|
|
|
CFLAGS+= -msoft-float ${CCPUOPTS}
|
|
|
|
AFLAGS+= ${AOPTS}
|
|
|
|
|
|
|
|
##
|
|
|
|
## (3) libkern and compat
|
|
|
|
##
|
2003-02-24 10:15:40 +03:00
|
|
|
.if !empty(IDENT:M-DLKM)
|
2003-02-20 02:55:48 +03:00
|
|
|
KERN_AS= obj
|
2003-02-24 10:15:40 +03:00
|
|
|
.endif
|
2001-12-09 08:00:40 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
## (4) local objects, compile rules, and dependencies
|
|
|
|
##
|
2002-08-23 16:01:58 +04:00
|
|
|
.if !defined(SYSTEM_FIRST_OBJ)
|
|
|
|
SYSTEM_FIRST_OBJ= locore.o
|
|
|
|
.endif
|
|
|
|
.if !defined(SYSTEM_FIRST_SFILE)
|
|
|
|
SYSTEM_FIRST_SFILE= ${THISPPC}/${MACHINE}/locore.S
|
|
|
|
.endif
|
|
|
|
MD_OBJS= ${SYSTEM_FIRST_OBJ}
|
2001-12-09 08:00:40 +03:00
|
|
|
MD_CFILES=
|
2002-08-23 16:01:58 +04:00
|
|
|
MD_SFILES= ${SYSTEM_FIRST_SFILE}
|
2001-02-04 21:32:10 +03:00
|
|
|
|
2002-08-23 16:01:58 +04:00
|
|
|
${SYSTEM_FIRST_OBJ}: ${SYSTEM_FIRST_SFILE} assym.h
|
2001-12-09 08:00:40 +03:00
|
|
|
${NORMAL_S}
|
2001-08-26 14:59:26 +04:00
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
##
|
|
|
|
## (5) link settings
|
|
|
|
##
|
|
|
|
TEXTADDR?= 0x100000
|
|
|
|
LINKFORMAT= -N
|
|
|
|
ENTRYPOINT= __start
|
2001-02-04 21:32:10 +03:00
|
|
|
|
2003-01-01 19:14:36 +03:00
|
|
|
.if defined(NEED_SYMTAB)
|
2001-12-09 08:00:40 +03:00
|
|
|
SYSTEM_LD_TAIL_EXTRA=; \
|
2003-01-01 19:14:36 +03:00
|
|
|
echo ${DBSYM} $@; \
|
|
|
|
${DBSYM} $@
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(NEED_SREC)
|
|
|
|
SYSTEM_LD_TAIL_EXTRA+=; \
|
2001-12-09 08:00:40 +03:00
|
|
|
${OBJCOPY} -v -O srec $@ $@.srec
|
2001-02-04 21:32:10 +03:00
|
|
|
.endif
|
|
|
|
|
2002-05-19 22:57:33 +04:00
|
|
|
.if defined(NEED_BINARY)
|
2003-01-01 19:14:36 +03:00
|
|
|
SYSTEM_LD_TAIL_EXTRA+=; \
|
2002-05-19 22:57:33 +04:00
|
|
|
${OBJCOPY} -v -O binary $@ $@.bin
|
|
|
|
.endif
|
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
##
|
|
|
|
## (6) port specific target dependencies
|
|
|
|
##
|
2001-02-04 21:32:10 +03:00
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
# depend on CPU configuration
|
|
|
|
locore.o machdep.o: Makefile
|
2001-02-04 21:32:10 +03:00
|
|
|
|
2003-09-29 09:14:23 +04:00
|
|
|
setfault.o: assym.h
|
|
|
|
|
2001-12-09 08:00:40 +03:00
|
|
|
##
|
|
|
|
## (7) misc settings
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
## (8) config(8) generated machinery
|
|
|
|
##
|
|
|
|
%INCLUDES
|
2001-02-04 21:32:10 +03:00
|
|
|
|
|
|
|
%OBJS
|
|
|
|
|
|
|
|
%CFILES
|
|
|
|
|
|
|
|
%SFILES
|
|
|
|
|
|
|
|
%LOAD
|
|
|
|
|
|
|
|
%RULES
|
2001-12-09 08:00:40 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
## (9) port independent kernel machinery
|
|
|
|
##
|
|
|
|
.include "$S/conf/Makefile.kern.inc"
|