Makefile revision 1.13
1#	$NetBSD: Makefile,v 1.13 1996/04/25 13:20:05 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	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	ln -s \
47	../local/lib/gcc-lib/alpha-unknown-netbsd1.1B/2.7-95q4/cpp \
48	    ${DESTDIR}/usr/libexec
49	ln -s ../local/bin/ar ${DESTDIR}/usr/bin
50	ln -s ../local/bin/as ${DESTDIR}/usr/bin
51	ln -s ../local/bin/cc ${DESTDIR}/usr/bin
52	ln -s ../local/bin/gcc ${DESTDIR}/usr/bin
53	ln -s ../local/bin/ld ${DESTDIR}/usr/bin
54	ln -s ../local/bin/nm ${DESTDIR}/usr/bin
55	ln -s ../local/bin/ranlib ${DESTDIR}/usr/bin
56	ln -s ../local/bin/size ${DESTDIR}/usr/bin
57	ln -s ../local/bin/strip ${DESTDIR}/usr/bin
58	cp -p ${DESTDIR}/usr/mdec/boot ${DESTDIR}/
59	sync; sleep 1; sync; sleep 1
60	${DESTDIR}/usr/mdec/installboot -v ${DESTDIR}/boot \
61	    ${DESTDIR}/usr/mdec/bootxx /dev/r${DESTDISK}c
62
63unmount-fs:
64	umount ${DESTDIR}/usr ${DESTDIR}
65	fsck /dev/r${DESTDISK}a /dev/r${DESTDISK}d
66
67rz25-image.gz: mount-fs build-fs unmount-fs
68	/bin/rm -f $@
69	dd if=/dev/r${DESTDISK}c bs=`expr ${SECPERCYL} \* 512` \
70	    count=${CYLS} | gzip -9 > $@
71
72bin.tar.gz: mount-fs build-fs
73	/bin/rm -f $@
74	(cd ${DESTDIR} ; find . | grep -v '^./etc' | \
75	    grep -v '^./usr/X11R6' | grep -v '^./netbsd' | \
76	    grep -v '^./boot' | pax -w -d | gzip -9) > $@
77
78etc.tar.gz: mount-fs build-fs
79	/bin/rm -f $@
80	(cd ${DESTDIR} ; find ./etc | pax -w -d | gzip -9) > $@
81
82x11.tar.gz: mount-fs build-fs
83	/bin/rm -f $@
84	(cd ${DESTDIR} ; find ./usr/X11R6 | pax -w -d | gzip -9) > $@
85
86.endif
87
88_SUBDIRUSE:
89
90# clean dependencies in case somebody decides to shortcut the build.
91clean:
92	/bin/rm -f ${TARGETS}
93	/bin/rm -f mount-fs build-fs unmount-fs
94
95.include <bsd.own.mk>
96.include <bsd.obj.mk>
97