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
)
12 @echo both
'DESTDIR' and
'DESTDISK' must be defined.
16 KERNEL?
= ${KERNOBJDIR}/GENERIC
/netbsd
24 disklabel
-W
${DESTDISK}
25 -dd if
=/dev
/zero of
=/dev
/r
${DESTDISK}c bs
=`expr ${SECPERCYL} \* 512` \
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}
33 mount
/dev
/${DESTDISK}d
${DESTDIR}/usr
36 cd
${.CURDIR
}/..
/..
/..
/etc
&& ${MAKE} distribution
37 if
[ -d
${.CURDIR
}/..
/..
/..
/toolchain
]; then \
38 cd
${.CURDIR
}/..
/..
/..
/toolchain
&& \
39 ${MAKE} prefix=${DESTDIR}/usr
/local
install; \
43 if
[ -d
${.CURDIR
}/..
/..
/..
/xc
]; then \
44 cd
${.CURDIR
}/..
/..
/..
/xc
&& ${MAKE} install install.man
; \
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
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}
79 dd if
=/dev
/r
${DESTDISK}c bs
=`expr ${SECPERCYL} \* 512` \
80 count
=${CYLS} | gzip
-9n
> $@
82 bin.
tar.gz
: mount-fs build-fs
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
90 (cd
${DESTDIR} ; find .
/etc | pax
-w
-d | gzip
-9n
) > $@
92 x11.
tar.gz
: mount-fs build-fs
94 (cd
${DESTDIR} ; find .
/usr
/X11R6 | pax
-w
-d | gzip
-9n
) > $@
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
>