2002-04-18 19:36:57 +04:00
|
|
|
# $NetBSD: Makefile,v 1.27 2002/04/18 15:36:58 bouyer Exp $
|
|
|
|
|
|
|
|
|
|
|
|
.include <bsd.own.mk>
|
|
|
|
.include "${_SRC_TOP_}/distrib/Makefile.inc"
|
1995-10-09 02:07:44 +03:00
|
|
|
|
|
|
|
TOP= ${.CURDIR}/..
|
|
|
|
|
|
|
|
.include "${TOP}/Makefile.inc"
|
|
|
|
|
2002-04-06 22:16:09 +04:00
|
|
|
DBG= -Os
|
|
|
|
|
1995-10-09 02:07:44 +03:00
|
|
|
IMAGE= ramdisk
|
|
|
|
CBIN= rd_bin
|
|
|
|
|
|
|
|
TREE= ${TOP}/common/${IMAGE}.tree
|
|
|
|
|
|
|
|
LISTS= ${TOP}/common/${CBIN}.list \
|
|
|
|
${TOP}/common/${IMAGE}.list
|
|
|
|
|
1999-05-16 12:21:52 +04:00
|
|
|
KERNEL3 = ${KERNOBJDIR}/RAMDISK/netbsd
|
|
|
|
KERNEL3X = ${KERNOBJDIR}/RAMDISK3X/netbsd
|
1995-11-22 00:18:48 +03:00
|
|
|
|
1999-05-16 12:21:52 +04:00
|
|
|
MOUNT_POINT?= /mnt
|
2000-06-09 19:03:34 +04:00
|
|
|
VND?= vnd1
|
|
|
|
VND_DEV?= /dev/${VND}a
|
|
|
|
VND_RDEV?= /dev/r${VND}a
|
1995-10-09 02:07:44 +03:00
|
|
|
|
2000-06-09 19:03:34 +04:00
|
|
|
# These are all the parameters for the root fs:
|
1995-11-22 00:18:48 +03:00
|
|
|
DISKTYPE= rdroot
|
2001-10-04 12:17:41 +04:00
|
|
|
SIZE= 400k
|
2000-06-09 19:03:34 +04:00
|
|
|
# bigendian, minfree, opt, b/i , cpg
|
|
|
|
NEWFSARGS= -B be -m 0 -o space -i 4096 -c 20
|
2001-10-22 03:23:19 +04:00
|
|
|
MDSETIMAGE?= mdsetimage
|
2001-10-13 10:15:15 +04:00
|
|
|
MTREE?= mtree
|
1995-10-09 02:07:44 +03:00
|
|
|
|
2000-06-20 03:46:08 +04:00
|
|
|
KERNELS= netbsd.RAMDISK netbsd.RAMDISK3X
|
2000-06-09 19:03:34 +04:00
|
|
|
CLEANFILES= $(KERNELS) ${IMAGE}.fs netbsd-tmp
|
1995-10-09 02:07:44 +03:00
|
|
|
|
1999-05-21 08:06:20 +04:00
|
|
|
all: $(KERNELS)
|
1998-02-12 22:56:25 +03:00
|
|
|
|
2000-06-20 03:46:08 +04:00
|
|
|
netbsd.RAMDISK : ${IMAGE}.fs
|
1998-02-12 22:56:25 +03:00
|
|
|
cp ${KERNEL3} netbsd-tmp
|
2001-10-22 03:23:19 +04:00
|
|
|
${MDSETIMAGE} -v netbsd-tmp ${IMAGE}.fs
|
1998-02-12 22:56:25 +03:00
|
|
|
-mv -f netbsd-tmp $@
|
|
|
|
|
2000-06-20 03:46:08 +04:00
|
|
|
netbsd.RAMDISK3X : ${IMAGE}.fs
|
1998-02-12 22:56:25 +03:00
|
|
|
cp ${KERNEL3X} netbsd-tmp
|
2001-10-22 03:23:19 +04:00
|
|
|
${MDSETIMAGE} -v netbsd-tmp ${IMAGE}.fs
|
1995-10-09 02:07:44 +03:00
|
|
|
-mv -f netbsd-tmp $@
|
|
|
|
|
1995-11-22 00:18:48 +03:00
|
|
|
${IMAGE}.fs: ${TREE} ${LISTS} ${CBIN}
|
2000-06-09 19:03:34 +04:00
|
|
|
dd if=/dev/zero of=${IMAGE}.fs bs=${SIZE} count=1
|
|
|
|
vnconfig -t ${DISKTYPE} -v -c ${VND} ${IMAGE}.fs
|
|
|
|
disklabel -rw ${VND} ${DISKTYPE}
|
|
|
|
newfs ${NEWFSARGS} ${VND_RDEV}
|
|
|
|
mount ${VND_DEV} ${MOUNT_POINT}
|
2001-10-13 10:15:15 +04:00
|
|
|
${MTREE} -def ${TREE} -p ${MOUNT_POINT}/ -u
|
2000-06-10 07:01:14 +04:00
|
|
|
TOPDIR=${TOP} CURDIR=${.CURDIR} DESTDIR=${DESTDIR} \
|
1995-11-22 00:18:48 +03:00
|
|
|
OBJDIR=${.OBJDIR} TARGDIR=${MOUNT_POINT} \
|
|
|
|
sh ${TOP}/common/RunList.sh ${LISTS}
|
|
|
|
sync
|
|
|
|
@echo ""
|
|
|
|
@df -i ${MOUNT_POINT}
|
|
|
|
@echo ""
|
2000-06-09 19:03:34 +04:00
|
|
|
umount ${MOUNT_POINT}
|
|
|
|
vnconfig -u ${VND}
|
1995-10-09 02:07:44 +03:00
|
|
|
|
2001-02-13 06:11:26 +03:00
|
|
|
unconfig:
|
|
|
|
-umount -f ${MOUNT_POINT}
|
2001-11-10 00:00:04 +03:00
|
|
|
-vnconfig -u ${VND}
|
2001-02-13 06:11:26 +03:00
|
|
|
-/bin/rm -f ${IMAGE}.fs
|
|
|
|
|
1995-10-13 19:51:28 +03:00
|
|
|
# Do not delete this if I change my mind and kill make...
|
|
|
|
.PRECIOUS: ${IMAGE}.fs
|
|
|
|
|
1995-10-09 02:07:44 +03:00
|
|
|
# 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
|
|
|
|
.include "${HACKSRC}/Makefile.inc"
|
|
|
|
${CBIN}: libhack.o
|
1995-10-09 02:07:44 +03:00
|
|
|
|
1998-09-05 18:46:13 +04:00
|
|
|
clean cleandir distclean:
|
2000-06-10 07:01:14 +04:00
|
|
|
-rm -f a.out core *.core *.o *.cro *.c
|
1995-10-13 19:51:28 +03:00
|
|
|
-rm -f ${CLEANFILES}
|
1995-10-09 02:07:44 +03:00
|
|
|
|
1999-05-21 08:06:20 +04:00
|
|
|
.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
|
2000-06-10 07:01:14 +04:00
|
|
|
|
2002-02-23 20:27:42 +03:00
|
|
|
.INTERRUPT: unconfig
|
|
|
|
|
2000-06-10 07:01:14 +04:00
|
|
|
# Standard rules needed by the above...
|
2002-02-23 20:27:42 +03:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
.include <bsd.prog.mk>
|
2000-06-10 07:01:14 +04:00
|
|
|
.include <bsd.obj.mk>
|
|
|
|
.include <bsd.subdir.mk>
|