head	1.6;
access;
symbols
	perseant-exfatfs-base-20250801:1.6
	perseant-exfatfs-base-20240630:1.6
	perseant-exfatfs:1.6.0.142
	perseant-exfatfs-base:1.6
	bouyer-sunxi-drm:1.6.0.140
	bouyer-sunxi-drm-base:1.6
	cjep_sun2x:1.6.0.138
	cjep_sun2x-base:1.6
	cjep_staticlib_x-base1:1.6
	cjep_staticlib_x:1.6.0.136
	cjep_staticlib_x-base:1.6
	thorpej-futex-base:1.6
	bouyer-xenpvh-base2:1.6
	phil-wifi-20200421:1.6
	bouyer-xenpvh-base1:1.6
	phil-wifi-20200411:1.6
	bouyer-xenpvh:1.6.0.134
	bouyer-xenpvh-base:1.6
	phil-wifi-20200406:1.6
	ad-namecache-base3:1.6
	ad-namecache-base2:1.6
	ad-namecache-base1:1.6
	ad-namecache:1.6.0.132
	ad-namecache-base:1.6
	isaki-audio2:1.6.0.130
	isaki-audio2-base:1.6
	pgoyette-compat-merge-20190127:1.6
	pgoyette-compat-20190127:1.6
	pgoyette-compat-20190118:1.6
	pgoyette-compat-1226:1.6
	pgoyette-compat-1126:1.6
	pgoyette-compat-1020:1.6
	pgoyette-compat-0930:1.6
	pgoyette-compat-0906:1.6
	pgoyette-compat-0728:1.6
	pgoyette-compat-0625:1.6
	pgoyette-compat-0521:1.6
	pgoyette-compat-0502:1.6
	pgoyette-compat-0422:1.6
	pgoyette-compat-0415:1.6
	pgoyette-compat-0407:1.6
	pgoyette-compat-0330:1.6
	pgoyette-compat-0322:1.6
	pgoyette-compat-0315:1.6
	pgoyette-compat:1.6.0.10
	pgoyette-compat-base:1.6
	perseant-stdc-iso10646:1.6.0.128
	perseant-stdc-iso10646-base:1.6
	prg-localcount2-base3:1.6
	prg-localcount2-base2:1.6
	prg-localcount2-base1:1.6
	prg-localcount2:1.6.0.126
	prg-localcount2-base:1.6
	pgoyette-localcount-20170426:1.6
	bouyer-socketcan-base1:1.6
	pgoyette-localcount-20170320:1.6
	bouyer-socketcan:1.6.0.124
	bouyer-socketcan-base:1.6
	pgoyette-localcount-20170107:1.6
	pgoyette-localcount-20161104:1.6
	localcount-20160914:1.6
	pgoyette-localcount-20160806:1.6
	pgoyette-localcount-20160726:1.6
	pgoyette-localcount:1.6.0.122
	pgoyette-localcount-base:1.6
	netbsd-5-2-3-RELEASE:1.6
	netbsd-5-1-5-RELEASE:1.6
	yamt-pagecache-base9:1.6
	yamt-pagecache-tag8:1.6
	tls-earlyentropy:1.6.0.120
	tls-earlyentropy-base:1.6
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.6
	riastradh-drm2-base3:1.6
	netbsd-5-2-2-RELEASE:1.6
	netbsd-5-1-4-RELEASE:1.6
	netbsd-5-2-1-RELEASE:1.6
	netbsd-5-1-3-RELEASE:1.6
	rmind-smpnet-nbase:1.6
	rmind-smpnet:1.6.0.116
	rmind-smpnet-base:1.6
	agc-symver:1.6.0.118
	agc-symver-base:1.6
	tls-maxphys-base:1.6
	yamt-pagecache-base8:1.6
	netbsd-5-2:1.6.0.114
	yamt-pagecache-base7:1.6
	netbsd-5-2-RELEASE:1.6
	netbsd-5-2-RC1:1.6
	yamt-pagecache-base6:1.6
	yamt-pagecache-base5:1.6
	yamt-pagecache-base4:1.6
	netbsd-5-1-2-RELEASE:1.6
	netbsd-5-1-1-RELEASE:1.6
	jmcneill-usbmp:1.6.0.112
	jmcneill-usbmp-base:1.6
	jmcneill-audiomp3:1.6.0.110
	jmcneill-audiomp3-base:1.6
	yamt-pagecache-base3:1.6
	yamt-pagecache-base2:1.6
	yamt-pagecache:1.6.0.108
	yamt-pagecache-base:1.6
	rmind-uvmplock-nbase:1.6
	jym-xensuspend-nbase:1.6
	bouyer-quota2-nbase:1.6
	bouyer-quota2:1.6.0.106
	bouyer-quota2-base:1.6
	jruoho-x86intr:1.6.0.104
	jruoho-x86intr-base:1.6
	matt-nb5-pq3:1.6.0.102
	matt-nb5-pq3-base:1.6
	netbsd-5-1:1.6.0.100
	netbsd-5-1-RELEASE:1.6
	yamt-nfs-mp-base11:1.6
	netbsd-5-1-RC4:1.6
	uebayasi-xip-base2:1.6
	yamt-nfs-mp-base10:1.6
	netbsd-5-1-RC3:1.6
	netbsd-5-1-RC2:1.6
	netbsd-5-1-RC1:1.6
	rmind-uvmplock:1.6.0.98
	rmind-uvmplock-base:1.6
	yamt-nfs-mp-base9:1.6
	uebayasi-xip:1.6.0.96
	uebayasi-xip-base:1.6
	netbsd-5-0-2-RELEASE:1.6
	yamt-nfs-mp-base8:1.6
	yamt-nfs-mp-base7:1.6
	netbsd-5-0-1-RELEASE:1.6
	jymxensuspend-base:1.6
	yamt-nfs-mp-base6:1.6
	yamt-nfs-mp-base5:1.6
	yamt-nfs-mp-base4:1.6
	yamt-nfs-mp-base3:1.6
	netbsd-5-0:1.6.0.94
	netbsd-5-0-RELEASE:1.6
	netbsd-5-0-RC4:1.6
	netbsd-5-0-RC3:1.6
	netbsd-5-0-RC2:1.6
	jym-xensuspend:1.6.0.92
	jym-xensuspend-base:1.6
	netbsd-5-0-RC1:1.6
	haad-dm-base2:1.6
	haad-nbase2:1.6
	ad-audiomp2:1.6.0.90
	ad-audiomp2-base:1.6
	netbsd-5:1.6.0.88
	netbsd-5-base:1.6
	haad-dm-base1:1.6
	haad-dm:1.6.0.86
	haad-dm-base:1.6
	simonb-wapbl-nbase:1.6
	yamt-pf42-base4:1.6
	simonb-wapbl:1.6.0.84
	simonb-wapbl-base:1.6
	yamt-pf42-base3:1.6
	hpcarm-cleanup-nbase:1.6
	yamt-pf42-base2:1.6
	yamt-nfs-mp-base2:1.6
	yamt-nfs-mp:1.6.0.82
	yamt-nfs-mp-base:1.6
	yamt-pf42:1.6.0.80
	yamt-pf42-base:1.6
	ad-socklock-base1:1.6
	yamt-lazymbuf-base15:1.6
	yamt-lazymbuf-base14:1.6
	keiichi-mipv6-nbase:1.6
	mjf-devfs2:1.6.0.78
	mjf-devfs2-base:1.6
	keiichi-mipv6:1.6.0.76
	keiichi-mipv6-base:1.6
	bouyer-xeni386-merge1:1.6
	vmlocking2-base3:1.6
	bouyer-xeni386-nbase:1.6
	yamt-kmem-base3:1.6
	cube-autoconf:1.6.0.74
	cube-autoconf-base:1.6
	yamt-kmem-base2:1.6
	bouyer-xeni386:1.6.0.72
	bouyer-xeni386-base:1.6
	yamt-kmem:1.6.0.70
	yamt-kmem-base:1.6
	vmlocking2-base2:1.6
	reinoud-bufcleanup-nbase:1.6
	vmlocking2:1.6.0.68
	vmlocking2-base1:1.6
	jmcneill-base:1.6
	mjf-devfs:1.6.0.66
	mjf-devfs-base:1.6
	bouyer-xenamd64-base2:1.6
	vmlocking-nbase:1.6
	yamt-x86pmap-base4:1.6
	bouyer-xenamd64:1.6.0.64
	bouyer-xenamd64-base:1.6
	yamt-x86pmap-base3:1.6
	yamt-x86pmap-base2:1.6
	yamt-x86pmap:1.6.0.62
	yamt-x86pmap-base:1.6
	jmcneill-pm:1.6.0.60
	jmcneill-pm-base:1.6
	hpcarm-cleanup:1.6.0.58
	hpcarm-cleanup-base:1.6
	mjf-ufs-trans-base:1.6
	yamt-idlelwp-base8:1.6
	ppcoea-renovation:1.6.0.56
	ppcoea-renovation-base:1.6
	reinoud-bufcleanup-base:1.6
	vmlocking:1.6.0.54
	vmlocking-base:1.6
	ad-audiomp:1.6.0.52
	ad-audiomp-base:1.6
	yamt-idlelwp:1.6.0.50
	post-newlock2-merge:1.6
	newlock2-nbase:1.6
	yamt-splraiseipl-base5:1.6
	yamt-splraiseipl-base4:1.6
	yamt-splraiseipl-base3:1.6
	yamt-splraiseipl-base2:1.6
	yamt-splraiseipl:1.6.0.48
	yamt-splraiseipl-base:1.6
	newlock2:1.6.0.46
	newlock2-base:1.6
	yamt-pdpolicy-base8:1.6
	yamt-pdpolicy-base7:1.6
	yamt-pdpolicy-base6:1.6
	gdamore-uart:1.6.0.44
	gdamore-uart-base:1.6
	simonb-timcounters-final:1.6
	yamt-pdpolicy-base5:1.6
	elad-kernelauth-nbase:1.6
	yamt-pdpolicy-base4:1.6
	yamt-pdpolicy-base3:1.6
	yamt-pdpolicy-base2:1.6
	yamt-pdpolicy:1.6.0.42
	yamt-pdpolicy-base:1.6
	yamt-uio_vmspace-base5:1.6
	simonb-timecounters:1.6.0.40
	simonb-timecounters-base:1.6
	rpaulo-netinet-merge-pcb:1.6.0.38
	rpaulo-netinet-merge-pcb-base:1.6
	yamt-uio_vmspace:1.6.0.36
	yamt-readahead-base3:1.6
	yamt-readahead-base2:1.6
	yamt-readahead:1.6.0.34
	yamt-readahead-base:1.6
	yamt-vop-base3:1.6
	yamt-vop-base2:1.6
	thorpej-vnode-attr:1.6.0.32
	thorpej-vnode-attr-base:1.6
	yamt-vop:1.6.0.30
	yamt-vop-base:1.6
	yamt-lazymbuf:1.6.0.28
	yamt-km-base4:1.6
	yamt-km-base3:1.6
	yamt-km-base2:1.6
	yamt-km:1.6.0.26
	yamt-km-base:1.6
	kent-audio2:1.6.0.24
	kent-audio2-base:1.6
	ktrace-lwp:1.6.0.22
	ktrace-lwp-base:1.6
	nathanw_sa_end:1.6
	nathanw_sa_before_merge:1.6
	gmcgarry_ctxsw:1.6.0.20
	gmcgarry_ctxsw_base:1.6
	gmcgarry_ucred:1.6.0.18
	gmcgarry_ucred_base:1.6
	nathanw_sa_base:1.6
	gehenna-devsw:1.6.0.16
	gehenna-devsw-base:1.6
	eeh-devprop:1.6.0.14
	eeh-devprop-base:1.6
	newlock:1.6.0.12
	newlock-base:1.6
	ifpoll-base:1.6
	nathanw_sa:1.6.0.8
	thorpej-mips-cache:1.6.0.6
	thorpej-mips-cache-base:1.6
	thorpej-devvp:1.6.0.4
	thorpej-devvp-base:1.6
	kqueue:1.6.0.2
	kqueue-base:1.6
	thorpej_scsipi_beforemerge:1.1
	thorpej_scsipi_base:1.1
	thorpej_scsipi:1.1.0.2
	thorpej_scsipi_nbase:1.1;
