2000-08-31 03:51:46 +04:00
|
|
|
# $NetBSD: Makefile,v 1.7 2000/08/30 23:51:50 jhawk Exp $
|
1997-12-18 01:13:32 +03:00
|
|
|
|
|
|
|
TOP= ${.CURDIR}/..
|
|
|
|
|
|
|
|
# This include just sets REV=XX
|
|
|
|
.include "${TOP}/Makefile.inc"
|
|
|
|
|
|
|
|
IMAGE= ramdisk-${REV}.fs
|
|
|
|
CBIN= rd_bin
|
|
|
|
|
|
|
|
TREE= mtree.conf
|
|
|
|
LISTS= list
|
|
|
|
CRUNCHCONF= ${CBIN}.conf
|
|
|
|
|
2000-05-02 20:06:45 +04:00
|
|
|
KERNEL= ${KERNOBJDIR}/RAMDISK/netbsd
|
1997-12-18 01:13:32 +03:00
|
|
|
|
|
|
|
MOUNT_POINT?= /mnt
|
|
|
|
# DEV/RDEV file system device, CDEV/RDEV vnconfig device
|
|
|
|
VND?= vnd0
|
|
|
|
VND_CDEV= /dev/${VND}c
|
|
|
|
VND_CRDEV= /dev/r${VND}c
|
|
|
|
|
|
|
|
# These are all the parameters for the root fs: (384K)
|
|
|
|
# NOTE: If you change NBLKS, you *must* also edit the
|
|
|
|
# rdroot entry in /etc/disktab
|
|
|
|
DISKTYPE= rdroot
|
|
|
|
NBLKS= 768
|
|
|
|
|
|
|
|
CLEANFILES= netbsd-rd ${IMAGE}
|
|
|
|
|
|
|
|
netbsd-rd: ${IMAGE}
|
|
|
|
cp ${KERNEL} netbsd-tmp
|
|
|
|
mdsetimage netbsd-tmp ${IMAGE}
|
|
|
|
-mv -f netbsd-tmp $@
|
|
|
|
|
|
|
|
${IMAGE}: ${TREE} ${LISTS} ${CBIN}
|
|
|
|
dd if=/dev/zero of=${IMAGE} count=${NBLKS}
|
|
|
|
vnconfig -t ${DISKTYPE} -v -c ${VND_CDEV} ${IMAGE}
|
1999-03-04 23:32:18 +03:00
|
|
|
newfs -B be -m 0 -o space -i 2048 ${VND_CRDEV} ${DISKTYPE}
|
1997-12-18 01:13:32 +03:00
|
|
|
mount ${VND_CDEV} ${MOUNT_POINT}
|
|
|
|
mtree -def ${.CURDIR}/${TREE} -p ${MOUNT_POINT}/ -u
|
|
|
|
TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \
|
2000-05-02 20:06:45 +04:00
|
|
|
KERNOBJDIR=${KERNOBJDIR} \
|
1997-12-18 01:13:32 +03:00
|
|
|
TARGDIR=${MOUNT_POINT} sh ${.CURDIR}/runlist.sh ${.CURDIR}/${LISTS}
|
|
|
|
@echo ""
|
|
|
|
@df -i ${MOUNT_POINT}
|
|
|
|
@echo ""
|
|
|
|
umount ${MOUNT_POINT}
|
|
|
|
vnconfig -u ${VND_CDEV}
|
|
|
|
|
|
|
|
unconfig:
|
|
|
|
-umount -f ${MOUNT_POINT}
|
|
|
|
-vnconfig -u ${VND_CDEV}
|
|
|
|
-/bin/rm -f ${IMAGE}
|
|
|
|
|
|
|
|
# Do not delete this if I change my mind and kill make...
|
|
|
|
.PRECIOUS: ${IMAGE}
|
|
|
|
|
|
|
|
CLEANFILES+= ${CBIN} ${CBIN}.c ${CBIN}.cache ${CBIN}.mk ${CBIN}.syms
|
1999-05-12 00:46:58 +04:00
|
|
|
CLEANFILES+= *.cro *_stub.o *_stub.c
|
1997-12-18 01:13:32 +03:00
|
|
|
|
|
|
|
${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF}
|
|
|
|
crunchgen -D ${BSDSRCDIR} -L ${DESTDIR}/usr/lib ${CRUNCHCONF}
|
|
|
|
|
|
|
|
${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
|
2000-08-31 03:51:46 +04:00
|
|
|
${MAKE} -f ${CBIN}.mk all
|
1997-12-18 01:13:32 +03:00
|
|
|
|
|
|
|
# This is listed in rd_bin.conf but is built here.
|
|
|
|
${CBIN} : libhack.o
|
|
|
|
|
|
|
|
# Use stubs to eliminate some large stuff from libc
|
|
|
|
HACKSRC=${TOP}/../utils/libhack
|
|
|
|
.include "${HACKSRC}/Makefile.inc"
|
|
|
|
|
1998-09-05 18:46:13 +04:00
|
|
|
clean cleandir distclean:
|
1997-12-18 01:13:32 +03:00
|
|
|
-rm -f a.out core *.core *.o
|
|
|
|
-rm -f ${CLEANFILES}
|
|
|
|
|
|
|
|
# Standard rules needed by the above...
|
2000-05-02 20:06:45 +04:00
|
|
|
.include <bsd.kernobj.mk>
|
1997-12-18 01:13:32 +03:00
|
|
|
.include <bsd.obj.mk>
|