Makefile revision 1.14
1#	$NetBSD: Makefile,v 1.14 1996/05/31 00:54:39 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	(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
62unmount-fs:
63	umount ${DESTDIR}/usr ${DESTDIR}
64	fsck /dev/r${DESTDISK}a /dev/r${DESTDISK}d
65
66rz25-image.gz: mount-fs build-fs unmount-fs
67	/bin/rm -f $@
68	dd if=/dev/r${DESTDISK}c bs=`expr ${SECPERCYL} \* 512` \
69	    count=${CYLS} | gzip -9 > $@
70
71bin.tar.gz: mount-fs build-fs
72	/bin/rm -f $@
73	(cd ${DESTDIR} ; find . | grep -v '^./etc' | \
74	    grep -v '^./usr/X11R6' | grep -v '^./netbsd' | \
75	    grep -v '^./boot' | pax -w -d | gzip -9) > $@
76
77etc.tar.gz: mount-fs build-fs
78	/bin/rm -f $@
79	(cd ${DESTDIR} ; find ./etc | pax -w -d | gzip -9) > $@
80
81x11.tar.gz: mount-fs build-fs
82	/bin/rm -f $@
83	(cd ${DESTDIR} ; find ./usr/X11R6 | pax -w -d | gzip -9) > $@
84
85.endif
86
87_SUBDIRUSE:
88
89# clean dependencies in case somebody decides to shortcut the build.
90clean:
91	/bin/rm -f ${TARGETS}
92	/bin/rm -f mount-fs build-fs unmount-fs
93
94.include <bsd.own.mk>
95.include <bsd.obj.mk>
96