head	1.4;
access;
symbols
	perseant-exfatfs-base-20250801:1.4
	perseant-exfatfs-base-20240630:1.4
	perseant-exfatfs:1.4.0.140
	perseant-exfatfs-base:1.4
	bouyer-sunxi-drm:1.4.0.138
	bouyer-sunxi-drm-base:1.4
	cjep_sun2x:1.4.0.136
	cjep_sun2x-base:1.4
	cjep_staticlib_x-base1:1.4
	cjep_staticlib_x:1.4.0.134
	cjep_staticlib_x-base:1.4
	thorpej-futex-base:1.4
	bouyer-xenpvh-base2:1.4
	phil-wifi-20200421:1.4
	bouyer-xenpvh-base1:1.4
	phil-wifi-20200411:1.4
	bouyer-xenpvh:1.4.0.132
	bouyer-xenpvh-base:1.4
	phil-wifi-20200406:1.4
	ad-namecache-base3:1.4
	ad-namecache-base2:1.4
	ad-namecache-base1:1.4
	ad-namecache:1.4.0.130
	ad-namecache-base:1.4
	isaki-audio2:1.4.0.128
	isaki-audio2-base:1.4
	pgoyette-compat-merge-20190127:1.4
	pgoyette-compat-20190127:1.4
	pgoyette-compat-20190118:1.4
	pgoyette-compat-1226:1.4
	pgoyette-compat-1126:1.4
	pgoyette-compat-1020:1.4
	pgoyette-compat-0930:1.4
	pgoyette-compat-0906:1.4
	pgoyette-compat-0728:1.4
	pgoyette-compat-0625:1.4
	pgoyette-compat-0521:1.4
	pgoyette-compat-0502:1.4
	pgoyette-compat-0422:1.4
	pgoyette-compat-0415:1.4
	pgoyette-compat-0407:1.4
	pgoyette-compat-0330:1.4
	pgoyette-compat-0322:1.4
	pgoyette-compat-0315:1.4
	pgoyette-compat:1.4.0.8
	pgoyette-compat-base:1.4
	perseant-stdc-iso10646:1.4.0.126
	perseant-stdc-iso10646-base:1.4
	prg-localcount2-base3:1.4
	prg-localcount2-base2:1.4
	prg-localcount2-base1:1.4
	prg-localcount2:1.4.0.124
	prg-localcount2-base:1.4
	pgoyette-localcount-20170426:1.4
	bouyer-socketcan-base1:1.4
	pgoyette-localcount-20170320:1.4
	bouyer-socketcan:1.4.0.122
	bouyer-socketcan-base:1.4
	pgoyette-localcount-20170107:1.4
	pgoyette-localcount-20161104:1.4
	localcount-20160914:1.4
	pgoyette-localcount-20160806:1.4
	pgoyette-localcount-20160726:1.4
	pgoyette-localcount:1.4.0.120
	pgoyette-localcount-base:1.4
	netbsd-5-2-3-RELEASE:1.4
	netbsd-5-1-5-RELEASE:1.4
	yamt-pagecache-base9:1.4
	yamt-pagecache-tag8:1.4
	tls-earlyentropy:1.4.0.118
	tls-earlyentropy-base:1.4
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.4
	riastradh-drm2-base3:1.4
	netbsd-5-2-2-RELEASE:1.4
	netbsd-5-1-4-RELEASE:1.4
	netbsd-5-2-1-RELEASE:1.4
	netbsd-5-1-3-RELEASE:1.4
	rmind-smpnet-nbase:1.4
	rmind-smpnet:1.4.0.114
	rmind-smpnet-base:1.4
	agc-symver:1.4.0.116
	agc-symver-base:1.4
	tls-maxphys-base:1.4
	yamt-pagecache-base8:1.4
	netbsd-5-2:1.4.0.112
	yamt-pagecache-base7:1.4
	netbsd-5-2-RELEASE:1.4
	netbsd-5-2-RC1:1.4
	yamt-pagecache-base6:1.4
	yamt-pagecache-base5:1.4
	yamt-pagecache-base4:1.4
	netbsd-5-1-2-RELEASE:1.4
	netbsd-5-1-1-RELEASE:1.4
	jmcneill-usbmp:1.4.0.110
	jmcneill-usbmp-base:1.4
	jmcneill-audiomp3:1.4.0.108
	jmcneill-audiomp3-base:1.4
	yamt-pagecache-base3:1.4
	yamt-pagecache-base2:1.4
	yamt-pagecache:1.4.0.106
	yamt-pagecache-base:1.4
	rmind-uvmplock-nbase:1.4
	jym-xensuspend-nbase:1.4
	bouyer-quota2-nbase:1.4
	bouyer-quota2:1.4.0.104
	bouyer-quota2-base:1.4
	jruoho-x86intr:1.4.0.102
	jruoho-x86intr-base:1.4
	matt-nb5-pq3:1.4.0.100
	matt-nb5-pq3-base:1.4
	netbsd-5-1:1.4.0.98
	netbsd-5-1-RELEASE:1.4
	yamt-nfs-mp-base11:1.4
	netbsd-5-1-RC4:1.4
	uebayasi-xip-base2:1.4
	yamt-nfs-mp-base10:1.4
	netbsd-5-1-RC3:1.4
	netbsd-5-1-RC2:1.4
	netbsd-5-1-RC1:1.4
	rmind-uvmplock:1.4.0.96
	rmind-uvmplock-base:1.4
	yamt-nfs-mp-base9:1.4
	uebayasi-xip:1.4.0.94
	uebayasi-xip-base:1.4
	netbsd-5-0-2-RELEASE:1.4
	yamt-nfs-mp-base8:1.4
	yamt-nfs-mp-base7:1.4
	netbsd-5-0-1-RELEASE:1.4
	jymxensuspend-base:1.4
	yamt-nfs-mp-base6:1.4
	yamt-nfs-mp-base5:1.4
	yamt-nfs-mp-base4:1.4
	yamt-nfs-mp-base3:1.4
	netbsd-5-0:1.4.0.92
	netbsd-5-0-RELEASE:1.4
	netbsd-5-0-RC4:1.4
	netbsd-5-0-RC3:1.4
	netbsd-5-0-RC2:1.4
	jym-xensuspend:1.4.0.90
	jym-xensuspend-base:1.4
	netbsd-5-0-RC1:1.4
	haad-dm-base2:1.4
	haad-nbase2:1.4
	ad-audiomp2:1.4.0.88
	ad-audiomp2-base:1.4
	netbsd-5:1.4.0.86
	netbsd-5-base:1.4
	haad-dm-base1:1.4
	haad-dm:1.4.0.84
	haad-dm-base:1.4
	simonb-wapbl-nbase:1.4
	yamt-pf42-base4:1.4
	simonb-wapbl:1.4.0.82
	simonb-wapbl-base:1.4
	yamt-pf42-base3:1.4
	hpcarm-cleanup-nbase:1.4
	yamt-pf42-base2:1.4
	yamt-nfs-mp-base2:1.4
	yamt-nfs-mp:1.4.0.80
	yamt-nfs-mp-base:1.4
	yamt-pf42:1.4.0.78
	yamt-pf42-base:1.4
	ad-socklock-base1:1.4
	yamt-lazymbuf-base15:1.4
	yamt-lazymbuf-base14:1.4
	keiichi-mipv6-nbase:1.4
	mjf-devfs2:1.4.0.76
	mjf-devfs2-base:1.4
	keiichi-mipv6:1.4.0.74
	keiichi-mipv6-base:1.4
	bouyer-xeni386-merge1:1.4
	vmlocking2-base3:1.4
	bouyer-xeni386-nbase:1.4
	yamt-kmem-base3:1.4
	cube-autoconf:1.4.0.72
	cube-autoconf-base:1.4
	yamt-kmem-base2:1.4
	bouyer-xeni386:1.4.0.70
	bouyer-xeni386-base:1.4
	yamt-kmem:1.4.0.68
	yamt-kmem-base:1.4
	vmlocking2-base2:1.4
	reinoud-bufcleanup-nbase:1.4
	vmlocking2:1.4.0.66
	vmlocking2-base1:1.4
	jmcneill-base:1.4
	mjf-devfs:1.4.0.64
	mjf-devfs-base:1.4
	bouyer-xenamd64-base2:1.4
	vmlocking-nbase:1.4
	yamt-x86pmap-base4:1.4
	bouyer-xenamd64:1.4.0.62
	bouyer-xenamd64-base:1.4
	yamt-x86pmap-base3:1.4
	yamt-x86pmap-base2:1.4
	yamt-x86pmap:1.4.0.60
	yamt-x86pmap-base:1.4
	jmcneill-pm:1.4.0.58
	jmcneill-pm-base:1.4
	hpcarm-cleanup:1.4.0.56
	hpcarm-cleanup-base:1.4
	mjf-ufs-trans-base:1.4
	yamt-idlelwp-base8:1.4
	ppcoea-renovation:1.4.0.54
	ppcoea-renovation-base:1.4
	reinoud-bufcleanup-base:1.4
	vmlocking:1.4.0.52
	vmlocking-base:1.4
	ad-audiomp:1.4.0.50
	ad-audiomp-base:1.4
	yamt-idlelwp:1.4.0.48
	post-newlock2-merge:1.4
	newlock2-nbase:1.4
	yamt-splraiseipl-base5:1.4
	yamt-splraiseipl-base4:1.4
	yamt-splraiseipl-base3:1.4
	yamt-splraiseipl-base2:1.4
	yamt-splraiseipl:1.4.0.46
	yamt-splraiseipl-base:1.4
	newlock2:1.4.0.44
	newlock2-base:1.4
	yamt-pdpolicy-base8:1.4
	yamt-pdpolicy-base7:1.4
	yamt-pdpolicy-base6:1.4
	gdamore-uart:1.4.0.42
	gdamore-uart-base:1.4
	simonb-timcounters-final:1.4
	yamt-pdpolicy-base5:1.4
	elad-kernelauth-nbase:1.4
	yamt-pdpolicy-base4:1.4
	yamt-pdpolicy-base3:1.4
	yamt-pdpolicy-base2:1.4
	yamt-pdpolicy:1.4.0.40
	yamt-pdpolicy-base:1.4
	yamt-uio_vmspace-base5:1.4
	simonb-timecounters:1.4.0.38
	simonb-timecounters-base:1.4
	rpaulo-netinet-merge-pcb:1.4.0.36
	rpaulo-netinet-merge-pcb-base:1.4
	yamt-uio_vmspace:1.4.0.34
	yamt-readahead-base3:1.4
	yamt-readahead-base2:1.4
	yamt-readahead:1.4.0.32
	yamt-readahead-base:1.4
	yamt-vop-base3:1.4
	yamt-vop-base2:1.4
	thorpej-vnode-attr:1.4.0.30
	thorpej-vnode-attr-base:1.4
	yamt-vop:1.4.0.28
	yamt-vop-base:1.4
	yamt-lazymbuf:1.4.0.26
	yamt-km-base4:1.4
	yamt-km-base3:1.4
	yamt-km-base2:1.4
	yamt-km:1.4.0.24
	yamt-km-base:1.4
	kent-audio2:1.4.0.22
	kent-audio2-base:1.4
	ktrace-lwp:1.4.0.20
	ktrace-lwp-base:1.4
	nathanw_sa_before_merge:1.4
	gmcgarry_ctxsw:1.4.0.18
	gmcgarry_ctxsw_base:1.4
	gmcgarry_ucred:1.4.0.16
	gmcgarry_ucred_base:1.4
	nathanw_sa_base:1.4
	gehenna-devsw:1.4.0.14
	gehenna-devsw-base:1.4
	netbsd-1-5-PATCH003:1.1
	eeh-devprop:1.4.0.12
	eeh-devprop-base:1.4
	newlock:1.4.0.10
	newlock-base:1.4
	ifpoll-base:1.4
	thorpej-mips-cache:1.4.0.6
	thorpej-mips-cache-base:1.4
	thorpej-devvp:1.4.0.4
	thorpej-devvp-base:1.4
	netbsd-1-5-PATCH002:1.1
	kqueue:1.4.0.2
	kqueue-base:1.4
	netbsd-1-5-PATCH001:1.1
	thorpej_scsipi_beforemerge:1.4
	thorpej_scsipi_nbase:1.4
	thorpej_scsipi_base:1.4
	thorpej_scsipi:1.1.0.6
	netbsd-1-5-RELEASE:1.1
	netbsd-1-5-BETA2:1.1
	netbsd-1-5-BETA:1.1
	netbsd-1-5-ALPHA2:1.1
	minoura-xpg4dl:1.1.0.4
	netbsd-1-5:1.1.0.2
	netbsd-1-5-base:1.1;
