head	1.12;
access;
symbols
	perseant-exfatfs-base-20250801:1.12
	perseant-exfatfs-base-20240630:1.12
	perseant-exfatfs:1.12.0.48
	perseant-exfatfs-base:1.12
	cjep_sun2x:1.12.0.46
	cjep_sun2x-base:1.12
	cjep_staticlib_x-base1:1.12
	cjep_staticlib_x:1.12.0.44
	cjep_staticlib_x-base:1.12
	phil-wifi-20200421:1.12
	phil-wifi-20200411:1.12
	phil-wifi-20200406:1.12
	pgoyette-compat-merge-20190127:1.12
	pgoyette-compat-20190127:1.12
	pgoyette-compat-20190118:1.12
	pgoyette-compat-1226:1.12
	pgoyette-compat-1126:1.12
	pgoyette-compat-1020:1.12
	pgoyette-compat-0930:1.12
	pgoyette-compat-0906:1.12
	pgoyette-compat-0728:1.12
	pgoyette-compat-0625:1.12
	pgoyette-compat-0521:1.12
	pgoyette-compat-0502:1.12
	pgoyette-compat-0422:1.12
	pgoyette-compat-0415:1.12
	pgoyette-compat-0407:1.12
	pgoyette-compat-0330:1.12
	pgoyette-compat-0322:1.12
	pgoyette-compat-0315:1.12
	pgoyette-compat:1.12.0.42
	pgoyette-compat-base:1.12
	perseant-stdc-iso10646:1.12.0.40
	perseant-stdc-iso10646-base:1.12
	prg-localcount2-base3:1.12
	prg-localcount2-base2:1.12
	prg-localcount2-base1:1.12
	prg-localcount2:1.12.0.38
	prg-localcount2-base:1.12
	pgoyette-localcount-20170426:1.12
	bouyer-socketcan-base1:1.12
	pgoyette-localcount-20170320:1.12
	bouyer-socketcan:1.12.0.36
	bouyer-socketcan-base:1.12
	pgoyette-localcount-20170107:1.12
	pgoyette-localcount-20161104:1.12
	localcount-20160914:1.12
	pgoyette-localcount-20160806:1.12
	pgoyette-localcount-20160726:1.12
	pgoyette-localcount:1.12.0.34
	pgoyette-localcount-base:1.12
	netbsd-5-2-3-RELEASE:1.12
	netbsd-5-1-5-RELEASE:1.12
	yamt-pagecache-base9:1.12
	yamt-pagecache-tag8:1.12
	tls-earlyentropy:1.12.0.30
	tls-earlyentropy-base:1.12
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.12
	riastradh-drm2-base3:1.12
	netbsd-5-2-2-RELEASE:1.12
	netbsd-5-1-4-RELEASE:1.12
	netbsd-5-2-1-RELEASE:1.12
	netbsd-5-1-3-RELEASE:1.12
	agc-symver:1.12.0.32
	agc-symver-base:1.12
	tls-maxphys-base:1.12
	yamt-pagecache-base8:1.12
	netbsd-5-2:1.12.0.28
	yamt-pagecache-base7:1.12
	netbsd-5-2-RELEASE:1.12
	netbsd-5-2-RC1:1.12
	yamt-pagecache-base6:1.12
	yamt-pagecache-base5:1.12
	yamt-pagecache-base4:1.12
	netbsd-5-1-2-RELEASE:1.12
	netbsd-5-1-1-RELEASE:1.12
	yamt-pagecache-base3:1.12
	yamt-pagecache-base2:1.12
	yamt-pagecache:1.12.0.26
	yamt-pagecache-base:1.12
	bouyer-quota2-nbase:1.12
	bouyer-quota2:1.12.0.24
	bouyer-quota2-base:1.12
	matt-nb5-pq3:1.12.0.22
	matt-nb5-pq3-base:1.12
	netbsd-5-1:1.12.0.20
	netbsd-5-1-RELEASE:1.12
	netbsd-5-1-RC4:1.12
	netbsd-5-1-RC3:1.12
	netbsd-5-1-RC2:1.12
	netbsd-5-1-RC1:1.12
	netbsd-5-0-2-RELEASE:1.12
	netbsd-5-0-1-RELEASE:1.12
	jym-xensuspend-nbase:1.12
	netbsd-5-0:1.12.0.18
	netbsd-5-0-RELEASE:1.12
	netbsd-5-0-RC4:1.12
	netbsd-5-0-RC3:1.12
	netbsd-5-0-RC2:1.12
	jym-xensuspend:1.12.0.16
	jym-xensuspend-base:1.12
	netbsd-5-0-RC1:1.12
	netbsd-5:1.12.0.14
	netbsd-5-base:1.12
	yamt-pf42-base4:1.12
	yamt-pf42-base3:1.12
	hpcarm-cleanup-nbase:1.12
	yamt-pf42-base2:1.12
	yamt-pf42:1.12.0.12
	yamt-pf42-base:1.12
	mjf-devfs2:1.12.0.10
	mjf-devfs2-base:1.12
	keiichi-mipv6:1.12.0.8
	keiichi-mipv6-base:1.12
	mjf-devfs:1.12.0.6
	mjf-devfs-base:1.12
	cube-autoconf:1.12.0.4
	cube-autoconf-base:1.12
	hpcarm-cleanup:1.12.0.2
	hpcarm-cleanup-base:1.12
	netbsd-1-5-PATCH003:1.7.4.2
	netbsd-1-5-PATCH002:1.7.4.2
	netbsd-1-5-PATCH001:1.7.4.2
	netbsd-1-5-RELEASE:1.7.4.2
	netbsd-1-5-BETA2:1.7.4.2
	netbsd-1-5-BETA:1.7.4.2
	netbsd-1-4-PATCH003:1.1.2.2
	netbsd-1-5-ALPHA2:1.7
	netbsd-1-5:1.7.0.4
	netbsd-1-5-base:1.7
	minoura-xpg4dl:1.7.0.2
	minoura-xpg4dl-base:1.7
	netbsd-1-4-PATCH002:1.1.2.2
	wrstuden-devbsize-19991221:1.4
	wrstuden-devbsize:1.3.0.2
	wrstuden-devbsize-base:1.4
	comdex-fall-1999:1.4.0.2
	comdex-fall-1999-base:1.4
	netbsd-1-4-PATCH001:1.1
	netbsd-1-4-RELEASE:1.1
	netbsd-1-4:1.1.0.2
	netbsd-1-4-base:1.1;
