1 # $NetBSD: Makefile,v 1.1 2001/01/07 09:30:19 mrg Exp $ 2 3 TOP= ${.CURDIR}/.. 4 MINIROOT= ${TOP}/../miniroot 5 HACKSRC= ${TOP}/../utils/libhack 6 SRCROOT= ${TOP}/../.. 7 WARNS=1 8 9 .if ${MACHINE_ARCH} == "i386" 10 RAW_PART= d 11 .else 12 RAW_PART= c 13 .endif 14 15 # Need to add more cases 16 .if ${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "m68k" || \ 17 ${MACHINE_ARCH} == "sparc64" 18 FS_END= be 19 .else # i386, pmax 20 FS_END= le 21 .endif 22 23 AUXDEPENDS= dot.profile disktab.preinstall termcap.mini \ 24 dist/base_obsolete dist/comp_obsolete \ 25 dist/games_obsolete dist/man_obsolete dist/misc_obsolete \ 26 dist/secr_obsolete dist/xbase_obsolete dist/xserver_obsolete 27 AUXCLEAN= list ${CBIN}.conf dot.profile 28 29 CBIN= ramdiskbin 30 31 .if ${MACHINE_ARCH} == "sparc64" 32 CSIZE?= 10240 33 .endif 34 35 MOUNT_POINT?= /mnt 36 # DEV/RDEV file system device, CDEV/RDEV vnconfig device 37 VND?= vnd0 38 VND_DEV= /dev/${VND}c 39 VND_RDEV= /dev/r${VND}c 40 VND_CDEV= /dev/${VND}${RAW_PART} 41 VND_CRDEV= /dev/r${VND}${RAW_PART} 42 IMAGE?= ramdisk.fs 43 CSIZE?= 3312 44 MDEC= ${DESTDIR}/usr/mdec 45 46 LISTS= list 47 CRUNCHCONF= ${CBIN}.conf 48 MTREE= mtree.conf 49 50 CRUNCHGEN?= crunchgen 51 DISKTYPE?= miniroot 52 53 all: ${CBIN} ${AUXDEPENDS} ${MTREE} ${LISTS} dot.profile 54 dd if=/dev/zero of=${IMAGE} count=${CSIZE} 55 vnconfig -v -c ${VND_CDEV} ${IMAGE} 56 disklabel -f ${.CURDIR}/disktab -rw ${VND_CDEV} ${DISKTYPE} 57 newfs -B ${FS_END} -m 0 -o space -i 5120 -c 80 ${VND_RDEV} ${DISKTYPE} 58 mount -o softdep ${VND_DEV} ${MOUNT_POINT} 59 mtree -def ${.CURDIR}/${MTREE} -p ${MOUNT_POINT}/ -u 60 TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \ 61 KERNOBJDIR=${KERNOBJDIR} \ 62 TARGDIR=${MOUNT_POINT} sh ${TOP}/runlist.sh ${LISTS} 63 @echo "" 64 @df -i ${MOUNT_POINT} 65 @echo "" 66 @echo "installing new bootblocks" 67 ${MDEC}/binstall -m ${DESTDIR}/usr/mdec -u -v ffs ${MOUNT_POINT} 68 umount ${MOUNT_POINT} 69 vnconfig -u ${VND_CDEV} 70 71 unconfig: 72 -umount -f ${MOUNT_POINT} 73 -vnconfig -u ${VND_DEV} 74 -/bin/rm -f ${IMAGE} 75 76 dot.profile: dot.profile.m4 77 m4 -DMACHINE_ARCH=${MACHINE_ARCH} -DMACHINE=${MACHINE} \ 78 ${.ALLSRC} > ${.TARGET} 79 80 ${LISTS}: ${LISTS}.m4 81 m4 -DMACHINE_ARCH=${MACHINE_ARCH} -DMACHINE=${MACHINE} \ 82 -DSRCROOT=${SRCROOT} ${.ALLSRC} > ${.TARGET} 83 84 ${CBIN}.conf: ${CBIN}.m4 85 m4 -DMACHINE_ARCH=${MACHINE_ARCH} -DMACHINE=${MACHINE} \ 86 ${.ALLSRC} > ${.TARGET} 87 88 ${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF} 89 ${CRUNCHGEN} -D ${SRCROOT} -L ${DESTDIR}/usr/lib ${.ALLSRC} 90 91 ${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c 92 ${MAKE} -f ${CBIN}.mk all 93 94 # This is listed in ramdiskbin.conf but is built here. 95 ${CBIN}: libhack.o 96 97 # Use stubs to eliminate some large stuff from libc 98 .include "${HACKSRC}/Makefile.inc" 99 100 # turn off small gethostby* temporarily 101 HACKOBJS:= getcap.o getgrent.o getnet.o getnetgr.o getpwent.o setlocale.o yplib.o 102 103 clean cleandir distclean: 104 /bin/rm -f *.core ${AUXCLEAN} ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache *.o *.lo *.cro *.c 105 106 .ifndef RELEASEDIR 107 release: 108 @echo setenv RELEASEDIR first 109 @false 110 .else 111 release: $(IMAGE) 112 @mkdir -p $(RELEASEDIR)/installation/ramdisk 113 gzip -c -9 < $(.OBJDIR)/ramdisk.fs \ 114 > $(RELEASEDIR)/installation/ramdisk/ramdisk.fs.gz 115 .endif # RELEASEDIR check 116 117 .include <bsd.own.mk> 118 .include <bsd.obj.mk> 119 .include <bsd.subdir.mk> 120 .include <bsd.sys.mk> 121