locks; strict;
comment	@# @;


1.4
date	2000.12.03.02.07.04;	author matt;	state dead;
branches;
next	1.3;

1.3
date	2000.12.02.20.27.37;	author matt;	state Exp;
branches;
next	1.2;

1.2
date	2000.12.02.06.23.48;	author matt;	state Exp;
branches;
next	1.1;

1.1
date	2000.06.14.15.45.37;	author soren;	state Exp;
branches
	1.1.4.1
	1.1.6.1;
next	;

1.1.4.1
date	2000.06.14.15.45.37;	author minoura;	state dead;
branches;
next	1.1.4.2;

1.1.4.2
date	2000.06.22.17.02.56;	author minoura;	state Exp;
branches;
next	;

1.1.6.1
date	2000.06.14.15.45.37;	author bouyer;	state dead;
branches;
next	1.1.6.2;

1.1.6.2
date	2000.11.20.20.23.41;	author bouyer;	state Exp;
branches;
next	1.1.6.3;

1.1.6.3
date	2000.12.08.09.30.24;	author bouyer;	state dead;
branches;
next	;


desc
@@


1.4
log
@Start using a Makefile.mips.  Use a combination of makeoptions and
Makefile.sgimips.inc which has sgimips specific stuff.
@
text
@#	$NetBSD: Makefile.sgimips,v 1.3 2000/12/02 20:27:37 matt 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/sgimips/conf/``machineid''
# after which you should do
#	config machineid
# Machine generic makefile changes should be made in
#	/sys/arch/sgimips/conf/Makefile.sgimips
# after which config should be rerun for all machines of that type.
#
# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
#	IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
#
# -DTRACE	compile in kernel tracing hooks
# -DQUOTA	compile in file system quotas

