Expand PMF_FN_* macros.
[netbsd-mini2440.git] / distrib / alpha / rz25dist / Makefile
blob9160923fef707ef8f0cde2e9a1e4cd3b99760e19
1 # $NetBSD: Makefile,v 1.28 2003/07/10 10:34:02 lukem Exp $
3 .include "../../../Makefile.inc"
5 # Make a distribution for the alpha, on a spare disk.
6 # This creates a large, gzipped disk image in ${.OBJDIR}
8 LOCALTARGETS= bin.tar.gz etc.tar.gz x11.tar.gz diskimage.gz
10 .if !defined(DESTDIR) || !defined(DESTDISK)
11 all:
12 @echo both 'DESTDIR' and 'DESTDISK' must be defined.
13 @false
14 .else
16 KERNEL?= ${KERNOBJDIR}/GENERIC/netbsd
18 SECPERCYL= 343
19 CYLS= 1189
21 all: ${LOCALTARGETS}
23 mount-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
35 build-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; \
43 if [ -d ${.CURDIR}/../../../xc ]; then \
44 cd ${.CURDIR}/../../../xc && ${MAKE} install install.man; \
45 else \
46 true; \
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 ${TOOL_INSTALLBOOT} -v /dev/r${DESTDISK}c ${DESTDIR}/usr/mdec/bootxx_ffs
65 unmount-fs:
66 umount ${DESTDIR}/usr ${DESTDIR}
67 fsck -f -t ffs /dev/r${DESTDISK}a /dev/r${DESTDISK}d
69 diskimage.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 -9n > $@
82 bin.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 -9n) > $@
88 etc.tar.gz: mount-fs build-fs
89 /bin/rm -f $@
90 (cd ${DESTDIR} ; find ./etc | pax -w -d | gzip -9n) > $@
92 x11.tar.gz: mount-fs build-fs
93 /bin/rm -f $@
94 (cd ${DESTDIR} ; find ./usr/X11R6 | pax -w -d | gzip -9n) > $@
96 .endif
98 # clean dependencies in case somebody decides to shortcut the build.
99 clean cleandir distclean:
100 /bin/rm -f ${LOCALTARGETS}
101 /bin/rm -f mount-fs build-fs unmount-fs
103 .include <bsd.kernobj.mk>
104 .include <bsd.own.mk>
105 .include <bsd.obj.mk>