NetBSD/distrib/sparc64/xminiroot/Makefile

123 lines
3.5 KiB
Makefile
Raw Normal View History

# $NetBSD: Makefile,v 1.15 2002/03/28 14:47:10 rafal Exp $
2000-08-10 18:38:51 +04:00
TOP= ${.CURDIR}/..
MINIROOT= ${TOP}/../miniroot
.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
SRCROOT= ${TOP}/../..
WARNS=1
INSTKERN?= ${KERNOBJDIR}/INSTALL/netbsd
GENERICKERN?= ${KERNOBJDIR}/GENERIC/netbsd
2000-08-10 18:38:51 +04:00
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
CSIZE?= 15360
2001-01-07 12:31:17 +03:00
IMAGE?= miniroot.fs
INSTALLSIZE?= 10240
INSTALLIMAGE?= install.fs
2000-08-10 18:38:51 +04:00
MDEC= ${DESTDIR}/usr/mdec
MOUNT_POINT?= ${.OBJDIR}/mountpoint
2000-08-10 18:38:51 +04:00
LISTS= list
CRUNCHCONF= ${CBIN}.conf
MTREECONF= mtree.conf
2000-08-10 18:38:51 +04:00
CRUNCHGEN?= crunchgen
MDSETIMAGE?= mdsetimage
MTREE?= mtree
2000-08-10 18:38:51 +04:00
DISKTYPE?= miniroot
MAKEFSOPTS?= -o optimization=space,minfree=1,bsize=16k,fsize=2k
all: netbsd.INSTALL ${INSTALLIMAGE} ${IMAGE}
netbsd.gz: ${GENERICKERN}
gzip -9 < ${GENERICKERN} > netbsd.gz
netbsd.INSTALL: ${INSTKERN} ${INSTALLIMAGE}
cp ${INSTKERN} netbsd.tmp
${MDSETIMAGE} -v netbsd.tmp ${INSTALLIMAGE}
${STRIP} netbsd.tmp
mv netbsd.tmp ${.TARGET}
${INSTALLIMAGE} ${IMAGE}: ${CBIN} ${AUXDEPENDS} ${MTREECONF} ${LISTS} dot.profile netbsd.gz
@echo "Building miniroot tree..."
-rm -rf ${MOUNT_POINT}
mkdir -m 755 ${MOUNT_POINT}
${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 "Creating install image..."
-rm -f ${INSTALLIMAGE}
${MAKEFS} -t ffs -B be -s ${INSTALLSIZE}b ${MAKEFSOPTS} \
-o nsectors=1,ntracks=${INSTALLSIZE} \
${INSTALLIMAGE}.tmp ${MOUNT_POINT} && mv ${INSTALLIMAGE}.tmp ${INSTALLIMAGE}
@echo "Copying in GENERIC kernel..."
cp netbsd.gz ${MOUNT_POINT}/netbsd
@echo "Creating miniroot image..."
-rm -f ${IMAGE}
${MAKEFS} -t ffs -B be -s ${CSIZE}b ${MAKEFSOPTS} \
-o nsectors=1,ntracks=${CSIZE} \
${IMAGE}.tmp ${MOUNT_POINT} && mv ${IMAGE}.tmp ${IMAGE}
# use sunlabel?
#-disklabel -f ${.CURDIR}/disktab -rw ${VND_CDEV} ${DISKTYPE}
2000-08-10 18:38:51 +04:00
@echo "installing new bootblocks"
dd if=${MDEC}/bootblk of=${IMAGE} bs=512 count=15 conv=notrunc seek=1
2000-08-10 18:38:51 +04:00
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}
${CRUNCHGEN} -D ${SRCROOT} -L ${DESTDIR}/usr/lib ${.ALLSRC}
2000-08-10 18:38:51 +04:00
${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
${MAKE} -f ${CBIN}.mk all
2000-08-10 18:38:51 +04:00
# Use stubs to eliminate some large stuff from libc
HACKSRC= ${SRCROOT}/distrib/utils/libhack
.include "${HACKSRC}/Makefile.inc"
${CBIN}: libhack.o
2000-08-10 18:38:51 +04:00
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>
2001-12-04 21:14:20 +03:00
.include <bsd.prog.mk>