# DEBUG is set to -g if debugging.
# PROF is set to -pg if profiling.

AR?=		ar
AS?=		as
CC?=		cc
CPP?=		cpp
LD?=		ld
LORDER?=	lorder
MKDEP?=		mkdep
NM?=		nm
RANLIB?=	ranlib
SIZE?=		size
STRIP?=		strip
TSORT?=		tsort -q

COPTS?=		-O2

TEXTADDR?=	0x80002000

# source tree is located via $S relative to the compilation directory
.ifndef S
#S!=	cd ../../../..; pwd
S=	../../../..
.endif
SGIMIPS= $S/arch/sgimips
MIPS=	$S/arch/mips

HAVE_EGCS!=	${CC} --version | egrep "^(2\.[89]|egcs)" ; echo
INCLUDES=	-I. -I$S/arch -I$S -nostdinc
CPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -Dsgimips
CWARNFLAGS?=	-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes \
		-Wpointer-arith
# XXX Delete -Wuninitialized for now, since the compiler doesn't
# XXX always get it right.  --thorpej 
CWARNFLAGS+=	-Wno-uninitialized
.if (${HAVE_EGCS} != "")
CWARNFLAGS+=	-Wno-main
.endif
GP?=		-G 0
CFLAGS=		${DEBUG} ${COPTS} ${CWARNFLAGS} ${GP} \
		-mno-abicalls -mno-half-pic -EB