locks; strict;
comment	@# @;


1.12
date	2000.10.20.11.56.59;	author pk;	state dead;
branches;
next	1.11;

1.11
date	2000.09.04.16.36.59;	author abs;	state Exp;
branches;
next	1.10;

1.10
date	2000.08.30.23.51.51;	author jhawk;	state Exp;
branches;
next	1.9;

1.9
date	2000.08.24.13.38.33;	author abs;	state Exp;
branches;
next	1.8;

1.8
date	2000.08.22.14.11.45;	author abs;	state Exp;
branches;
next	1.7;

1.7
date	2000.05.02.16.06.55;	author sjg;	state Exp;
branches
	1.7.4.1;
next	1.6;

1.6
date	2000.02.07.11.09.35;	author pk;	state Exp;
branches;
next	1.5;

1.5
date	2000.01.10.15.17.32;	author pk;	state Exp;
branches;
next	1.4;

1.4
date	99.11.09.15.48.02;	author mycroft;	state Exp;
branches
	1.4.2.1;
next	1.3;

1.3
date	99.07.04.16.07.00;	author abs;	state Exp;
branches
	1.3.2.1;
next	1.2;

1.2
date	99.05.11.20.47.00;	author veego;	state Exp;
branches;
next	1.1;

1.1
date	99.04.30.05.09.44;	author abs;	state Exp;
branches
	1.1.2.1;
