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

# $NetBSD: Makefile.hp700,v 1.13 2008/02/18 13:27:55 joerg 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/hp700/conf/``machineid''
# after which you should do
#	config machineid
# Machine generic makefile changes should be made in
#	/sys/arch/hp700/conf/Makefile.hp700
# 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_*"

MACHINE_ARCH=hppa
NEED_OWN_INSTALL_TARGET?=no
.include <bsd.own.mk>

##
## (1) port identification
##
HP700=		$S/arch/hp700
HPPA=		$S/arch/hppa
GENASSYM_CONF=	${HP700}/hp700/genassym.cf

##
## (2) compile settings
##
CPPFLAGS+=	-Dhppa -Dhp700
CFLAGS+=	-mpa-risc-1-1 -msoft-float -mdisable-fpregs

.include "${HPPA}/spmath/Makefile.inc"

.ifndef PROF
LIBSPMATH=	${SPMATH}
.else
LIBSPMATH=	${SPMATH_PROF}
.endif

CFLAGS+=	-mno-space-regs -mfast-indirect-calls -mportable-runtime
APPFLAGS=	-x assembler-with-cpp -P -traditional ${CPPFLAGS} -D_LOCORE

# Do NOT assume the compiler does "-x funny_format" (gcc-specific)
# This needs an intermediate file.  The original file is always
# safe in some far away directory, so just use the base name.
NORMAL_S=	${CPP} ${APPFLAGS} $< > $*.s ;\
		${AS} -o $@ $*.s ; rm $*.s

##
## (3) libkern and compat
##
KERN_AS=	obj

##
## (4) local objects, compile rules, and dependencies
##
MD_OBJS=	locore.o ${LIBSPMATH}
MD_CFILES=
MD_SFILES=	${HP700}/hp700/locore.S

locore.o: ${HP700}/hp700/locore.S
	${NORMAL_S}

##
## (5) link settings
##
LINKFORMAT=	-T ${HP700}/conf/ld.script
TEXTADDR?=	00200000
LINKFLAGS_NORMAL=       -X
EXTRA_LINKFLAGS= -Map $@.map

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

# For cross-compilation, the "gcc -M" mkdep script is convenient,
# but that does not correctly make rules from *.s files.  The
# easiest work-around is to just list those dependencies here.
# XXX fredette - probably very incomplete:
locore.o:   assym.h hppa/asm.h hppa/trap.h hppa/frame.h hppa/reg.h
locore.o:   ${HPPA}/hppa/trap.S
locore.o:   ${HPPA}/hppa/copy.S
locore.o:   ${HPPA}/hppa/support.S
locore.o:   ${HPPA}/hppa/sigcode.S
copy.o:     assym.h hppa/asm.h $S/sys/errno.h
bcopy.o spcopy.o:    assym.h hppa/asm.h
copypage.o: assym.h hppa/asm.h

# depend on CPU configuration
db_machdep.o machdep.o pmap.o vm_machdep.o: Makefile

# depends on KGDBDEV, KGDBRATE, DDB, etc.
com_gsc.o clock.o pdc.o autoconf.o machdep.o: Makefile  

##
## (7) misc settings
##
MKDEP_AFLAGS=	${APPFLAGS}

##
## (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