AFLAGS=		-x assembler-with-cpp -traditional-cpp -D_LOCORE -EB
LINKFLAGS=	-T ${MIPS}/conf/kern.ldscript.be -Ttext ${TEXTADDR} \
		-e start ${GP}
LD+=		-EB
STRIPFLAGS=	-g -X -x

%INCLUDES

### find out what to use for libkern
.include "$S/lib/libkern/Makefile.inc"
.ifndef PROF
LIBKERN=	${KERNLIB}
.else
LIBKERN=	${KERNLIB_PROF}
.endif

### find out what to use for libcompat
.include "$S/compat/common/Makefile.inc"
.ifndef PROF
LIBCOMPAT=	${COMPATLIB}
.else
LIBCOMPAT=	${COMPATLIB_PROF}
.endif

# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
# HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).

NORMAL_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
NOPROF_C=	${CC} ${CFLAGS} ${CPPFLAGS} -c $<
NORMAL_S=	${CC} ${AFLAGS} ${CPPFLAGS} -c $<

%OBJS

%CFILES

%SFILES

# load lines for config "xxx" will be emitted as:
# xxx: ${SYSTEM_DEP} swapxxx.o
#	${SYSTEM_LD_HEAD}
#	${SYSTEM_LD} swapxxx.o
#	${SYSTEM_LD_TAIL}
SYSTEM_OBJ=	locore.o locore_machdep.o
.if !empty(IDENT:M-DMIPS1)
SYSTEM_OBJ+=	locore_mips1.o
.endif
.if !empty(IDENT:M-DMIPS3)
SYSTEM_OBJ+=	locore_mips3.o
.endif
SYSTEM_OBJ+=	fp.o param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
SYSTEM_LD_HEAD=	@@rm -f $@@
SYSTEM_LD=	@@echo ${LD} ${LINKFLAGS} -o $@@ '$${SYSTEM_OBJ}' vers.o ; \
		${LD} ${LINKFLAGS} -o $@@ ${SYSTEM_OBJ} vers.o
# XXX
SYSTEM_LD_TAIL=	@@echo ${LD} -T ${MIPS}/conf/kern.ldscript.be -Ttext 0x88002000 \
		-e start ${GP} -x -o $@@.high '$${SYSTEM_OBJ}' vers.o ; \
		${LD} -T ${MIPS}/conf/kern.ldscript.be -Ttext 0x88002000 \
		-e start ${GP} -x -o $@@.high ${SYSTEM_OBJ} vers.o swapnetbsd.o
# XXX
SYSTEM_LD_TAIL+=; \
		${SIZE} $@@; chmod 755 $@@ ; \
		${SIZE} $@@.high; chmod 755 $@@.high

DEBUG?=
.if ${DEBUG} == "-g"
LINKFLAGS+=	-X
SYSTEM_LD_TAIL+=; \
		echo mv -f $@@ $@@.gdb; mv -f $@@ $@@.gdb; \
		echo ${STRIP} ${STRIPFLAGS} -o $@@ $@@.gdb; \
		${STRIP} ${STRIPFLAGS} -o $@@ $@@.gdb
.else
LINKFLAGS+=	-x
.endif

SYSTEM_LD_TAIL+=;\
# XXX		echo elf2ecoff $@@ $@@.ecoff; elf2ecoff $@@ $@@.ecoff; \
# XXX		chmod 755 $@@.ecoff

%LOAD

assym.h: $S/kern/genassym.sh ${MIPS}/mips/genassym.cf
	sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
	  < ${MIPS}/mips/genassym.cf > assym.h.tmp && \
	mv -f assym.h.tmp assym.h


param.c: $S/conf/param.c
	rm -f param.c
	cp $S/conf/param.c .

param.o: param.c Makefile
	${NORMAL_C}

ioconf.o: ioconf.c
	${NORMAL_C}

newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
	sh $S/conf/newvers.sh
	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c

__CLEANKERNEL: .USE
	@@echo "${.TARGET}ing the kernel objects"
	rm -f eddep *netbsd netbsd.ecoff netbsd.gdb tags *.[io] \
	  [a-z]*.s [Ee]rrs linterrs makelinks assym.h.tmp assym.h

__CLEANDEPEND: .USE
	rm -f .depend

clean: __CLEANKERNEL

cleandir distclean: __CLEANKERNEL __CLEANDEPEND

lint:
	@@lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \
	  ${MIPS}/mips/Locore.c ${CFILES} \
	  ioconf.c param.c | \
	  grep -v 'static function .* unused'

