2001-10-22 03:23:19 +04:00
|
|
|
# $NetBSD: Makefile,v 1.8 2001/10/21 23:23:23 jmc Exp $
|
2000-08-10 18:38:51 +04:00
|
|
|
|
|
|
|
TOP= ${.CURDIR}/..
|
|
|
|
MINIROOT= ${TOP}/../miniroot
|
2001-07-21 10:01:03 +04:00
|
|
|
|
|
|
|
.include "${TOP}/Makefile.inc"
|
|
|
|
|
|
|
|
.include <bsd.own.mk> # So we use /etc/mk.conf.
|
|
|
|
.include <bsd.kernobj.mk>
|
|
|
|
|
2000-08-10 18:38:51 +04:00
|
|
|
HACKSRC= ${TOP}/../utils/libhack
|
|
|
|
SRCROOT= ${TOP}/../..
|
|
|
|
WARNS=1
|
2001-07-21 10:01:03 +04:00
|
|
|
KERN?= ${KERNOBJDIR}/INSTALL/netbsd
|
2000-08-10 18:38:51 +04:00
|
|
|
|
|
|
|
.if ${MACHINE_ARCH} == "i386"
|
|
|
|
RAW_PART= d
|
|
|
|
.else
|
|
|
|
RAW_PART= c
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Need to add more cases
|
2000-08-19 17:17:38 +04:00
|
|
|
.if ${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "m68k" || \
|
|
|
|
${MACHINE_ARCH} == "sparc64"
|
2000-08-10 18:38:51 +04:00
|
|
|
FS_END= be
|
|
|
|
.else # i386, pmax
|
|
|
|
FS_END= le
|
|
|
|
.endif
|
|
|
|
|
|
|
|
AUXDEPENDS= dot.profile disktab.preinstall termcap.mini \
|
|
|
|
dist/base_obsolete dist/comp_obsolete \
|
|
|
|
dist/games_obsolete dist/man_obsolete dist/misc_obsolete \
|
|
|
|
dist/secr_obsolete dist/xbase_obsolete dist/xserver_obsolete
|
|
|
|
AUXCLEAN= list ${CBIN}.conf dot.profile
|
|
|
|
|
|
|
|
CBIN= ramdiskbin
|
|
|
|
|
2000-08-19 17:17:38 +04:00
|
|
|
|
2000-08-10 18:38:51 +04:00
|
|
|
MOUNT_POINT?= /mnt
|
|
|
|
# DEV/RDEV file system device, CDEV/RDEV vnconfig device
|
|
|
|
VND?= vnd0
|
|
|
|
VND_DEV= /dev/${VND}c
|
|
|
|
VND_RDEV= /dev/r${VND}c
|
|
|
|
VND_CDEV= /dev/${VND}${RAW_PART}
|
|
|
|
VND_CRDEV= /dev/r${VND}${RAW_PART}
|
2001-07-21 10:01:03 +04:00
|
|
|
CSIZE?= 14000
|
2001-01-07 12:31:17 +03:00
|
|
|
IMAGE?= miniroot.fs
|
2000-08-10 18:38:51 +04:00
|
|
|
MDEC= ${DESTDIR}/usr/mdec
|
|
|
|
|
|
|
|
LISTS= list
|
|
|
|
CRUNCHCONF= ${CBIN}.conf
|
2001-10-10 09:13:51 +04:00
|
|
|
MTREECONF= mtree.conf
|
2000-08-10 18:38:51 +04:00
|
|
|
|
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-08-10 18:38:51 +04:00
|
|
|
DISKTYPE?= miniroot
|
|
|
|
|
2001-07-21 10:01:03 +04:00
|
|
|
all: netbsd.INSTALL ${IMAGE}
|
|
|
|
|
|
|
|
netbsd.INSTALL: ${KERN} ${IMAGE}
|
|
|
|
cp ${KERN} netbsd.tmp
|
2001-10-22 03:23:19 +04:00
|
|
|
${MDSETIMAGE} -v netbsd.tmp ${IMAGE}
|
2001-07-21 10:01:03 +04:00
|
|
|
strip netbsd.tmp
|
|
|
|
mv netbsd.tmp ${.TARGET}
|
|
|
|
|
|
|
|
|
2001-10-10 09:13:51 +04:00
|
|
|
${IMAGE}: ${CBIN} ${AUXDEPENDS} ${MTREECONF} ${LISTS} dot.profile
|
2000-08-10 18:38:51 +04:00
|
|
|
dd if=/dev/zero of=${IMAGE} count=${CSIZE}
|
|
|
|
vnconfig -v -c ${VND_CDEV} ${IMAGE}
|
2001-07-21 10:01:03 +04:00
|
|
|
-disklabel -f ${.CURDIR}/disktab -rw ${VND_CDEV} ${DISKTYPE}
|
|
|
|
#newfs -B ${FS_END} -m 0 -o space -i 5120 -c 80 ${VND_RDEV} ${DISKTYPE}
|
|
|
|
newfs -B ${FS_END} -m 0 -o space ${VND_RDEV} ${DISKTYPE}
|
2001-01-07 12:30:12 +03:00
|
|
|
mount -o softdep ${VND_DEV} ${MOUNT_POINT}
|
2001-10-13 10:15:15 +04:00
|
|
|
${MTREE} -def ${.CURDIR}/${MTREECONF} -p ${MOUNT_POINT}/ -u
|
2000-08-10 18:38:51 +04:00
|
|
|
TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \
|
|
|
|
KERNOBJDIR=${KERNOBJDIR} \
|
|
|
|
TARGDIR=${MOUNT_POINT} sh ${TOP}/runlist.sh ${LISTS}
|
|
|
|
@echo ""
|
|
|
|
@df -i ${MOUNT_POINT}
|
|
|
|
@echo ""
|
|
|
|
@echo "installing new bootblocks"
|
2001-07-21 10:01:03 +04:00
|
|
|
#${MDEC}/binstall -m ${DESTDIR}/usr/mdec -u -v ffs ${MOUNT_POINT}
|
2000-08-10 18:38:51 +04:00
|
|
|
umount ${MOUNT_POINT}
|
2001-07-21 10:01:03 +04:00
|
|
|
dd if=${MDEC}/bootblk of=${VND_CDEV} bs=512 count=15 conv=notrunc seek=1
|
|
|
|
#${MDEC}/installboot -v ${MDEC}/bootblk ${VND_CDEV}
|
2000-08-10 18:38:51 +04:00
|
|
|
vnconfig -u ${VND_CDEV}
|
|
|
|
|
|
|
|
unconfig:
|
|
|
|
-umount -f ${MOUNT_POINT}
|
|
|
|
-vnconfig -u ${VND_DEV}
|
|
|
|
-/bin/rm -f ${IMAGE}
|
|
|
|
|
|
|
|
dot.profile: dot.profile.m4
|
|
|
|
m4 -DMACHINE_ARCH=${MACHINE_ARCH} -DMACHINE=${MACHINE} \
|
|
|
|
${.ALLSRC} > ${.TARGET}
|
|
|
|
|
|
|
|
${LISTS}: ${LISTS}.m4
|
|
|
|
m4 -DMACHINE_ARCH=${MACHINE_ARCH} -DMACHINE=${MACHINE} \
|
|
|
|
-DSRCROOT=${SRCROOT} ${.ALLSRC} > ${.TARGET}
|
|
|
|
|
|
|
|
${CBIN}.conf: ${CBIN}.m4
|
|
|
|
m4 -DMACHINE_ARCH=${MACHINE_ARCH} -DMACHINE=${MACHINE} \
|
|
|
|
${.ALLSRC} > ${.TARGET}
|
|
|
|
|
|
|
|
${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF}
|
2000-11-01 10:57:55 +03:00
|
|
|
${CRUNCHGEN} -D ${SRCROOT} -L ${DESTDIR}/usr/lib ${.ALLSRC}
|
2000-08-10 18:38:51 +04:00
|
|
|
|
|
|
|
${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
|
2000-10-26 08:53:56 +04:00
|
|
|
${MAKE} -f ${CBIN}.mk all
|
2000-08-10 18:38:51 +04:00
|
|
|
|
|
|
|
# This is listed in ramdiskbin.conf but is built here.
|
|
|
|
${CBIN}: libhack.o
|
|
|
|
|
|
|
|
# Use stubs to eliminate some large stuff from libc
|
|
|
|
.include "${HACKSRC}/Makefile.inc"
|
|
|
|
|
|
|
|
# turn off small gethostby* temporarily
|
|
|
|
HACKOBJS:= getcap.o getgrent.o getnet.o getnetgr.o getpwent.o setlocale.o yplib.o
|
|
|
|
|
|
|
|
clean cleandir distclean:
|
2001-08-23 21:14:40 +04:00
|
|
|
/bin/rm -f *.core ${AUXCLEAN} ${IMAGE} netbsd.INSTALL ${CBIN} \
|
|
|
|
${CBIN}.mk ${CBIN}.cache *.o *.lo *.cro *.c
|
2000-08-10 18:38:51 +04:00
|
|
|
|
2000-08-20 18:46:03 +04:00
|
|
|
.ifndef RELEASEDIR
|
|
|
|
release:
|
|
|
|
@echo setenv RELEASEDIR first
|
|
|
|
@false
|
|
|
|
.else
|
2001-08-23 21:14:40 +04:00
|
|
|
release: $(IMAGE) netbsd.INSTALL
|
2001-01-07 12:31:17 +03:00
|
|
|
@mkdir -p $(RELEASEDIR)/installation/miniroot
|
|
|
|
gzip -c -9 < $(.OBJDIR)/miniroot.fs \
|
|
|
|
> $(RELEASEDIR)/installation/miniroot/miniroot.fs.gz
|
2001-08-23 21:14:40 +04:00
|
|
|
@mkdir -p $(RELEASEDIR)/binary/kernels
|
2000-08-20 18:46:03 +04:00
|
|
|
.endif # RELEASEDIR check
|
|
|
|
|
2000-08-10 18:38:51 +04:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
.include <bsd.obj.mk>
|
|
|
|
.include <bsd.subdir.mk>
|
|
|
|
.include <bsd.sys.mk>
|