2001-10-22 03:23:19 +04:00
|
|
|
# $NetBSD: Makefile,v 1.13 2001/10/21 23:23:21 jmc 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
|
2001-10-21 07:30:36 +04:00
|
|
|
CRUNCHCONF= ${.CURDIR}/${CBIN}.conf
|
1997-12-18 01:13:32 +03:00
|
|
|
|
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
|
|
|
|
|
2000-11-01 10:57:55 +03:00
|
|
|
CRUNCHGEN?= crunchgen
|
2001-10-22 03:23:19 +04:00
|
|
|
MDSETIMAGE?= mdsetimage
|
2001-10-13 10:15:15 +04:00
|
|
|
MTREE?= mtree
|
2000-11-01 10:57:55 +03:00
|
|
|
|
1997-12-18 01:13:32 +03:00
|
|
|
# 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
|
2000-11-24 22:39:08 +03:00
|
|
|
NBLKS= 1024
|
1997-12-18 01:13:32 +03:00
|
|
|
|
|
|
|
CLEANFILES= netbsd-rd ${IMAGE}
|
|
|
|
|
|
|
|
netbsd-rd: ${IMAGE}
|
|
|
|
cp ${KERNEL} netbsd-tmp
|
2001-10-22 03:23:19 +04:00
|
|
|
${MDSETIMAGE} netbsd-tmp ${IMAGE}
|
1997-12-18 01:13:32 +03:00
|
|
|
-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}
|
2001-10-13 10:15:15 +04:00
|
|
|
${MTREE} -def ${.CURDIR}/${TREE} -p ${MOUNT_POINT}/ -u
|
1997-12-18 01:13:32 +03:00
|
|
|
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}
|
2000-11-01 10:57:55 +03:00
|
|
|
${CRUNCHGEN} -D ${BSDSRCDIR} -L ${DESTDIR}/usr/lib ${CRUNCHCONF}
|
1997-12-18 01:13:32 +03:00
|
|
|
|
|
|
|
${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"
|
|
|
|
|
2000-11-24 22:39:08 +03:00
|
|
|
release: netbsd-rd
|
2000-11-25 00:58:36 +03:00
|
|
|
-mkdir -p ${RELEASEDIR}/installation/tapeimage
|
2000-11-24 22:39:08 +03:00
|
|
|
gzip < netbsd-rd > ${RELEASEDIR}/installation/tapeimage/netbsd-rd.gz
|
|
|
|
|
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>
|