tags:
	@@echo "see $S/kern/Makefile for tags"

links:
	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
	  sort -u | comm -23 - dontlink | \
	  sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
	sh makelinks && rm -f dontlink

SRCS=	${MIPS}/mips/locore.S ${MIPS}/mips/fp.S \
	${SGIMIPS}/sgimips/locore_machdep.S \
	param.c ioconf.c ${CFILES} ${SFILES}
depend: .depend
.depend: ${SRCS} assym.h param.c
	${MKDEP} ${AFLAGS} ${CPPFLAGS} ${MIPS}/mips/locore.S ${MIPS}/mips/fp.S
	${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SGIMIPS}/sgimips/locore_machdep.S
	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
.if (${SFILES} != "")
	${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
.endif
	sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
	  ${CPPFLAGS} < ${MIPS}/mips/genassym.cf
	@@sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
	@@rm -f assym.dep


# depend on root or device configuration
autoconf.o conf.o: Makefile

# depend on network or filesystem configuration
uipc_proto.o vfs_conf.o: Makefile

# depend on maxusers
machdep.o: Makefile

# depend on CPU configuration
machdep.o mainbus.o trap.o: Makefile

# depend on System V IPC/shmem options
mips_machdep.o pmap.o: Makefile

locore.o: ${MIPS}/mips/locore.S assym.h
	${NORMAL_S}

locore_mips1.o: ${MIPS}/mips/locore_mips1.S assym.h
	${NORMAL_S}

locore_mips3.o: ${MIPS}/mips/locore_mips3.S assym.h
	${NORMAL_S}

# The install target can be redefined by putting a
# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
MACHINE_NAME!=  uname -n
install: install-kernel-${MACHINE_NAME}
.if !target(install-kernel-${MACHINE_NAME}})
install-kernel-${MACHINE_NAME}:
	rm -f /onetbsd
	ln /netbsd /onetbsd
	cp netbsd /nnetbsd
	mv /nnetbsd /netbsd
.endif

fp.o: ${MIPS}/mips/fp.S assym.h
	${NORMAL_S}

locore_machdep.o: ${SGIMIPS}/sgimips/locore_machdep.S assym.h
	${NORMAL_S}

%RULES
@


1.3
log
@Need to add -EB for ASFLAGS as well.  Don't use -EB in LINKFLAGS but add
-EB to LD so that libkern/libcompat get it as well.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.sgimips,v 1.2 2000/12/02 06:23:48 matt Exp $
@


1.2
log
@Add -EB to make building kernel on LE systems easier.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.sgimips,v 1.1 2000/06/14 15:45:37 soren Exp $
d63 1
a63 1
AFLAGS=		-x assembler-with-cpp -traditional-cpp -D_LOCORE
d66 1
@


1.1
log
@Initial commit.
@
text
@d1 1
a1 1
#	$NetBSD$
d62 1
a62 1
		-mno-abicalls -mno-half-pic
@


1.1.6.1
log
@file Makefile.sgimips was added on branch thorpej_scsipi on 2000-11-20 20:23:41 +0000
@
text
@d1 251
@


1.1.6.2
log
@Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
@
text
@a0 251
#	$NetBSD: Makefile.sgimips,v 1.1.6.1 2000/11/20 20:23:41 bouyer 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/sgimips/conf/``machineid''
# after which you should do
#	config machineid
# Machine generic makefile changes should be made in
#	/sys/arch/sgimips/conf/Makefile.sgimips
# after which config should be rerun for all machines of that type.
#
# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
#	IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
#
# -DTRACE	compile in kernel tracing hooks
# -DQUOTA	compile in file system quotas

# DEBUG is set to -g if debugging.
# PROF is set to -pg if profiling.

AR?=		ar
AS?=		as
CC?=		cc
CPP?=		cpp
LD?=		ld
LORDER?=	lorder
MKDEP?=		mkdep
NM?=		nm
RANLIB?=	ranlib
SIZE?=		size
STRIP?=		strip
TSORT?=		tsort -q

COPTS?=		-O2

TEXTADDR?=	0x80002000

# source tree is located via $S relative to the compilation directory
.ifndef S
#S!=	cd ../../../..; pwd
S=	../../../..
.endif
SGIMIPS= $S/arch/sgimips
MIPS=	$S/arch/mips

HAVE_EGCS!=	${CC} --version | egrep "^(2\.[89]|egcs)" ; echo
INCLUDES=	-I. -I$S/arch -I$S -nostdinc
CPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -Dsgimips
CWARNFLAGS?=	-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes \
		-Wpointer-arith
# XXX Delete -Wuninitialized for now, since the compiler doesn't
# XXX always get it right.  --thorpej 
CWARNFLAGS+=	-Wno-uninitialized
.if (${HAVE_EGCS} != "")
CWARNFLAGS+=	-Wno-main
.endif
GP?=		-G 0
CFLAGS=		${DEBUG} ${COPTS} ${CWARNFLAGS} ${GP} \
		-mno-abicalls -mno-half-pic
AFLAGS=		-x assembler-with-cpp -traditional-cpp -D_LOCORE
LINKFLAGS=	-T ${MIPS}/conf/kern.ldscript.be -Ttext ${TEXTADDR} \
		-e start ${GP}