next	;

1.7.4.1
date	2000.08.24.13.43.13;	author abs;	state Exp;
branches;
next	1.7.4.2;

1.7.4.2
date	2000.10.19.14.24.22;	author tv;	state dead;
branches;
next	;

1.4.2.1
date	99.11.09.15.48.02;	author mycroft;	state dead;
branches;
next	1.4.2.2;

1.4.2.2
date	99.11.09.15.48.03;	author mycroft;	state Exp;
branches;
next	;

1.3.2.1
date	99.12.27.18.28.41;	author wrstuden;	state Exp;
branches;
next	;

1.1.2.1
date	99.04.30.05.09.44;	author he;	state dead;
branches;
next	1.1.2.2;

1.1.2.2
date	2000.03.01.00.23.40;	author he;	state Exp;
branches;
next	;


desc
@@


1.12
log
@Boot from floppy now requires two disk images:
	- a bootable bootfs which contains a spartan md-based `ramdisk'
	  filesystem, which loads the tar file image:
	- instfs, which is constructed from the miniroot filesystem
	  and contains all installation utilities.

The current miniroot image also supersedes the former separate
{bootfs,ramdisk}.sysinst tools.
@
text
@#	$NetBSD: Makefile,v 1.11 2000/09/04 16:36:59 abs Exp $

TOP=		${.CURDIR}/..
MINIROOT=	${TOP}/../miniroot
HACKSRC=	${TOP}/../utils/libhack
SRCROOT=	${TOP}/../..
WARNS=1

.if ${MACHINE_ARCH} == "i386"
RAW_PART=	d
.else
RAW_PART=	c
.endif

# Need to add more cases
.if ${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "m68k"
FS_END=		be
.else		# i386, pmax
FS_END=		le
.endif

AUXDEPENDS= 	dot.profile termcap.mini \
		dist/base_obsolete dist/comp_obsolete \
		dist/games_obsolete dist/man_obsolete dist/misc_obsolete \
		dist/secr_obsolete dist/xbase_obsolete dist/xserver_obsolete
AUXCLEAN=	list ${CBIN}.conf dot.profile

CBIN=		ramdiskbin

MOUNT_POINT?=	/mnt
# DEV/RDEV file system device, CDEV/RDEV vnconfig device
VND?=		vnd0
VND_DEV=	/dev/${VND}a
VND_RDEV=	/dev/r${VND}a
VND_CDEV=	/dev/${VND}${RAW_PART}
VND_CRDEV=	/dev/r${VND}${RAW_PART}
IMAGE?=		syramdisk.fs
CSIZE?=         3584
MDEC=		${DESTDIR}/usr/mdec

LISTS=		list
CRUNCHCONF=	${CBIN}.conf
MTREE=		mtree.conf

DISKTYPE?=	floppyinstfs

all: ${CBIN} ${AUXDEPENDS} ${MTREE} ${LISTS} dot.profile
	dd if=/dev/zero of=${IMAGE} count=${CSIZE}
	vnconfig -v -c ${VND_CDEV} ${IMAGE}
	disklabel -f ${.CURDIR}/disktab -rw ${VND_CDEV} ${DISKTYPE}
	newfs -B ${FS_END} -m 0 -o space -i 5120 -c 56 ${VND_RDEV} ${DISKTYPE}
	mount ${VND_DEV} ${MOUNT_POINT}
	mtree -def ${.CURDIR}/${MTREE} -p ${MOUNT_POINT}/ -u
	TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \
	    KERNOBJDIR=${KERNOBJDIR} \
	    TARGDIR=${MOUNT_POINT} sh ${TOP}/runlist.sh ${LISTS}
	@@echo ""
	@@df -i ${MOUNT_POINT}
	@@echo ""
	umount ${MOUNT_POINT}
	vnconfig -u ${VND_CDEV}

unconfig:
	-umount -f ${MOUNT_POINT}
	-vnconfig -u ${VND_DEV}
	-/bin/rm -f ${IMAGE}

dot.profile: dot.profile.m4
	m4 -DMACHINE_ARCH=${MACHINE_ARCH} -DMACHINE=${MACHINE} \
				${.ALLSRC} > ${.TARGET}

${LISTS}: ${LISTS}.m4
	m4 -DMACHINE_ARCH=${MACHINE_ARCH} -DMACHINE=${MACHINE} \
			-DSRCROOT=${SRCROOT} ${.ALLSRC} > ${.TARGET}

${CBIN}.conf: ${CBIN}.m4
	m4 -DMACHINE_ARCH=${MACHINE_ARCH} -DMACHINE=${MACHINE} \
				${.ALLSRC} > ${.TARGET}

${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF}
	crunchgen -D ${SRCROOT} -L ${DESTDIR}/usr/lib ${.ALLSRC}

${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
	${MAKE} -f ${CBIN}.mk all

# This is listed in ramdiskbin.conf but is built here.
${CBIN}: libhack.o

# Use stubs to eliminate some large stuff from libc
.include "${HACKSRC}/Makefile.inc"

# turn off small gethostby* temporarily
HACKOBJS:= getcap.o getgrent.o getnet.o getnetgr.o getpwent.o setlocale.o yplib.o

clean cleandir distclean:
	/bin/rm -f *.core ${AUXCLEAN} ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache *.o *.lo *.cro *.c

.ifndef RELEASEDIR
release:
	@@echo setenv RELEASEDIR first
	@@false
.else
release: $(IMAGE)
	gzip -c -9 < $(.OBJDIR)/$(IMAGE) \
		> $(RELEASEDIR)/installation/bootfs/$(IMAGE).gz
.endif	# RELEASEDIR check

.include <bsd.own.mk>
.include <bsd.obj.mk>
.include <bsd.subdir.mk>
.include <bsd.sys.mk>
@


1.11
log
@Handle 'make release'
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.10 2000/08/30 23:51:51 jhawk Exp $
@


1.10
log
@Use
  ${MAKE}
instead of
  make
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.9 2000/08/24 13:38:33 abs Exp $
d97 10
@


1.9
log
@Removedaccidental CCOPTS+=-Os
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8 2000/08/22 14:11:45 abs Exp $
d84 1
a84 1
	make -f ${CBIN}.mk all
@


1.8
log
@Bring up to date and save some more space (as ever).
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.7 2000/05/02 16:06:55 sjg Exp $
a7 1
COPTS+=-Os
@


1.7
log
@use bsd.kernobj.mk to tell us KERNOBJDIR for compiled kernels.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.6 2000/02/07 11:09:35 pk Exp $
d8 1
d23 1
a23 1
AUXDEPENDS= 	dot.profile disktab.preinstall termcap.mini \
d39 1
a39 1
CSIZE?=         3312
d52 1
a52 1
	newfs -B ${FS_END} -m 0 -o space -i 5120 -c 80 ${VND_RDEV} ${DISKTYPE}
@


1.7.4.1
log
@Pullup revisions 1.8 and 1.9.
1.8 already approved by thorpej
1.9 removes accidental COPTS+=-Os introduced in 1.8
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.9 2000/08/24 13:38:33 abs Exp $
d22 1
a22 1
AUXDEPENDS= 	dot.profile termcap.mini \
d38 1
a38 1
CSIZE?=         3584
d51 1
a51 1
	newfs -B ${FS_END} -m 0 -o space -i 5120 -c 56 ${VND_RDEV} ${DISKTYPE}
@


1.7.4.2
log
@Commit by patch [pk]:
- boot floppy image out of space: use a two disk system
- update INSTALL kernel
- updates/fixes to miniroot image
- support for building CD image
- update installation doc
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.7.4.1 2000/08/24 13:43:13 abs Exp $
@


1.6
log
@clean .cro files.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.5 2000/01/10 15:17:32 pk Exp $
d55 1
@


1.5
log
@Remove version number from boot image files.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.4 1999/11/09 15:48:02 mycroft Exp $
d95 1
a95 1
	/bin/rm -f *.core ${AUXCLEAN} ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache *.o *.lo *.c
@


1.4
log
@Make this build again.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.3 1999/07/04 16:07:00 abs Exp $
d37 1
a37 1
IMAGE?=		syramdisk-${REV}.fs
@


1.4.2.1
log
@file Makefile was added on branch comdex-fall-1999 on 1999-11-09 15:48:03 +0000
@
text
@d1 100
@


1.4.2.2
log
@Make this build again.
@
text
@a0 100
#	$NetBSD: Makefile,v 1.4 1999/11/09 15:48:02 mycroft Exp $

TOP=		${.CURDIR}/..
MINIROOT=	${TOP}/../miniroot
HACKSRC=	${TOP}/../utils/libhack
SRCROOT=	${TOP}/../..
WARNS=1

.if ${MACHINE_ARCH} == "i386"
RAW_PART=	d
.else
RAW_PART=	c
.endif

# Need to add more cases
.if ${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "m68k"
FS_END=		be
.else		# i386, pmax
FS_END=		le
.endif

AUXDEPENDS= 	dot.profile disktab.preinstall termcap.mini \
		dist/base_obsolete dist/comp_obsolete \
		dist/games_obsolete dist/man_obsolete dist/misc_obsolete \
		dist/secr_obsolete dist/xbase_obsolete dist/xserver_obsolete
AUXCLEAN=	list ${CBIN}.conf dot.profile

CBIN=		ramdiskbin

MOUNT_POINT?=	/mnt
# DEV/RDEV file system device, CDEV/RDEV vnconfig device
VND?=		vnd0
VND_DEV=	/dev/${VND}a
VND_RDEV=	/dev/r${VND}a
VND_CDEV=	/dev/${VND}${RAW_PART}
VND_CRDEV=	/dev/r${VND}${RAW_PART}
IMAGE?=		syramdisk-${REV}.fs
CSIZE?=         3312
MDEC=		${DESTDIR}/usr/mdec

LISTS=		list
CRUNCHCONF=	${CBIN}.conf
MTREE=		mtree.conf

DISKTYPE?=	floppyinstfs

all: ${CBIN} ${AUXDEPENDS} ${MTREE} ${LISTS} dot.profile
	dd if=/dev/zero of=${IMAGE} count=${CSIZE}
	vnconfig -v -c ${VND_CDEV} ${IMAGE}
	disklabel -f ${.CURDIR}/disktab -rw ${VND_CDEV} ${DISKTYPE}
	newfs -B ${FS_END} -m 0 -o space -i 5120 -c 80 ${VND_RDEV} ${DISKTYPE}
	mount ${VND_DEV} ${MOUNT_POINT}
	mtree -def ${.CURDIR}/${MTREE} -p ${MOUNT_POINT}/ -u
	TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \
	    TARGDIR=${MOUNT_POINT} sh ${TOP}/runlist.sh ${LISTS}
	@@echo ""
	@@df -i ${MOUNT_POINT}
	@@echo ""
	umount ${MOUNT_POINT}
	vnconfig -u ${VND_CDEV}

unconfig:
	-umount -f ${MOUNT_POINT}
	-vnconfig -u ${VND_DEV}
	-/bin/rm -f ${IMAGE}

dot.profile: dot.profile.m4
	m4 -DMACHINE_ARCH=${MACHINE_ARCH} -DMACHINE=${MACHINE} \
				${.ALLSRC} > ${.TARGET}

${LISTS}: ${LISTS}.m4
	m4 -DMACHINE_ARCH=${MACHINE_ARCH} -DMACHINE=${MACHINE} \
			-DSRCROOT=${SRCROOT} ${.ALLSRC} > ${.TARGET}

${CBIN}.conf: ${CBIN}.m4
	m4 -DMACHINE_ARCH=${MACHINE_ARCH} -DMACHINE=${MACHINE} \
				${.ALLSRC} > ${.TARGET}

${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF}
	crunchgen -D ${SRCROOT} -L ${DESTDIR}/usr/lib ${.ALLSRC}

${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
	make -f ${CBIN}.mk all

# This is listed in ramdiskbin.conf but is built here.
${CBIN}: libhack.o

# Use stubs to eliminate some large stuff from libc
.include "${HACKSRC}/Makefile.inc"

# turn off small gethostby* temporarily
HACKOBJS:= getcap.o getgrent.o getnet.o getnetgr.o getpwent.o setlocale.o yplib.o

clean cleandir distclean:
	/bin/rm -f *.core ${AUXCLEAN} ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache *.o *.lo *.c

.include <bsd.own.mk>
.include <bsd.obj.mk>
.include <bsd.subdir.mk>
.include <bsd.sys.mk>
@


1.3
log
@Remove *.lo in make clean
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.2 1999/05/11 20:47:00 veego Exp $
d38 1
a38 1
CSIZE?=         2880
d45 1
a45 1
DISKTYPE?=	floppy3
d49 2
a50 2
	vnconfig -t ${DISKTYPE} -v -c ${VND_CDEV} ${IMAGE}
	disklabel -rw ${VND_CDEV} ${DISKTYPE}
@


1.3.2.1
log
@Pull up to last week's -current.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.4 1999/11/09 15:48:02 mycroft Exp $
d38 1
a38 1
CSIZE?=         3312
d45 1
a45 1
DISKTYPE?=	floppyinstfs
d49 2
a50 2
	vnconfig -v -c ${VND_CDEV} ${IMAGE}
	disklabel -f ${.CURDIR}/disktab -rw ${VND_CDEV} ${DISKTYPE}
@


1.2
log
@Sync with the recent crunchgen changes.
- Remove *.cro files and not the obsoleted *.lo files.

From Bill Studenmund commit message:
> 3) Generate .cro files rather than .lo files. .lo now is used for "local
> objects" - obj's for the host machine not the target machine.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.1 1999/04/30 05:09:44 abs Exp $
d95 1
a95 1
	/bin/rm -f *.core ${AUXCLEAN} ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache *.o *.cro *.c
@


1.1
log
@Add sysinst setup for sparc, does not affect existing script based install.
ramdisk.sysinst should work unchanged for i386 also. Would be good to merge
after 1.4.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.11.2.1 1999/04/20 02:21:20 cjs Exp $
d95 1
a95 1
	/bin/rm -f *.core ${AUXCLEAN} ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache *.o *.lo *.c
@


1.1.2.1
log
@file Makefile was added on branch netbsd-1-4 on 2000-03-01 00:23:40 +0000
@
text
@d1 100
@


1.1.2.2
log
@Apply patch (requested by toddpw):
  Fix build errors in distrib/sparc, support ``release'' target,
  increase size of ramdisk while removing dependency on /etc/disktab,
  and notifying kernel.
@
text
@a0 113
#	$NetBSD: Makefile,v 1.1.2.1 2000/03/01 00:23:40 he Exp $

TOP=		${.CURDIR}/..
MINIROOT=	${TOP}/../miniroot

.include "${TOP}/Makefile.inc"

HACKSRC=	${TOP}/../utils/libhack
SRCROOT=	${TOP}/../..
WARNS=1

.if ${MACHINE_ARCH} == "i386"
RAW_PART=	d
.else
RAW_PART=	c
.endif

# Need to add more cases
.if ${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "m68k"
FS_END=		be
.else		# i386, pmax
FS_END=		le
.endif

AUXDEPENDS= 	dot.profile disktab.preinstall termcap.mini \
		dist/base_obsolete dist/comp_obsolete \
		dist/games_obsolete dist/man_obsolete dist/misc_obsolete \
		dist/secr_obsolete dist/xbase_obsolete dist/xserver_obsolete
AUXCLEAN=	list ${CBIN}.conf dot.profile

CBIN=		ramdiskbin

MOUNT_POINT?=	/mnt
# DEV/RDEV file system device, CDEV/RDEV vnconfig device
VND?=		vnd0
VND_DEV=	/dev/${VND}a
VND_RDEV=	/dev/r${VND}a
VND_CDEV=	/dev/${VND}${RAW_PART}
VND_CRDEV=	/dev/r${VND}${RAW_PART}
IMAGE?=		syramdisk-${REV}.fs
CSIZE?=         2880
MDEC=		${DESTDIR}/usr/mdec

LISTS=		list
CRUNCHCONF=	${CBIN}.conf
MTREE=		mtree.conf

DISKTYPE?=	floppy3

all: ${CBIN} ${AUXDEPENDS} ${MTREE} ${LISTS} dot.profile
	dd if=/dev/zero of=${IMAGE} count=${CSIZE}
	vnconfig -t ${DISKTYPE} -v -c ${VND_CDEV} ${IMAGE}
	disklabel -rw ${VND_CDEV} ${DISKTYPE}
	newfs -B ${FS_END} -m 0 -o space -i 5120 -c 80 ${VND_RDEV} ${DISKTYPE}
	mount ${VND_DEV} ${MOUNT_POINT}
	mtree -def ${.CURDIR}/${MTREE} -p ${MOUNT_POINT}/ -u
	TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \
	    TARGDIR=${MOUNT_POINT} sh ${TOP}/runlist.sh ${LISTS}
	@@echo ""
	@@df -i ${MOUNT_POINT}
	@@echo ""
	umount ${MOUNT_POINT}
	vnconfig -u ${VND_CDEV}

unconfig:
	-umount -f ${MOUNT_POINT}
	-vnconfig -u ${VND_DEV}
	-/bin/rm -f ${IMAGE}

dot.profile: dot.profile.m4
	m4 -DMACHINE_ARCH=${MACHINE_ARCH} -DMACHINE=${MACHINE} \
				${.ALLSRC} > ${.TARGET}

${LISTS}: ${LISTS}.m4
	m4 -DMACHINE_ARCH=${MACHINE_ARCH} -DMACHINE=${MACHINE} \
			-DSRCROOT=${SRCROOT} ${.ALLSRC} > ${.TARGET}

${CBIN}.conf: ${CBIN}.m4
	m4 -DMACHINE_ARCH=${MACHINE_ARCH} -DMACHINE=${MACHINE} \
				${.ALLSRC} > ${.TARGET}

${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF}
	crunchgen -D ${SRCROOT} -L ${DESTDIR}/usr/lib ${.ALLSRC}

${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
	make -f ${CBIN}.mk all

# This is listed in ramdiskbin.conf but is built here.
${CBIN}: libhack.o

# Use stubs to eliminate some large stuff from libc
.include "${HACKSRC}/Makefile.inc"

# turn off small gethostby* temporarily
HACKOBJS:= getcap.o getgrent.o getnet.o getnetgr.o getpwent.o setlocale.o yplib.o

clean cleandir distclean:
	/bin/rm -f *.core ${AUXCLEAN} ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache *.o *.lo *.c

.ifndef RELEASEDIR
release:
	@@echo setenv RELEASEDIR first
	@@false
.else
release: ${IMAGE}
	gzip -c -9 < $(.OBJDIR)/${IMAGE} \
		> $(RELEASEDIR)/installation/ramdisk/${IMAGE}.gz
.endif	# RELEASEDIR check

.include <bsd.own.mk>
.include <bsd.obj.mk>
.include <bsd.subdir.mk>
.include <bsd.sys.mk>
@