locks; strict;
comment	@# @;


1.6
date	2001.06.11.17.46.23;	author matt;	state dead;
branches
	1.6.8.1;
next	1.5;

1.5
date	2001.06.11.13.49.28;	author rearnsha;	state Exp;
branches;
next	1.4;

1.4
date	2001.06.09.05.38.24;	author matt;	state Exp;
branches;
next	1.3;

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

1.2
date	2001.05.29.02.20.24;	author mrg;	state Exp;
branches;
next	1.1;

1.1
date	2001.04.19.07.01.11;	author matt;	state Exp;
branches
	1.1.2.1;
next	;

1.6.8.1
date	2001.06.11.17.46.23;	author matt;	state dead;
branches;
next	1.6.8.2;

1.6.8.2
date	2001.06.11.17.46.24;	author matt;	state dead;
branches;
next	;

1.1.2.1
date	2001.04.19.07.01.11;	author bouyer;	state dead;
branches;
next	1.1.2.2;

1.1.2.2
date	2001.04.21.17.54.09;	author bouyer;	state Exp;
branches;
next	;


desc
@@


1.6
log
@Use command Makefile.arm.  Move non-std LOADADDRESS to std.netwinder.  Add
netwinder-specific inclusion Makefile.
@
text
@#	$NetBSD: Makefile.netwinder,v 1.5 2001/06/11 13:49:28 rearnsha 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/netwinder/conf/``machineid''
# after which you should do
#	config machineid
# Machine generic makefile changes should be made in
#	/sys/arch/netwinder/conf/Makefile.netwinder
# after which config should be rerun for all machines of that type.