STRIPFLAGS=	-g -X -x

%INCLUDES

### find out what to use for libkern
.include "$S/lib/libkern/Makefile.inc"
.ifndef PROF
LIBKERN=	${KERNLIB}
.else
LIBKERN=	${KERNLIB_PROF}
.endif

### find out what to use for libcompat
.include "$S/compat/common/Makefile.inc"
.ifndef PROF
LIBCOMPAT=	${COMPATLIB}
.else
LIBCOMPAT=	${COMPATLIB_PROF}
.endif

# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
# HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).

NORMAL_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
NOPROF_C=	${CC} ${CFLAGS} ${CPPFLAGS} -c $<
NORMAL_S=	${CC} ${AFLAGS} ${CPPFLAGS} -c $<

%OBJS

%CFILES

%SFILES

# load lines for config "xxx" will be emitted as:
# xxx: ${SYSTEM_DEP} swapxxx.o
#	${SYSTEM_LD_HEAD}
#	${SYSTEM_LD} swapxxx.o
#	${SYSTEM_LD_TAIL}
SYSTEM_OBJ=	locore.o locore_machdep.o
.if !empty(IDENT:M-DMIPS1)
SYSTEM_OBJ+=	locore_mips1.o
.endif
.if !empty(IDENT:M-DMIPS3)
SYSTEM_OBJ+=	locore_mips3.o
.endif
SYSTEM_OBJ+=	fp.o param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
SYSTEM_LD_HEAD=	@@rm -f $@@
SYSTEM_LD=	@@echo ${LD} ${LINKFLAGS} -o $@@ '$${SYSTEM_OBJ}' vers.o ; \
		${LD} ${LINKFLAGS} -o $@@ ${SYSTEM_OBJ} vers.o
# XXX
SYSTEM_LD_TAIL=	@@echo ${LD} -T ${MIPS}/conf/kern.ldscript.be -Ttext 0x88002000 \
		-e start ${GP} -x -o $@@.high '$${SYSTEM_OBJ}' vers.o ; \
		${LD} -T ${MIPS}/conf/kern.ldscript.be -Ttext 0x88002000 \
		-e start ${GP} -x -o $@@.high ${SYSTEM_OBJ} vers.o swapnetbsd.o
# XXX
SYSTEM_LD_TAIL+=; \
		${SIZE} $@@; chmod 755 $@@ ; \
		${SIZE} $@@.high; chmod 755 $@@.high

DEBUG?=
.if ${DEBUG} == "-g"
LINKFLAGS+=	-X
SYSTEM_LD_TAIL+=; \
		echo mv -f $@@ $@@.gdb; mv -f $@@ $@@.gdb; \
		echo ${STRIP} ${STRIPFLAGS} -o $@@ $@@.gdb; \
		${STRIP} ${STRIPFLAGS} -o $@@ $@@.gdb
.else
LINKFLAGS+=	-x
.endif

SYSTEM_LD_TAIL+=;\
# XXX		echo elf2ecoff $@@ $@@.ecoff; elf2ecoff $@@ $@@.ecoff; \
# XXX		chmod 755 $@@.ecoff

%LOAD

assym.h: $S/kern/genassym.sh ${MIPS}/mips/genassym.cf
	sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
	  < ${MIPS}/mips/genassym.cf > assym.h.tmp && \
	mv -f assym.h.tmp assym.h


param.c: $S/conf/param.c
	rm -f param.c
	cp $S/conf/param.c .

param.o: param.c Makefile
	${NORMAL_C}

ioconf.o: ioconf.c
	${NORMAL_C}

newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
	sh $S/conf/newvers.sh
	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c

__CLEANKERNEL: .USE
	@@echo "${.TARGET}ing the kernel objects"
	rm -f eddep *netbsd netbsd.ecoff netbsd.gdb tags *.[io] \
	  [a-z]*.s [Ee]rrs linterrs makelinks assym.h.tmp assym.h

__CLEANDEPEND: .USE
	rm -f .depend

clean: __CLEANKERNEL

cleandir distclean: __CLEANKERNEL __CLEANDEPEND

lint:
	@@lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \
	  ${MIPS}/mips/Locore.c ${CFILES} \
	  ioconf.c param.c | \
	  grep -v 'static function .* unused'

tags:
	@@echo "see $S/kern/Makefile for tags"

links:
	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
	  sort -u | comm -23 - dontlink | \
	  sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
	sh makelinks && rm -f dontlink

SRCS=	${MIPS}/mips/locore.S ${MIPS}/mips/fp.S \
	${SGIMIPS}/sgimips/locore_machdep.S \
	param.c ioconf.c ${CFILES} ${SFILES}
depend: .depend
.depend: ${SRCS} assym.h param.c
	${MKDEP} ${AFLAGS} ${CPPFLAGS} ${MIPS}/mips/locore.S ${MIPS}/mips/fp.S
	${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SGIMIPS}/sgimips/locore_machdep.S
	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
