Makefile revision 4879
1# $Id: Makefile,v 1.59 1994/11/24 22:30:02 phk Exp $ 2# 3 4FLOPPY= fd0 5 6 7# Evil floppies are, of course, 1.2MB floppies. 8.if defined(EVIL_FLOPPY) 9FDLABEL= fd1200 10DDBS= 15k 11DDCOUNT= 80 12.else 13FDLABEL= fd1440 14DDBS= 18k 15DDCOUNT= 80 16.endif 17 18MNT= /mnt 19 20CPIO1= basename cat chmod cksum cp cu date dd df dmesg echo ed expr hostname 21CPIO1+= kill ln ls mkdir mt mv rcp rm rmdir sh sleep stty sync tar test tip [ 22CPIO1+= -sh badsect chown clri disklabel dump dmesg fdisk fsck getopt ifconfig 23CPIO1+= init mknod mount mount_cd9660 mount_msdos mount_nfs ncftp newfs ping pwd 24CPIO1+= reboot restore slattach swapon umount route 25CPIO1+= rdump rrestore halt ft 26CPIO1+= ftp rsh sed telnet rlogin grep 27 28CPIO2= etc/services etc/protocols 29 30# bininst MUST be the last file on the cpio floppy. It's used to detect 31# a successful extraction. 32CPIO3= miscfuncs.sh instdist.sh netinst.sh adduser.sh bininst 33 34CPIO4= /usr/sbin/tzsetup 35CPIO4B= tzsetup 36 37# Somewhat on the rough side... 38CLEANFILES+= *.o *.c *.cache *.mk *.lo ${CPIO1} *.flp *.gz 39CLEANFILES+= boot_flp boot.flp cpio_flp_1 40 41MTREE_DIR= ${.CURDIR}/../etc/mtree 42 43ZIPNSPLIT= gzip --no-name -9 -c | split -b 240640 - 44 45hierarchy: 46 mtree -deU -f ${MTREE_DIR}/BSD.root.dist -p ${DESTDIR}/ 47 mtree -deU -f ${MTREE_DIR}/BSD.var.dist -p ${DESTDIR}/var 48 mtree -deU -f ${MTREE_DIR}/BSD.usr.dist -p ${DESTDIR}/usr 49.if defined(MAKE_LOCAL) 50 mtree -deU -f ${MTREE_DIR}/BSD.local.dist -p ${DESTDIR}/usr/local 51.endif 52 rm -f ${DESTDIR}/sys 53 ln -s usr/src/sys ${DESTDIR}/sys 54 55kernel: ${.CURDIR}/../sys/i386/conf/GENERIC 56 (cd ${.CURDIR}/../sys/i386/conf; config GENERIC) 57 (cd ${.CURDIR}/../sys/compile/GENERIC; ${MAKE} depend; ${MAKE} all; ) 58 59boot_12.flp: 60 (cd ${.CURDIR}; EVIL_FLOPPY=yes ${MAKE} boot.flp) 61 mv boot.flp boot_12.flp 62 63boot_144.flp: 64 (cd ${.CURDIR}; ${MAKE} boot.flp) 65 mv boot.flp boot_144.flp 66 67boot.flp: 68 crunchgen ${.CURDIR}/boot_flp.conf 69 ${MAKE} -f boot_flp.mk objs exe 70 -umount ${MNT} 71 -umount /dev/${FLOPPY} 72 # echo y | fdformat ${FLOPPY} 73 disklabel -w -B \ 74 -b ${DESTDIR}/usr/mdec/fdboot -s ${DESTDIR}/usr/mdec/bootfd \ 75 /dev/r${FLOPPY} ${FDLABEL} 76 newfs -c 80 -b 4096 -f 512 -i 8192 -m 0 -o space /dev/r${FLOPPY} 77 mount -o async /dev/${FLOPPY} ${MNT} 78 mkdir ${MNT}/dev ${MNT}/stand ${MNT}/mnt 79 strip -x ${.CURDIR}/../sys/compile/GENERIC/kernel 80 cp ${.CURDIR}/../sys/compile/GENERIC/kernel ${MNT}/kernel 81 cp ${DESTDIR}/usr/mdec/sdboot ${DESTDIR}/usr/mdec/bootsd ${MNT}/stand 82 ( cd ${DESTDIR}/dev ; \ 83 ls console tty ttyv1 null zero \ 84 sd[0123][a-h] wd[0123][a-h] fd[01] \ 85 rsd[0123][a-h] rwd[0123][a-h] rfd[01] \ 86 | cpio -dumpv ${MNT}/dev \ 87 ) 88 gzip -9 < boot_flp > ${MNT}/stand/sysinstall 89 chmod 755 ${MNT}/stand/sysinstall 90 ln ${MNT}/stand/sysinstall ${MNT}/stand/newfs 91 ln ${MNT}/stand/sysinstall ${MNT}/stand/gzip 92 ln ${MNT}/stand/sysinstall ${MNT}/stand/fsck 93.if !defined(EVIL_FLOPPY) 94 install -m 400 -c ${.CURDIR}/../COPYRIGHT ${MNT}/COPYRIGHT 95 install -m 400 -c ${.CURDIR}/../share/FAQ/DISKSPACE.FAQ \ 96 ${MNT}/DISKSPACE.FAQ 97 install -m 400 -c ${.CURDIR}/../share/FAQ/RELNOTES.FreeBSD \ 98 ${MNT}/RELNOTES.FreeBSD 99.endif 100 install -m 400 -c ${.CURDIR}/../share/FAQ/TROUBLESHOOTING \ 101 ${MNT}/TROUBLESHOOTING 102 install -m 400 -c ${.CURDIR}/../share/FAQ/README-2.0 ${MNT}/README 103 touch ${MNT}/this_is_boot_flp 104 -umount ${MNT} 105 fsck /dev/r${FLOPPY} 106 dd if=/dev/r${FLOPPY} bs=${DDBS} count=${DDCOUNT} of=boot.flp 107 gzip -9 -v < boot.flp > boot.flp.gz 108 df -k /dev/r${FLOPPY} 109 110cpio.flp: 111 crunchgen ${.CURDIR}/cpio_flp_1.conf 112 ${MAKE} -f cpio_flp_1.mk objs exe 113 for i in ${CPIO1} ; do rm -f ./$$i ; ln cpio_flp_1 ./$$i ; done 114 ( cd /${DESTDIR} ; ls ${CPIO2} | cpio -H newc -oa ) | cpio -ivd 115 ( cd ${.CURDIR} ; ls ${CPIO3} | cpio -H newc -oa ) | cpio -ivd 116 cp ${CPIO4} . 117 ls ${CPIO1} ${CPIO2} ${CPIO3} ${CPIO4B} | \ 118 cpio -H newc -oa | gzip -9 | \ 119 dd conv=osync > cpio.flp 120 gzip -9 -v < cpio.flp > cpio.flp.gz 121 ls -l cpio.flp* 122 123crunch: 124 crunchgen ${.CURDIR}/boot_flp.conf 125 ${MAKE} -f boot_flp.mk objs exe 126 crunchgen ${.CURDIR}/cpio_flp_1.conf 127 ${MAKE} -f cpio_flp_1.mk objs exe 128 129floppies: crunch boot_144.flp boot_12.flp cpio.flp 130 131release20: 132 ( cd ${.CURDIR} ; ${MAKE} clean) 133 -mkdir ${RELEASEDIR} 134 chflags -R noschg ${RELEASEDIR}/. 135 rm -rf ${RELEASEDIR}/* 136 ( cd ${.CURDIR}/.. ; \ 137 ${MAKE} world NOCRYPT=yes) 138 ( cd ${.CURDIR}/../etc ; \ 139 ${MAKE} release-dirs ) 140 ( cd ${.CURDIR} ; ${MAKE} obj) 141 ( cd ${.CURDIR} ; \ 142 ${MAKE} kernel DESTDIR=${RELEASEDIR}/filesys ) 143 install ${COPY} -m 644 ${.CURDIR}/../sys/compile/GENERIC/kernel \ 144 ${RELEASEDIR}/filesys/kernel 145 ( cd ${.CURDIR} ; \ 146 ${MAKE} hierarchy DESTDIR=${RELEASEDIR}/filesys ) 147 ( cd ${.CURDIR}/../etc ; \ 148 ${MAKE} distribution DESTDIR=${RELEASEDIR}/filesys \ 149 NOCRYPT=yes SHARED=copies) 150 ( cd ${RELEASEDIR}/filesys; \ 151 tar cf - . | \ 152 ${ZIPNSPLIT} ${RELEASEDIR}/tarballs/bindist/bindist.) 153 cp ${.CURDIR}/extract.sh ${RELEASEDIR}/tarballs/bindist 154 ( cd ${RELEASEDIR}/tarballs/bindist; ${.CURDIR}/mkchecksums.sh ) 155 ( cd ${.CURDIR} ; \ 156 ${MAKE} floppies ) 157foo: 158 ( cd ${.CURDIR}/../etc ; \ 159 ${MAKE} srcebones-tarball \ 160 DESTDIR=${RELEASEDIR}/filesys \ 161 NOCRYPT=yes SHARED=copies ) 162 163bar: 164 ( cd ${.CURDIR}/../etc ; \ 165 ${MAKE} des-tarball \ 166 DESTDIR=${RELEASEDIR}/filesys \ 167 SHARED=copies ) 168 169EXTRADISTRIBUTIONS= secrdist games manpages proflibs dict krb srcdist 170DISTRIBUTIONS= bindist ${EXTRADISTRIBUTIONS} 171MTREEFILES= ${.CURDIR}/../etc/mtree 172SECRSRC= src/secure src/eBones 173 174distribute: 175 -mkdir ${RELEASEDIR} 176 chflags -R noschg ${RELEASEDIR}/. 177 rm -rf ${RELEASEDIR}/* 178 for i in ${DISTRIBUTIONS} ; \ 179 do \ 180 mkdir ${RELEASEDIR}/$$i ; \ 181 mtree -deU -f ${MTREEFILES}/BSD.root.dist -p ${RELEASEDIR}/$$i/ ; \ 182 mtree -deU -f ${MTREEFILES}/BSD.var.dist -p ${RELEASEDIR}/$$i/var ; \ 183 mtree -deU -f ${MTREEFILES}/BSD.usr.dist -p ${RELEASEDIR}/$$i/usr ; \ 184 done 185 ( cd ${.CURDIR} ; \ 186 ${MAKE} kernel DESTDIR=${RELEASEDIR}/filesys ) 187 install ${COPY} -m 644 ${.CURDIR}/../sys/compile/GENERIC/kernel \ 188 ${RELEASEDIR}/bindist/kernel 189 190beforetarballs: 191 rm -rf ${RELEASEDIR}/manpages/usr/share/man 192 mv ${RELEASEDIR}/bindist/usr/share/man \ 193 ${RELEASEDIR}/manpages/usr/share/man 194 rm -rf ${RELEASEDIR}/games/usr/games 195 mv ${RELEASEDIR}/bindist/usr/games \ 196 ${RELEASEDIR}/games/usr/games 197 rm -rf ${RELEASEDIR}/games/usr/share/games 198 mv ${RELEASEDIR}/bindist/usr/share/games \ 199 ${RELEASEDIR}/games/usr/share/games 200 rm -rf ${RELEASEDIR}/dict/usr/share/dict 201 mv ${RELEASEDIR}/bindist/usr/share/dict \ 202 ${RELEASEDIR}/dict/usr/share/dict 203 mv ${RELEASEDIR}/bindist/usr/lib/*_p.a \ 204 ${RELEASEDIR}/proflibs/usr/lib 205 -cd ${RELEASEDIR} ; \ 206 find ${EXTRADISTRIBUTIONS} -depth -type d -print | xargs rmdir 207 cd ${RELEASEDIR}/secrdist/usr ; cvs export -r ${RELEASETAG} ${SECRSRC} 208 cd ${RELEASEDIR}/srcdist/usr ; cvs export -r ${RELEASETAG} src 209 cd ${RELEASEDIR}/srcdist/usr/src ; rm -rf secure kerberosIV eBones 210 211tarballs: 212 rm -rf ${RELEASEDIR}/tarballs 213 mkdir ${RELEASEDIR}/tarballs 214 for i in ${DISTRIBUTIONS} ; \ 215 do \ 216 mkdir ${RELEASEDIR}/tarballs/$${i} ; \ 217 ( cd ${RELEASEDIR}/$${i}; \ 218 tar cf - . | \ 219 ${ZIPNSPLIT} ${RELEASEDIR}/tarballs/$$i/$${i}.) ; \ 220 ( cd ${RELEASEDIR}/tarballs/$${i}; sh -e ${.CURDIR}/mkchecksums.sh ) ; \ 221 cp ${.CURDIR}/extract.sh ${RELEASEDIR}/tarballs/$${i} ;\ 222 done 223 224.include <bsd.prog.mk> 225