2002-04-06 22:16:09 +04:00
|
|
|
# $NetBSD: Makefile,v 1.9 2002/04/06 18:16:12 tsutsui Exp $
|
2001-05-18 04:16:36 +04:00
|
|
|
|
|
|
|
TOP= ${.CURDIR}/..
|
|
|
|
|
2002-03-06 15:14:26 +03:00
|
|
|
# This include just sets DISTRIBREV=XX
|
2001-05-18 04:16:36 +04:00
|
|
|
.include "${TOP}/Makefile.inc"
|
2001-10-22 03:23:19 +04:00
|
|
|
.include <bsd.own.mk>
|
2001-05-18 04:16:36 +04:00
|
|
|
|
2002-04-06 22:16:09 +04:00
|
|
|
DBG= -Os
|
|
|
|
|
2001-05-18 04:16:36 +04:00
|
|
|
IMAGE= ramdisk
|
|
|
|
CBIN= rd_bin
|
|
|
|
|
|
|
|
TREE= ${TOP}/common/${IMAGE}.tree
|
|
|
|
|
|
|
|
LISTS= ${TOP}/common/${CBIN}.list \
|
|
|
|
${TOP}/common/${IMAGE}.list
|
|
|
|
|
|
|
|
KERNEL = ${KERNOBJDIR}/RAMDISK/netbsd
|
|
|
|
|
|
|
|
MOUNT_POINT?= /mnt
|
|
|
|
VND?= vnd1
|
|
|
|
VND_DEV?= /dev/${VND}a
|
|
|
|
VND_RDEV?= /dev/r${VND}a
|
|
|
|
|
|
|
|
# These are all the parameters for the root fs:
|
|
|
|
DISKTYPE= rdroot
|
|
|
|
SIZE= 400k
|
|
|
|
# bigendian, minfree, opt, b/i , cpg
|
|
|
|
NEWFSARGS= -B be -m 0 -o space -i 4096 -c 20
|
2001-12-17 23:27:39 +03:00
|
|
|
MDSETIMAGE?= mdsetimage
|
|
|
|
MTREE?= mtree
|
2001-05-18 04:16:36 +04:00
|
|
|
|
|
|
|
KERNELS= netbsd.RAMDISK
|
|
|
|
CLEANFILES= $(KERNELS) ${IMAGE}.fs netbsd-tmp
|
|
|
|
|
|
|
|
all: $(KERNELS)
|
|
|
|
|
|
|
|
netbsd.RAMDISK : ${IMAGE}.fs
|
|
|
|
cp ${KERNEL} netbsd-tmp
|
2001-10-22 03:23:19 +04:00
|
|
|
${MDSETIMAGE} -v netbsd-tmp ${IMAGE}.fs
|
2001-05-18 04:16:36 +04:00
|
|
|
-mv -f netbsd-tmp $@
|
|
|
|
|
|
|
|
${IMAGE}.fs: ${TREE} ${LISTS} ${CBIN}
|
|
|
|
dd if=/dev/zero of=${IMAGE}.fs bs=${SIZE} count=1
|
2001-12-17 23:27:39 +03:00
|
|
|
vnconfig -f ${DESTDIR}/etc/disktab -t ${DISKTYPE} -v \
|
|
|
|
-c ${VND} ${IMAGE}.fs
|
|
|
|
disklabel -rw -f ${DESTDIR}/etc/disktab ${VND} ${DISKTYPE}
|
2001-05-18 04:16:36 +04:00
|
|
|
newfs ${NEWFSARGS} ${VND_RDEV}
|
|
|
|
mount ${VND_DEV} ${MOUNT_POINT}
|
2001-10-13 10:15:15 +04:00
|
|
|
${MTREE} -def ${TREE} -p ${MOUNT_POINT}/ -u
|
2001-05-18 04:16:36 +04:00
|
|
|
TOPDIR=${TOP} CURDIR=${.CURDIR} DESTDIR=${DESTDIR} \
|
|
|
|
OBJDIR=${.OBJDIR} TARGDIR=${MOUNT_POINT} \
|
|
|
|
sh ${TOP}/common/RunList.sh ${LISTS}
|
|
|
|
sync
|
|
|
|
@echo ""
|
|
|
|
@df -i ${MOUNT_POINT}
|
|
|
|
@echo ""
|
|
|
|
umount ${MOUNT_POINT}
|
2001-12-17 23:27:39 +03:00
|
|
|
dd if=${VND_DEV} of=${IMAGE}-tmp.fs bs=${SIZE} count=1
|
2001-05-18 04:16:36 +04:00
|
|
|
vnconfig -u ${VND}
|
2001-12-17 23:27:39 +03:00
|
|
|
mv ${IMAGE}-tmp.fs ${IMAGE}.fs
|
2001-05-18 04:16:36 +04:00
|
|
|
|
|
|
|
unconfig:
|
|
|
|
-umount -f ${MOUNT_POINT}
|
2001-12-17 23:27:39 +03:00
|
|
|
-vnconfig -u ${VND}
|
2001-05-18 04:16:36 +04:00
|
|
|
-/bin/rm -f ${IMAGE}.fs
|
|
|
|
|
|
|
|
# Do not delete this if I change my mind and kill make...
|
|
|
|
.PRECIOUS: ${IMAGE}.fs
|
|
|
|
|
|
|
|
# Rules for making ${CBIN} ...
|
|
|
|
.include "${TOP}/common/Make.crunch"
|
|
|
|
|
|
|
|
|
|
|
|
# Use stubs to eliminate some large stuff from libc
|
2002-03-28 07:33:21 +03:00
|
|
|
HACKSRC= ${DISTRIBDIR}/utils/libhack
|
|
|
|
HACKOBJS= gethost.o
|
|
|
|
.include "${HACKSRC}/Makefile.inc"
|
|
|
|
${CBIN}: libhack.o
|
2001-12-17 23:27:39 +03:00
|
|
|
CPPFLAGS+=-I${DESTDIR}/usr/include
|
2001-05-18 04:16:36 +04:00
|
|
|
|
|
|
|
clean cleandir distclean:
|
|
|
|
-rm -f a.out core *.core *.o *.cro *.c
|
|
|
|
-rm -f ${CLEANFILES}
|
|
|
|
|
|
|
|
.if !defined(RELEASEDIR)
|
|
|
|
release:
|
|
|
|
@echo setenv RELEASEDIR before doing that!
|
|
|
|
@false
|
|
|
|
.else # RELEASEDIR
|
|
|
|
release: $(KERNELS)
|
|
|
|
.for x in ${KERNELS}
|
|
|
|
gzip -c -9 < ${x} > \
|
|
|
|
${RELEASEDIR}/binary/kernel/${x}.gz
|
|
|
|
.endfor # KERNELS
|
|
|
|
.endif # RELEASEDIR
|
|
|
|
|
|
|
|
# Standard rules needed by the above...
|
|
|
|
.include <bsd.obj.mk>
|
2001-12-17 23:27:39 +03:00
|
|
|
.include <bsd.sys.mk>
|
2001-05-18 04:16:36 +04:00
|
|
|
.include <bsd.subdir.mk>
|