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