1# $NetBSD: Makefile,v 1.25 2008/06/23 02:16:53 matt Exp $ 2# 3 4.include <bsd.own.mk> 5.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" 6 7.include <bsd.kernobj.mk> 8 9 10# we use spark, so that we get filetypes. 11ARCHIVE=BtNetBSD.spk 12 13RAMDISKDIR!= cd ${.CURDIR}/../ramdisk && ${PRINTOBJDIR} 14 15BOOTLOADER= ${DESTDIR}/usr/mdec/boot32,ffa 16NBFS= ${DESTDIR}/usr/mdec/nbfs,ffa 17 18all: ${ARCHIVE} 19 20release: check_RELEASEDIR .WAIT ${ARCHIVE} 21 ${RELEASE_INSTALL} splug.bas ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc 22 ${RELEASE_INSTALL} ${DISTRIBDIR}/notes/acorn32/prep.RISCOS \ 23 ${RELEASEDIR}/${RELEASEMACHINEDIR}/ 24 ${RELEASE_INSTALL} ${ARCHIVE} \ 25 ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/ 26 27${ARCHIVE}: tmp/BtNetBSD 28 TOOL_MKTEMP=${TOOL_MKTEMP}; export TOOL_MKTEMP; \ 29 TOOL_SPARKCRC=${TOOL_SPARKCRC}; export TOOL_SPARKCRC; \ 30 TOOL_STAT=${TOOL_STAT}; export TOOL_STAT; \ 31 cd tmp/BtNetBSD && \ 32 ${HOST_SH} ${.CURDIR}/../mksparkive.sh * > ${.OBJDIR}/${ARCHIVE} 33 34UUDECODE_FILES=unixfs_res Sprite banner pling.Sprites pling.Sprites22 MemFix 35UUDECODE_FILES+=splug.bas 36 37UUDECODE_FILES_RENAME_unixfs_res=tmp/BtNetBSD/!BtNetBSD/native/unixfs_res,ffa 38UUDECODE_FILES_RENAME_Sprite=tmp/BtNetBSD/!BtNetBSD/src/Banner/Sprite,ff9 39UUDECODE_FILES_RENAME_banner=tmp/BtNetBSD/!BtNetBSD/Banner,ffa 40UUDECODE_FILES_RENAME_pling.Sprites=tmp/BtNetBSD/!BtNetBSD/!Sprites,ff9 41UUDECODE_FILES_RENAME_pling.Sprites22=tmp/BtNetBSD/!BtNetBSD/!Sprites22,ff9 42UUDECODE_FILES_RENAME_MemFix=tmp/BtNetBSD/!BtNetBSD/MemFix,ffa 43 44SETTYPE_FILES=!BtNetBSD/!Boot !BtNetBSD/!Edit !BtNetBSD/!Help !BtNetBSD/!Run 45SETTYPE_FILES+=!BtNetBSD/BtNetBSD !BtNetBSD/PreBoot !BtNetBSD/TestBoot 46SETTYPE_FILES+=!BtNetBSD/checkro403 47 48SETTYPE_FILE_!BtNetBSD/!Boot=feb 49SETTYPE_FILE_!BtNetBSD/!Edit=feb 50SETTYPE_FILE_!BtNetBSD/!Help=feb 51SETTYPE_FILE_!BtNetBSD/!Run=feb 52SETTYPE_FILE_!BtNetBSD/BtNetBSD=ffb 53SETTYPE_FILE_!BtNetBSD/PreBoot=feb 54SETTYPE_FILE_!BtNetBSD/TestBoot=ffb 55SETTYPE_FILE_!BtNetBSD/checkro403=ffb 56 57SETTYPE_FILES+=!BtNetBSD/native/MountUFS !BtNetBSD/native/KillUnixfs 58SETTYPE_FILES+=!BtNetBSD/native/OpenRoot !BtNetBSD/native/wd0a 59SETTYPE_FILES+=!BtNetBSD/native/wd0e !BtNetBSD/native/wd0f 60SETTYPE_FILES+=!BtNetBSD/native/wd0g !BtNetBSD/native/wd1a 61SETTYPE_FILES+=!BtNetBSD/native/wd1e 62 63SETTYPE_FILE_!BtNetBSD/native/KillUnixfs=feb 64SETTYPE_FILE_!BtNetBSD/native/MountUFS=ffb 65SETTYPE_FILE_!BtNetBSD/native/OpenRoot=feb 66SETTYPE_FILE_!BtNetBSD/native/wd0a=feb 67SETTYPE_FILE_!BtNetBSD/native/wd0e=feb 68SETTYPE_FILE_!BtNetBSD/native/wd0f=feb 69SETTYPE_FILE_!BtNetBSD/native/wd0g=feb 70SETTYPE_FILE_!BtNetBSD/native/wd1a=feb 71SETTYPE_FILE_!BtNetBSD/native/wd1e=feb 72 73SETTYPE_FILES+=!BtNetBSD/src/Banner/!Path !BtNetBSD/src/Banner/Banner 74SETTYPE_FILES+=!BtNetBSD/src/Banner/resutil 75 76SETTYPE_FILE_!BtNetBSD/src/Banner/!Path=feb 77SETTYPE_FILE_!BtNetBSD/src/Banner/Banner=ffb 78SETTYPE_FILE_!BtNetBSD/src/Banner/resutil=ffb 79 80SETTYPE_FILES+=misc/bb_netbsd 81 82SETTYPE_FILE_misc/bb_netbsd=ffb 83 84.PATH: ${.CURDIR}/BtNetBSD/!BtNetBSD 85.PATH: ${.CURDIR}/BtNetBSD/!BtNetBSD/native 86.PATH: ${.CURDIR}/BtNetBSD/!BtNetBSD/src/Banner 87 88${UUDECODE_FILES}: setup_tmp 89 90.PHONY: setup_tmp 91setup_tmp: 92 -rm -rf tmp 93 mkdir tmp 94 cp -R ${.CURDIR}/BtNetBSD tmp/ 95 -find tmp -path '*/CVS/*' -type f -exec rm -rf {} \; 96 find tmp -name CVS -type d | xargs rmdir 97 find tmp -name '*.uue' -type f -exec rm -f {} \; 98 99.PHONY: settypes 100settypes: setup_tmp 101.for file in ${SETTYPE_FILES} 102. if ${SETTYPE_FILE_${file}} == ffb 103 ${TOOL_AWK} '{ printf "%5d %s\n", FNR * 10, $$0 }' \ 104 < tmp/BtNetBSD/${file} > tmp/BtNetBSD/${file}.tmp 105 mv tmp/BtNetBSD/${file}.tmp tmp/BtNetBSD/${file} 106. endif 107 mv tmp/BtNetBSD/${file} tmp/BtNetBSD/${file},${SETTYPE_FILE_${file}} 108.endfor 109 110.PHONY: tmp/BtNetBSD 111tmp/BtNetBSD: setup_tmp ${UUDECODE_FILES} settypes 112 cp ${KERNOBJDIR}/INSTALL/netbsd tmp/BtNetBSD/InstKern,1a9 113 cp ${BOOTLOADER} 'tmp/BtNetBSD/!BtNetBSD/boot32,ffa' 114 cp ${NBFS} 'tmp/BtNetBSD/!BtNetBSD/nbfs,ffa' 115 ${TOOL_MDSETIMAGE} tmp/BtNetBSD/InstKern,1a9 ${RAMDISKDIR}/ramdisk.fs 116 # unixfs is copied into the !BtNetBSD dir at install time 117 cd tmp/BtNetBSD && cp -R '!BtNetBSD/native' unixfs 118 119clean: localclean 120 121localclean: 122 rm -f ${ARCHIVE} 123 -if [ -d tmp ]; then rm -rf tmp; fi 124 125.include <bsd.files.mk> 126.include <bsd.prog.mk> 127