# 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

# source tree is located via $S relative to the compilation directory
.ifndef S
S!=	cd ../../../..; pwd
.endif
ARM32=		$S/arch/arm32
THISARM=	$S/arch/${TARGET_MACHINE}

HAVE_EGCS!=	${CC} --version | egrep "^(2\.[89]|egcs)" ; echo 
INCLUDES=	-I. -I$S/arch -I$S -nostdinc
CPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D_KERNEL_OPT -D${TARGET_MACHINE}
CWARNFLAGS?=	-Werror -Wall -Wcomment -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
CFLAGS=		${DEBUG} ${COPTS} ${CWARNFLAGS}
AFLAGS=		-x assembler-with-cpp -D_LOCORE

LOADADDRESS=	0xF000C000
LINKFLAGS=	-Ttext ${LOADADDRESS} -e start
STRIPFLAGS=	-g

%INCLUDES

HOSTED_CC=	${CC}
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
HOSTED_CFLAGS=	${CFLAGS}

### find out what to use for libkern
KERN_AS=	obj
.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 $<

HOSTED_C=	${HOSTED_CC} ${HOSTED_CFLAGS} ${HOSTED_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=	nwmmu.o locore.o \
		param.o ioconf.o ${OBJS} ${LIBCOMPAT} ${LIBKERN}
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
SYSTEM_LD_TAIL=	@@${SIZE} $@@; chmod 755 $@@

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+=	-S
LINKFLAGS+=	-x
.endif

%LOAD

assym.h: $S/kern/genassym.sh ${ARM32}/arm32/genassym.cf
	sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
	    < ${ARM32}/arm32/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.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 \
	    ${ARM32}/arm32/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=	${THISARM}/${TARGET_MACHINE}/nwmmu.S \
	${ARM32}/arm32/locore.S param.c ioconf.c ${CFILES} ${SFILES}
depend: .depend
.depend: ${SRCS} assym.h param.c
	${MKDEP} ${AFLAGS} ${CPPFLAGS} ${THISARM}/${TARGET_MACHINE}/nwmmu.S \
	    ${ARM32}/arm32/locore.S
	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
	test -z "${SFILES}" || ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
	sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
	    ${CPPFLAGS} < ${ARM32}/arm32/genassym.cf
	@@sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
	@@rm -f assym.dep

dependall: depend all

${OBJS} assym.h .depend: include-dir
include-dir:
	@@rm -rf include
	@@mkdir -p include/arm
.if (${S} == "../../../..")
	@@(cd include/arm; ln -s ../../$S/arch/${TARGET_MACHINE}/include ${TARGET_MACHINE})
	@@(cd include; ln -s ../$S/arch/arm/include machine)
.else
	@@ln -s $S/arch/${TARGET_MACHINE}/include include/arm/${TARGET_MACHINE}
	@@ln -s $S/arch/arm/include include/machine
.endif

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

# depend on maxusers
assym.h: Makefile

# depend on CPU configuration 
cpufunc.o cpufunc_asm.o: Makefile

# depend on DIAGNOSTIC etc.
cpuswitch.o fault.o machdep.o: Makefile


nwmmu.o: ${THISARM}/${TARGET_MACHINE}/nwmmu.S assym.h
	${NORMAL_S}

locore.o: ${ARM32}/arm32/locore.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

%RULES
@


1.6.8.1
log
@file Makefile.netwinder was added on branch nathanw_sa on 2001-06-11 17:46:24 +0000
@
text
@d1 231
@


1.6.8.2
log
@Use command Makefile.arm.  Move non-std LOADADDRESS to std.netwinder.  Add
netwinder-specific inclusion Makefile.
@
text
@@


1.5
log
@include-dir: A relative 'S' is up 4-levels.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.netwinder,v 1.4 2001/06/09 05:38:24 matt Exp $
@


1.4
log
@Move towards common Makefile.arm
Add a netwinder/autoconf.c
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.netwinder,v 1.3 2001/06/08 06:13:02 matt Exp $
d189 1
a189 1
.if (${S} == "../../..")
@


1.3
log
@add an include subdir rule in the Makefile to make netwinder use the
"new" include file structure to be used on arm ports.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.netwinder,v 1.2 2001/05/29 02:20:24 mrg Exp $
d38 1
a38 1
THISARM=	$S/arch/netwinder
d42 1
a42 1
CPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D_KERNEL_OPT -Dnetwinder
d170 1
a170 1
SRCS=	${THISARM}/netwinder/nwmmu.S \
d174 1
a174 1
	${MKDEP} ${AFLAGS} ${CPPFLAGS} ${THISARM}/netwinder/nwmmu.S \
d187 9
a195 4
	rm -rf include
	mkdir -p include/arm
	ln -s $S/arch/netwinder/include include/arm/netwinder
	ln -s $S/arch/arm/include include/machine
d213 1
a213 1
nwmmu.o: ${THISARM}/netwinder/nwmmu.S assym.h
@


1.2
log
@define _KERNEL_OPT as well as _KERNEL. we will use this in the future to
get kernel "opt_foo.h" headers, rather than _KERNEL && !_LKM.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.netwinder,v 1.1 2001/04/19 07:01:11 matt Exp $
d185 6
@


1.1
log
@A minimum amount to get netwinder support
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.netwinder,v 1.55 2001/02/19 13:26:17 bjh21 Exp $
d42 1
a42 1
CPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -Dnetwinder
@


1.1.2.1
log
@file Makefile.netwinder was added on branch thorpej_scsipi on 2001-04-21 17:54:09 +0000
@
text
@d1 220
@


1.1.2.2
log
@Sync with HEAD
@
text
@a0 220
#	$NetBSD: Makefile.netwinder,v 1.1.2.1 2001/04/21 17:54:09 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/netwinder/conf/``machineid''
# after which you should do
#	config machineid
# Machine generic makefile changes should be made in
#	/sys/arch/netwinder/conf/Makefile.netwinder
# after which config should be rerun for all machines of that type.

# 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

# source tree is located via $S relative to the compilation directory
.ifndef S
S!=	cd ../../../..; pwd
.endif
ARM32=		$S/arch/arm32
THISARM=	$S/arch/netwinder

HAVE_EGCS!=	${CC} --version | egrep "^(2\.[89]|egcs)" ; echo 
INCLUDES=	-I. -I$S/arch -I$S -nostdinc
CPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -Dnetwinder
CWARNFLAGS?=	-Werror -Wall -Wcomment -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
CFLAGS=		${DEBUG} ${COPTS} ${CWARNFLAGS}
AFLAGS=		-x assembler-with-cpp -D_LOCORE

LOADADDRESS=	0xF000C000
LINKFLAGS=	-Ttext ${LOADADDRESS} -e start
STRIPFLAGS=	-g

%INCLUDES

HOSTED_CC=	${CC}
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
HOSTED_CFLAGS=	${CFLAGS}

### find out what to use for libkern
KERN_AS=	obj
.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 $<

HOSTED_C=	${HOSTED_CC} ${HOSTED_CFLAGS} ${HOSTED_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=	nwmmu.o locore.o \
		param.o ioconf.o ${OBJS} ${LIBCOMPAT} ${LIBKERN}
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
SYSTEM_LD_TAIL=	@@${SIZE} $@@; chmod 755 $@@

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+=	-S
LINKFLAGS+=	-x
.endif

%LOAD

assym.h: $S/kern/genassym.sh ${ARM32}/arm32/genassym.cf
	sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
	    < ${ARM32}/arm32/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.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 \
	    ${ARM32}/arm32/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=	${THISARM}/netwinder/nwmmu.S \
	${ARM32}/arm32/locore.S param.c ioconf.c ${CFILES} ${SFILES}
depend: .depend
.depend: ${SRCS} assym.h param.c
	${MKDEP} ${AFLAGS} ${CPPFLAGS} ${THISARM}/netwinder/nwmmu.S \
	    ${ARM32}/arm32/locore.S
	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
	test -z "${SFILES}" || ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
	sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
	    ${CPPFLAGS} < ${ARM32}/arm32/genassym.cf
	@@sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
	@@rm -f assym.dep

dependall: depend all


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

# depend on maxusers
assym.h: Makefile

# depend on CPU configuration 
cpufunc.o cpufunc_asm.o: Makefile

# depend on DIAGNOSTIC etc.
cpuswitch.o fault.o machdep.o: Makefile


nwmmu.o: ${THISARM}/netwinder/nwmmu.S assym.h
	${NORMAL_S}

locore.o: ${ARM32}/arm32/locore.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

%RULES
@