.if (${SFILES} != "")
	${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
.endif
	sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
	  ${CPPFLAGS} < ${MIPS}/mips/genassym.cf
	@@sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
	@@rm -f assym.dep


# depend on root or device configuration
autoconf.o conf.o: Makefile

# depend on network or filesystem configuration
uipc_proto.o vfs_conf.o: Makefile

# depend on maxusers
machdep.o: Makefile

# depend on CPU configuration
machdep.o mainbus.o trap.o: Makefile

# depend on System V IPC/shmem options
mips_machdep.o pmap.o: Makefile

locore.o: ${MIPS}/mips/locore.S assym.h
	${NORMAL_S}

locore_mips1.o: ${MIPS}/mips/locore_mips1.S assym.h
	${NORMAL_S}

locore_mips3.o: ${MIPS}/mips/locore_mips3.S assym.h
	${NORMAL_S}

# The install target can be redefined by putting a
# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
MACHINE_NAME!=  uname -n
install: install-kernel-${MACHINE_NAME}
.if !target(install-kernel-${MACHINE_NAME}})
install-kernel-${MACHINE_NAME}:
	rm -f /onetbsd
	ln /netbsd /onetbsd
	cp netbsd /nnetbsd
	mv /nnetbsd /netbsd
.endif

fp.o: ${MIPS}/mips/fp.S assym.h
	${NORMAL_S}

locore_machdep.o: ${SGIMIPS}/sgimips/locore_machdep.S assym.h
	${NORMAL_S}

%RULES
@


1.1.6.3
log
@Sync with HEAD.
@
text
@d1 251
@


1.1.4.1
log
@file Makefile.sgimips was added on branch minoura-xpg4dl on 2000-06-22 17:02:56 +0000
@
text
@d1 251
@


1.1.4.2
log
@Sync w/ netbsd-1-5-base.
@
text
@a0 251
#	$NetBSD: Makefile.sgimips,v 1.1.4.1 2000/06/22 17:02:56 minoura 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/sgimips/conf/``machineid''
# after which you should do
#	config machineid
# Machine generic makefile changes should be made in
#	/sys/arch/sgimips/conf/Makefile.sgimips
# after which config should be rerun for all machines of that type.
#
# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
#	IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
#
# -DTRACE	compile in kernel tracing hooks
# -DQUOTA	compile in file system quotas

# DEBUG is set to -g if debugging.
# PROF is set to -pg if profiling.

AR?=		ar
AS?=		as
CC?=		cc
CPP?=		cpp
LD?=		ld
LORDER?=	lorder
MKDEP?=		mkdep
NM?=		nm
RANLIB?=	ranlib
SIZE?=		size
STRIP?=		strip
TSORT?=		tsort -q

COPTS?=		-O2

TEXTADDR?=	0x80002000

# source tree is located via $S relative to the compilation directory
.ifndef S
#S!=	cd ../../../..; pwd
S=	../../../..
.endif
SGIMIPS= $S/arch/sgimips
MIPS=	$S/arch/mips

HAVE_EGCS!=	${CC} --version | egrep "^(2\.[89]|egcs)" ; echo
INCLUDES=	-I. -I$S/arch -I$S -nostdinc
CPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -Dsgimips
CWARNFLAGS?=	-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes \
		-Wpointer-arith
# XXX Delete -Wuninitialized for now, since the compiler doesn't
# XXX always get it right.  --thorpej 
CWARNFLAGS+=	-Wno-uninitialized
.if (${HAVE_EGCS} != "")
CWARNFLAGS+=	-Wno-main
.endif
GP?=		-G 0
CFLAGS=		${DEBUG} ${COPTS} ${CWARNFLAGS} ${GP} \
		-mno-abicalls -mno-half-pic
AFLAGS=		-x assembler-with-cpp -traditional-cpp -D_LOCORE
LINKFLAGS=	-T ${MIPS}/conf/kern.ldscript.be -Ttext ${TEXTADDR} \
		-e start ${GP}
STRIPFLAGS=	-g -X -x

%INCLUDES

### find out what to use for libkern
.include "$S/lib/libkern/Makefile.inc"
.ifndef PROF
LIBKERN=	${KERNLIB}
.else
LIBKERN=	${KERNLIB_PROF}
.endif

### find out what to use for libcompat
.include "$S/compat/common/Makefile.inc"
.ifndef PROF
LIBCOMPAT=	${COMPATLIB}
.else
LIBCOMPAT=	${COMPATLIB_PROF}
.endif

# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
# HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).

NORMAL_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
NOPROF_C=	${CC} ${CFLAGS} ${CPPFLAGS} -c $<
NORMAL_S=	${CC} ${AFLAGS} ${CPPFLAGS} -c $<

%OBJS

%CFILES

%SFILES

# load lines for config "xxx" will be emitted as:
# xxx: ${SYSTEM_DEP} swapxxx.o
#	${SYSTEM_LD_HEAD}
#	${SYSTEM_LD} swapxxx.o
#	${SYSTEM_LD_TAIL}
SYSTEM_OBJ=	locore.o locore_machdep.o
.if !empty(IDENT:M-DMIPS1)
SYSTEM_OBJ+=	locore_mips1.o
.endif
.if !empty(IDENT:M-DMIPS3)
SYSTEM_OBJ+=	locore_mips3.o
.endif
SYSTEM_OBJ+=	fp.o param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
SYSTEM_LD_HEAD=	@@rm -f $@@
SYSTEM_LD=	@@echo ${LD} ${LINKFLAGS} -o $@@ '$${SYSTEM_OBJ}' vers.o ; \
		${LD} ${LINKFLAGS} -o $@@ ${SYSTEM_OBJ} vers.o
