NetBSD/distrib/sun3/ramdisk/Makefile

94 lines
2.2 KiB
Makefile
Raw Normal View History

# $NetBSD: Makefile,v 1.14 2000/06/19 23:46:08 tsutsui Exp $
TOP= ${.CURDIR}/..
# This include just sets REV=XX
.include "${TOP}/Makefile.inc"
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
VND?= vnd1
VND_DEV?= /dev/${VND}a
VND_RDEV?= /dev/r${VND}a
# These are all the parameters for the root fs:
1995-11-22 00:18:48 +03:00
DISKTYPE= rdroot
SIZE= 400k
# bigendian, minfree, opt, b/i , cpg
NEWFSARGS= -B be -m 0 -o space -i 4096 -c 20
KERNELS= netbsd.RAMDISK netbsd.RAMDISK3X
CLEANFILES= $(KERNELS) ${IMAGE}.fs netbsd-tmp
all: $(KERNELS)
netbsd.RAMDISK : ${IMAGE}.fs
cp ${KERNEL3} netbsd-tmp
mdsetimage -v netbsd-tmp ${IMAGE}.fs
-mv -f netbsd-tmp $@
netbsd.RAMDISK3X : ${IMAGE}.fs
cp ${KERNEL3X} netbsd-tmp
mdsetimage -v netbsd-tmp ${IMAGE}.fs
-mv -f netbsd-tmp $@
1995-11-22 00:18:48 +03:00
${IMAGE}.fs: ${TREE} ${LISTS} ${CBIN}
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}
1995-11-22 00:18:48 +03:00
mtree -def ${TREE} -p ${MOUNT_POINT}/ -u
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 ""
umount ${MOUNT_POINT}
vnconfig -u ${VND}
1995-10-13 19:51:28 +03:00
# Do not delete this if I change my mind and kill make...
.PRECIOUS: ${IMAGE}.fs
# Rules for making ${CBIN} ...
.include "${TOP}/common/Make.crunch"
1995-11-22 00:18:48 +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:
-rm -f a.out core *.core *.o *.cro *.c
1995-10-13 19:51:28 +03:00
-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>
.include <bsd.subdir.mk>