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