1# $NetBSD: Makefile,v 1.27 2002/05/07 14:47:45 lukem Exp $ 2 3.include "../../../Makefile.inc" 4 5# Make a distribution for the alpha, on a spare disk. 6# This creates a large, gzipped disk image in ${.OBJDIR} 7 8LOCALTARGETS= bin.tar.gz etc.tar.gz x11.tar.gz diskimage.gz 9 10.if !defined(DESTDIR) || !defined(DESTDISK) 11all: 12 @echo both 'DESTDIR' and 'DESTDISK' must be defined. 13 @false 14.else 15 16KERNEL?= ${KERNOBJDIR}/GENERIC/netbsd 17 18SECPERCYL= 343 19CYLS= 1189 20 21all: ${LOCALTARGETS} 22 23mount-fs: 24 disklabel -W ${DESTDISK} 25 -dd if=/dev/zero of=/dev/r${DESTDISK}c bs=`expr ${SECPERCYL} \* 512` \ 26 count=${CYLS} 27 disklabel -w -r ${DESTDISK} ImageDisk 28 disklabel -W ${DESTDISK} 29 newfs -B le -O /dev/r${DESTDISK}a 30 newfs -B le -O /dev/r${DESTDISK}d 31 mount /dev/${DESTDISK}a ${DESTDIR} 32 mkdir ${DESTDIR}/usr 33 mount /dev/${DESTDISK}d ${DESTDIR}/usr 34 35build-fs: 36 cd ${.CURDIR}/../../../etc && ${MAKE} distribution 37 if [ -d ${.CURDIR}/../../../toolchain ]; then \ 38 cd ${.CURDIR}/../../../toolchain && \ 39 ${MAKE} prefix=${DESTDIR}/usr/local install; \ 40 else \ 41 true; \ 42 fi 43 if [ -d ${.CURDIR}/../../../xc ]; then \ 44 cd ${.CURDIR}/../../../xc && ${MAKE} install install.man; \ 45 else \ 46 true; \ 47 fi 48 cp ${KERNEL} ${DESTDIR} 49 ln -s gcc ${DESTDIR}/usr/local/bin/cc 50 (cd ${DESTDIR}/usr/libexec && ln -s \ 51 ../local/lib/gcc-lib/alpha-unknown-netbsd*/*/cpp .) 52 ln -s ../local/bin/ar ${DESTDIR}/usr/bin 53 ln -s ../local/bin/as ${DESTDIR}/usr/bin 54 ln -s ../local/bin/cc ${DESTDIR}/usr/bin 55 ln -s ../local/bin/gcc ${DESTDIR}/usr/bin 56 ln -s ../local/bin/ld ${DESTDIR}/usr/bin 57 ln -s ../local/bin/nm ${DESTDIR}/usr/bin 58 ln -s ../local/bin/ranlib ${DESTDIR}/usr/bin 59 ln -s ../local/bin/size ${DESTDIR}/usr/bin 60 ln -s ../local/bin/strip ${DESTDIR}/usr/bin 61 cp -p ${DESTDIR}/usr/mdec/boot ${DESTDIR}/ 62 sync; sleep 1; sync; sleep 1 63 ${INSTALLBOOT} -v /dev/r${DESTDISK}c ${DESTDIR}/usr/mdec/bootxx_ffs 64 65unmount-fs: 66 umount ${DESTDIR}/usr ${DESTDIR} 67 fsck -f -t ffs /dev/r${DESTDISK}a /dev/r${DESTDISK}d 68 69diskimage.gz: mount-fs build-fs unmount-fs 70 mount /dev/${DESTDISK}a ${DESTDIR} 71 mount /dev/${DESTDISK}d ${DESTDIR}/usr 72# mkdir ${DESTDIR}/alphadist 73# cp -p ${DESTDIR}/usr/sbin/sysctl ${DESTDIR}/alphadist 74# mv ${DESTDIR}/etc/rc ${DESTDIR}/alphadist/rc.real 75# cp ${.CURDIR}/rc.hack ${DESTDIR}/alphadist/rc.hack 76# cp -p ${DESTDIR}/alphadist/rc.hack ${DESTDIR}/etc/rc 77 umount ${DESTDIR}/usr ${DESTDIR} 78 /bin/rm -f $@ 79 dd if=/dev/r${DESTDISK}c bs=`expr ${SECPERCYL} \* 512` \ 80 count=${CYLS} | gzip -9 > $@ 81 82bin.tar.gz: mount-fs build-fs 83 /bin/rm -f $@ 84 (cd ${DESTDIR} ; find . | grep -v '^./etc' | \ 85 grep -v '^./usr/X11R6' | grep -v '^./netbsd' | \ 86 grep -v '^./boot' | pax -w -d | gzip -9) > $@ 87 88etc.tar.gz: mount-fs build-fs 89 /bin/rm -f $@ 90 (cd ${DESTDIR} ; find ./etc | pax -w -d | gzip -9) > $@ 91 92x11.tar.gz: mount-fs build-fs 93 /bin/rm -f $@ 94 (cd ${DESTDIR} ; find ./usr/X11R6 | pax -w -d | gzip -9) > $@ 95 96.endif 97 98# clean dependencies in case somebody decides to shortcut the build. 99clean cleandir distclean: 100 /bin/rm -f ${LOCALTARGETS} 101 /bin/rm -f mount-fs build-fs unmount-fs 102 103.include <bsd.kernobj.mk> 104.include <bsd.own.mk> 105.include <bsd.obj.mk> 106