NetBSD/distrib/sun3/ramdisk/Makefile
lukem ed8e534c7e yet another distrib overhaul:
- move guts of distrib/Makefile.inc to distrib/common/Makefile.distrib
  (fixes problem caused by implicit include of ../Makefile.inc in certain
  submake conditions triggered by makefiles not yet in tree)
- removed mkdir of ${RELEASEDIR}/*;  rely upon "snap_pre" target of
  etc/Makefile to create all the release directories
- renamed RELINSTALL to RELEASE_INSTALL
- renamed FLOPPYINSTDIR to FLOPPY_RELEASEDIR
- renamed MDSETDIR to MDSET_RELEASEDIR
- removed ITARGET
- move release target from top level to appropriate subdirectory
- ensure release target has correct depends
- replace miniroot's IMAGE_MD_POST with common/Makefile.image IMAGEPOSTBUILD
- Makefile.image: add realall: ${IMAGE}
2002-05-02 18:02:14 +00:00

93 lines
2.1 KiB
Makefile

# $NetBSD: Makefile,v 1.29 2002/05/02 18:02:59 lukem Exp $
.include <bsd.own.mk>
.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
TOP= ${.CURDIR}/..
.include "${TOP}/Makefile.inc"
DBG= -Os
IMAGE= ramdisk
CBIN= rd_bin
TREE= ${TOP}/common/${IMAGE}.tree
LISTS= ${TOP}/common/${CBIN}.list \
${TOP}/common/${IMAGE}.list
KERNEL3 = ${KERNOBJDIR}/RAMDISK/netbsd
KERNEL3X = ${KERNOBJDIR}/RAMDISK3X/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
MDSETIMAGE?= mdsetimage
MTREE?= mtree
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 $@
${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}
${MTREE} -def ${TREE} -p ${MOUNT_POINT}/ -u
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}
vnconfig -u ${VND}
unconfig:
-umount -f ${MOUNT_POINT}
-vnconfig -u ${VND}
-/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
HACKSRC= ${DISTRIBDIR}/utils/libhack
.include "${HACKSRC}/Makefile.inc"
${CBIN}: libhack.o
release: check_RELEASEDIR .WAIT $(KERNELS)
.for x in ${KERNELS}
gzip -c -9 < ${x} > \
${RELEASEDIR}/binary/kernel/${x}.gz
.endfor # KERNELS
.INTERRUPT: unconfig
.include <bsd.prog.mk>