2000-11-01 10:57:55 +03:00
|
|
|
# $NetBSD: Makefile,v 1.36 2000/11/01 07:57:59 garbled Exp $
|
1995-12-19 01:47:26 +03:00
|
|
|
|
2000-05-02 10:45:24 +04:00
|
|
|
.include "../../Makefile.inc"
|
1997-01-08 10:22:43 +03:00
|
|
|
.include <bsd.own.mk>
|
2000-05-02 10:45:24 +04:00
|
|
|
.include <bsd.kernobj.mk>
|
1997-01-08 10:22:43 +03:00
|
|
|
|
2000-05-18 06:12:43 +04:00
|
|
|
REV!=sh ${.CURDIR}/../../sys/conf/osrelease.sh -s
|
1995-12-19 01:47:26 +03:00
|
|
|
|
|
|
|
CBIN= instbin
|
|
|
|
ARCHDIR= ${.CURDIR}/../${MACHINE}/miniroot
|
|
|
|
|
1996-05-25 03:36:38 +04:00
|
|
|
.if exists(${ARCHDIR}/Makefile.inc)
|
|
|
|
.include "${ARCHDIR}/Makefile.inc"
|
|
|
|
.endif
|
|
|
|
|
1997-07-15 12:16:36 +04:00
|
|
|
VND?= vnd0c
|
1996-05-27 16:39:01 +04:00
|
|
|
VND_DEV= /dev/${VND}
|
|
|
|
VND_RDEV= /dev/r${VND}
|
1997-09-23 01:33:31 +04:00
|
|
|
VND_GEOM?=
|
2000-01-10 18:17:30 +03:00
|
|
|
IMAGE?= miniroot.fs
|
2000-03-07 11:41:35 +03:00
|
|
|
IMAGESIZE?= 14336 # 7MB in 512 byte blocks
|
1996-05-27 16:39:01 +04:00
|
|
|
NEWFSOPTS?=
|
2000-08-29 15:41:24 +04:00
|
|
|
MOUNT_POINT?= /mnt
|
1997-09-10 03:02:04 +04:00
|
|
|
BOOTINSTALL?= true
|
1998-11-17 02:43:58 +03:00
|
|
|
PRELABEL?= true
|
1995-12-19 01:47:26 +03:00
|
|
|
|
1997-07-15 12:16:36 +04:00
|
|
|
.ifdef DISKTYPE
|
|
|
|
DISKTYPEARG= -t ${DISKTYPE}
|
|
|
|
.endif
|
1997-06-24 01:29:50 +04:00
|
|
|
|
1996-05-27 16:39:01 +04:00
|
|
|
LISTS= ${.CURDIR}/list ${ARCHDIR}/list
|
1995-12-19 01:47:26 +03:00
|
|
|
CRUNCHCONF= ${CBIN}.conf
|
|
|
|
MTREE= ${.CURDIR}/mtree.conf
|
1999-10-19 00:13:55 +04:00
|
|
|
ICMD= ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} \
|
|
|
|
-o root -g wheel -m ${NONBINMODE}
|
1995-12-19 01:47:26 +03:00
|
|
|
|
2000-11-01 10:57:55 +03:00
|
|
|
CRUNCHGEN?= crunchgen
|
|
|
|
|
1996-07-04 10:53:12 +04:00
|
|
|
.ifndef DESTDIR
|
|
|
|
all:
|
1999-07-18 11:22:36 +04:00
|
|
|
@echo setenv DESTDIR before making a miniroot!
|
1996-07-04 10:53:12 +04:00
|
|
|
@false
|
|
|
|
.else
|
|
|
|
|
1995-12-19 01:47:26 +03:00
|
|
|
all: ${CBIN}
|
1996-05-27 16:39:01 +04:00
|
|
|
dd if=/dev/zero of=${IMAGE} count=${IMAGESIZE}
|
1997-09-23 01:33:31 +04:00
|
|
|
vnconfig ${DISKTYPEARG} -v -c ${VND_DEV} ${IMAGE} ${VND_GEOM}
|
1998-11-17 02:43:58 +03:00
|
|
|
${PRELABEL}
|
1997-09-10 03:02:04 +04:00
|
|
|
-newfs -m 0 -o space ${NEWFSOPTS} ${VND_RDEV} ${DISKTYPE}
|
|
|
|
${BOOTINSTALL}
|
1999-04-19 01:01:57 +04:00
|
|
|
mount -o async ${VND_DEV} ${MOUNT_POINT}
|
1995-12-19 01:47:26 +03:00
|
|
|
mtree -def ${MTREE} -p ${MOUNT_POINT}/ -u
|
1996-05-30 10:57:12 +04:00
|
|
|
REV=${REV} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} ARCHDIR=${ARCHDIR} \
|
1997-09-10 03:02:04 +04:00
|
|
|
TARGDIR=${MOUNT_POINT} VND_RDEV=${VND_RDEV} \
|
2000-05-02 10:45:24 +04:00
|
|
|
KERNOBJDIR=${KERNOBJDIR} \
|
1997-09-10 03:02:04 +04:00
|
|
|
sh ${.CURDIR}/runlist.sh ${LISTS}
|
1995-12-19 01:47:26 +03:00
|
|
|
@echo ""
|
|
|
|
@df -i ${MOUNT_POINT}
|
|
|
|
@echo ""
|
|
|
|
umount ${MOUNT_POINT}
|
|
|
|
vnconfig -u ${VND_DEV}
|
|
|
|
|
|
|
|
unconfig:
|
|
|
|
-umount -f ${MOUNT_POINT}
|
|
|
|
-vnconfig -u ${VND_DEV}
|
|
|
|
-/bin/rm -f ${IMAGE}
|
|
|
|
|
|
|
|
${CBIN}.conf: ${LISTS}
|
|
|
|
awk -f ${.CURDIR}/makeconf.awk CBIN=${CBIN} ${LISTS} > ${CBIN}.conf
|
|
|
|
|
|
|
|
${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF}
|
2000-11-01 10:57:55 +03:00
|
|
|
${CRUNCHGEN} -D ${.CURDIR}/../.. -L ${DESTDIR}/usr/lib ${CRUNCHCONF}
|
1995-12-19 01:47:26 +03:00
|
|
|
|
|
|
|
${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
|
2000-08-31 03:51:46 +04:00
|
|
|
${MAKE} -f ${CBIN}.mk all
|
1995-12-19 01:47:26 +03:00
|
|
|
|
1999-10-19 00:13:55 +04:00
|
|
|
.ifndef RELEASEDIR
|
|
|
|
release:
|
|
|
|
@echo setenv RELEASEDIR first
|
|
|
|
@false
|
|
|
|
.else
|
2000-04-17 01:27:00 +04:00
|
|
|
release: ${IMAGE}
|
|
|
|
mkdir -p ${RELEASEDIR}/installation/miniroot
|
|
|
|
gzip -c -9 < ${.OBJDIR}/miniroot.fs \
|
|
|
|
> ${RELEASEDIR}/installation/miniroot/miniroot.fs.gz
|
|
|
|
${.CURDIR}/../sets/makesums \
|
2000-05-05 15:15:45 +04:00
|
|
|
-t ${RELEASEDIR}/installation/miniroot miniroot.fs.gz
|
2000-05-02 10:45:24 +04:00
|
|
|
|
1999-10-19 00:13:55 +04:00
|
|
|
.endif # RELEASEDIR check
|
|
|
|
.endif # DESTDIR check
|
|
|
|
|
1998-09-05 18:46:13 +04:00
|
|
|
clean cleandir distclean:
|
1996-01-07 01:40:58 +03:00
|
|
|
/bin/rm -f core ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache \
|
1999-05-12 00:46:58 +04:00
|
|
|
${CBIN}.conf *.o *.cro *.c
|
1995-12-19 01:47:26 +03:00
|
|
|
|
|
|
|
.include <bsd.obj.mk>
|
|
|
|
.include <bsd.subdir.mk>
|