Makefile revision 1.11
1#	$NetBSD: Makefile,v 1.11 1995/12/09 05:27:22 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
6TARGETS=	bin.tar.gz etc.tar.gz x11.tar.gz rz25-image.gz
7
8.if !defined(DESTDIR) || !defined(DESTDISK)
9all:
10	@echo both 'DESTDIR' and 'DESTDISK' must be defined.
11	@false
12.else
13
14SECPERCYL=	558
15CYLS=		1476
16
17all: ${TARGETS}
18
19mount-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
31build-fs:
32	cd ${.CURDIR}/../../../etc && make distribution
33	cd ${.CURDIR}/../../../cygnus && \
34	    make prefix=${DESTDIR}/usr/local install
35	cd ${.CURDIR}/../../../xc && make install install.man
36	cp ${.CURDIR}/../../../sys/arch/alpha/compile/GENERIC/netbsd ${DESTDIR}
37	ln -s gcc ${DESTDIR}/usr/local/bin/cc
38	ln -s \
39	../local/lib/gcc-lib/alpha-unknown-netbsd1.0A./2.7-95q4/cpp \
40	    ${DESTDIR}/usr/libexec
41	ln -s ../local/bin/ar ${DESTDIR}/usr/bin
42	ln -s ../local/bin/as ${DESTDIR}/usr/bin
43	ln -s ../local/bin/cc ${DESTDIR}/usr/bin
44	ln -s ../local/bin/gcc ${DESTDIR}/usr/bin
45	ln -s ../local/bin/ld ${DESTDIR}/usr/bin
46	ln -s ../local/bin/nm ${DESTDIR}/usr/bin
47	ln -s ../local/bin/ranlib ${DESTDIR}/usr/bin
48	ln -s ../local/bin/size ${DESTDIR}/usr/bin
49	ln -s ../local/bin/strip ${DESTDIR}/usr/bin
50	cp -p ${DESTDIR}/usr/mdec/boot ${DESTDIR}/
51	sync; sleep 1; sync; sleep 1
52	${DESTDIR}/usr/mdec/installboot -v ${DESTDIR}/boot \
53	    ${DESTDIR}/usr/mdec/bootxx /dev/r${DESTDISK}c
54
55unmount-fs:
56	umount ${DESTDIR}/usr ${DESTDIR}
57	fsck /dev/r${DESTDISK}a /dev/r${DESTDISK}d
58
59rz25-image.gz: mount-fs build-fs unmount-fs
60	/bin/rm -f $@
61	dd if=/dev/r${DESTDISK}c bs=`expr ${SECPERCYL} \* 512` \
62	    count=${CYLS} | gzip -9 > $@
63
64bin.tar.gz: mount-fs build-fs
65	/bin/rm -f $@
66	(cd ${DESTDIR} ; find . | grep -v '^./etc' | \
67	    grep -v '^./usr/X11R6' | grep -v '^./netbsd' | \
68	    grep -v '^./boot' | pax -w -d | gzip -9) > $@
69
70etc.tar.gz: mount-fs build-fs
71	/bin/rm -f $@
72	(cd ${DESTDIR} ; find ./etc | pax -w -d | gzip -9) > $@
73
74x11.tar.gz: mount-fs build-fs
75	/bin/rm -f $@
76	(cd ${DESTDIR} ; find ./usr/X11R6 | pax -w -d | gzip -9) > $@
77
78.endif
79
80_SUBDIRUSE:
81
82# clean dependencies in case somebody decides to shortcut the build.
83clean:
84	/bin/rm -f ${TARGETS}
85	/bin/rm -f mount-fs build-fs unmount-fs
86
87.include <bsd.own.mk>
88.include <bsd.obj.mk>
89