# XXX
SYSTEM_LD_TAIL=	@@echo ${LD} -T ${MIPS}/conf/kern.ldscript.be -Ttext 0x88002000 \
		-e start ${GP} -x -o $@@.high '$${SYSTEM_OBJ}' vers.o ; \
		${LD} -T ${MIPS}/conf/kern.ldscript.be -Ttext 0x88002000 \
		-e start ${GP} -x -o $@@.high ${SYSTEM_OBJ} vers.o swapnetbsd.o
# XXX
SYSTEM_LD_TAIL+=; \
		${SIZE} $@@; chmod 755 $@@ ; \
		${SIZE} $@@.high; chmod 755 $@@.high

DEBUG?=
.if ${DEBUG} == "-g"
LINKFLAGS+=	-X
SYSTEM_LD_TAIL+=; \
		echo mv -f $@@ $@@.gdb; mv -f $@@ $@@.gdb; \
		echo ${STRIP} ${STRIPFLAGS} -o $@@ $@@.gdb; \
		${STRIP} ${STRIPFLAGS} -o $@@ $@@.gdb
.else
LINKFLAGS+=	-x
.endif

SYSTEM_LD_TAIL+=;\
# XXX		echo elf2ecoff $@@ $@@.ecoff; elf2ecoff $@@ $@@.ecoff; \
# XXX		chmod 755 $@@.ecoff

%LOAD

assym.h: $S/kern/genassym.sh ${MIPS}/mips/genassym.cf
	sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
	  < ${MIPS}/mips/genassym.cf > assym.h.tmp && \
	mv -f assym.h.tmp assym.h


param.c: $S/conf/param.c
	rm -f param.c
	cp $S/conf/param.c .

param.o: param.c Makefile
	${NORMAL_C}

ioconf.o: ioconf.c
	${NORMAL_C}

newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
	sh $S/conf/newvers.sh
	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c

__CLEANKERNEL: .USE
	@@echo "${.TARGET}ing the kernel objects"
	rm -f eddep *netbsd netbsd.ecoff netbsd.gdb tags *.[io] \
	  [a-z]*.s [Ee]rrs linterrs makelinks assym.h.tmp assym.h

__CLEANDEPEND: .USE
	rm -f .depend

clean: __CLEANKERNEL

cleandir distclean: __CLEANKERNEL __CLEANDEPEND

lint:
	@@lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \
	  ${MIPS}/mips/Locore.c ${CFILES} \
	  ioconf.c param.c | \
	  grep -v 'static function .* unused'

tags:
	@@echo "see $S/kern/Makefile for tags"

links:
	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
	  sort -u | comm -23 - dontlink | \
	  sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
	sh makelinks && rm -f dontlink

SRCS=	${MIPS}/mips/locore.S ${MIPS}/mips/fp.S \
	${SGIMIPS}/sgimips/locore_machdep.S \
	param.c ioconf.c ${CFILES} ${SFILES}
depend: .depend
.depend: ${SRCS} assym.h param.c
	${MKDEP} ${AFLAGS} ${CPPFLAGS} ${MIPS}/mips/locore.S ${MIPS}/mips/fp.S
	${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SGIMIPS}/sgimips/locore_machdep.S
	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
.if (${SFILES} != "")
	${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
.endif
	sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
	  ${CPPFLAGS} < ${MIPS}/mips/genassym.cf
	@@sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
	@@rm -f assym.dep


# depend on root or device configuration
autoconf.o conf.o: Makefile

# depend on network or filesystem configuration
uipc_proto.o vfs_conf.o: Makefile

# depend on maxusers
machdep.o: Makefile

# depend on CPU configuration
machdep.o mainbus.o trap.o: Makefile

# depend on System V IPC/shmem options
mips_machdep.o pmap.o: Makefile

locore.o: ${MIPS}/mips/locore.S assym.h
	${NORMAL_S}

locore_mips1.o: ${MIPS}/mips/locore_mips1.S assym.h
	${NORMAL_S}

locore_mips3.o: ${MIPS}/mips/locore_mips3.S assym.h
	${NORMAL_S}

# The install target can be redefined by putting a
# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
MACHINE_NAME!=  uname -n
install: install-kernel-${MACHINE_NAME}
.if !target(install-kernel-${MACHINE_NAME}})
install-kernel-${MACHINE_NAME}:
	rm -f /onetbsd
	ln /netbsd /onetbsd
	cp netbsd /nnetbsd
	mv /nnetbsd /netbsd
.endif

fp.o: ${MIPS}/mips/fp.S assym.h
	${NORMAL_S}

locore_machdep.o: ${SGIMIPS}/sgimips/locore_machdep.S assym.h
	${NORMAL_S}

%RULES
@
