2003-02-14 02:55:12 +03:00
|
|
|
# $NetBSD: Makefile,v 1.16 2003/02/13 23:55:12 jmc Exp $
|
2000-11-29 19:35:03 +03:00
|
|
|
#
|
|
|
|
# Consult "*.conf" for the configuration variables; this Makefile is typically
|
|
|
|
# not edited for basic configuration changes.
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
all:
|
|
|
|
|
|
|
|
.if exists(site.conf)
|
|
|
|
.include "site.conf"
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !defined(RELEASE)
|
|
|
|
.BEGIN:
|
|
|
|
@echo "Please set RELEASE in the environment or in site.conf to the basename"
|
|
|
|
@echo "of the release configuration file to use. For example:"
|
|
|
|
@echo "> ${MAKE} RELEASE=foo"
|
|
|
|
@echo "will use the configuration file foo.conf."
|
|
|
|
@false
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if exists(${RELEASE}.conf)
|
|
|
|
.include "${RELEASE}.conf"
|
|
|
|
.elif !target(.BEGIN)
|
|
|
|
.BEGIN:
|
|
|
|
@echo "Error: File does not exist: ${RELEASE}.conf"
|
|
|
|
@false
|
|
|
|
.endif
|
|
|
|
|
|
|
|
CD_RELEASE?=
|
2002-09-29 11:23:15 +04:00
|
|
|
CD_SIZE?= 650000
|
2002-06-24 18:49:15 +04:00
|
|
|
RELEASENAME?= NetBSD-${CD_RELEASE}
|
2002-09-29 18:29:19 +04:00
|
|
|
MKISOFS_ARGS= -A "NetBSD ${CD_RELEASE}" \
|
2000-11-29 19:35:03 +03:00
|
|
|
-hide-rr-moved -m Split -m cdrom
|
2000-11-30 03:04:08 +03:00
|
|
|
# -hide-list ${.CURDIR}/hide-iso.lst
|
2000-11-29 19:35:03 +03:00
|
|
|
|
|
|
|
ALL_PORTS=
|
|
|
|
.for image in ${CD_IMAGES}
|
|
|
|
BASE_PORTS.${image}?=
|
|
|
|
ALL_PORTS:= ${ALL_PORTS} ${BASE_PORTS.${image}}
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.if exists(${RELEASENAME}.mk)
|
|
|
|
.include "${RELEASENAME}.mk"
|
|
|
|
.elif !target(.BEGIN)
|
|
|
|
.if !empty(CD_RELEASE)
|
|
|
|
.BEGIN:
|
|
|
|
@echo "Error: File does not exist: ${RELEASENAME}.mk"
|
|
|
|
@echo "(specified by variable CD_RELEASE in ${RELEASE}.conf)"
|
|
|
|
@false
|
|
|
|
.else
|
|
|
|
.BEGIN:
|
|
|
|
@echo "Error: CD_RELEASE not set in ${RELEASE}.conf"
|
|
|
|
@false
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
SUBDIR=
|
|
|
|
|
|
|
|
.if !empty(ALL_PORTS:Mmacppc)
|
|
|
|
SUBDIR+= macppc_installboot
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !empty(SUBDIR)
|
|
|
|
.include <bsd.subdir.mk>
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.include <bsd.obj.mk>
|
|
|
|
|
|
|
|
##### Default paths for programs #####
|
|
|
|
|
|
|
|
MKISOFS?= /usr/pkg/bin/mkisofs
|
2002-09-29 11:23:15 +04:00
|
|
|
MKSUNBOOTCDDIR!=cd ${NETBSDSRCDIR}/distrib/utils/mksunbootcd && ${PRINTOBJDIR}
|
|
|
|
MKSUNBOOTCD?= ${MKSUNBOOTCDDIR}/mksunbootcd
|
2000-11-29 19:35:03 +03:00
|
|
|
RSYNC?= /usr/pkg/bin/rsync
|
2002-10-03 11:28:33 +04:00
|
|
|
ALPHA_IBOOT?= ${INSTALLBOOT} -m alpha -o sunsum,append
|
2002-09-29 11:23:15 +04:00
|
|
|
PMAX_IBOOT?= ${INSTALLBOOT} -m pmax -o sunsum,append
|
|
|
|
VAX_IBOOT?= ${INSTALLBOOT} -m vax -o sunsum,append
|
2000-11-29 19:35:03 +03:00
|
|
|
.if !empty(ALL_PORTS:Mmacppc)
|
2002-06-15 06:15:15 +04:00
|
|
|
MACPPC_IBOOTDIR!= cd ${.CURDIR}/macppc_installboot && ${PRINTOBJDIR}
|
2000-11-29 19:35:03 +03:00
|
|
|
.endif
|
|
|
|
|
2002-09-29 18:29:19 +04:00
|
|
|
RSYNC_SITE?= rsync://rsync.netbsd.org/NetBSD/${RELEASENAME}/
|
2000-12-01 00:33:41 +03:00
|
|
|
RSYNC_ARGS?= -va --delete
|
2000-11-29 19:35:03 +03:00
|
|
|
RSYNC_EXCLUDE+= --exclude=/* --exclude=Split --exclude=cdrom
|
|
|
|
|
2002-06-24 18:49:15 +04:00
|
|
|
DISTRIBDIR?= ${.OBJDIR}/download
|
2000-11-29 22:56:19 +03:00
|
|
|
STAGEDIR?= ${.OBJDIR}/staging
|
|
|
|
IMAGEDIR?= ${.OBJDIR}
|
|
|
|
EXTFILEDIR?= ${.OBJDIR}/extfiles
|
2000-11-29 19:35:03 +03:00
|
|
|
EASTER_EGG?= /dev/null
|
|
|
|
|
2002-10-08 19:20:50 +04:00
|
|
|
##### MACHINE_ARCH for possible shared sets for each (shared) port #####
|
2000-11-29 19:35:03 +03:00
|
|
|
|
2002-10-08 19:20:50 +04:00
|
|
|
MACHINE_ARCH.acorn26= arm
|
|
|
|
MACHINE_ARCH.acorn32= arm
|
|
|
|
MACHINE_ARCH.algor= mipsel
|
2000-11-29 19:35:03 +03:00
|
|
|
MACHINE_ARCH.amiga= m68k
|
|
|
|
MACHINE_ARCH.amigappc= powerpc
|
|
|
|
MACHINE_ARCH.arc= mipsel
|
|
|
|
MACHINE_ARCH.atari= m68k
|
|
|
|
MACHINE_ARCH.bebox= powerpc
|
2002-10-08 19:20:50 +04:00
|
|
|
MACHINE_ARCH.cats= arm
|
|
|
|
MACHINE_ARCH.cesfic= m68k
|
2000-11-29 19:35:03 +03:00
|
|
|
MACHINE_ARCH.cobalt= mipsel
|
2002-10-08 19:20:50 +04:00
|
|
|
MACHINE_ARCH.dreamcast= sh3el
|
|
|
|
MACHINE_ARCH.evbarm= arm
|
|
|
|
MACHINE_ARCH.evbmips= mipsel
|
2002-12-09 17:20:52 +03:00
|
|
|
MACHINE_ARCH.evbppc= powerpc
|
2002-10-08 19:20:50 +04:00
|
|
|
MACHINE_ARCH.evbsh3= sh3eb
|
2000-11-29 19:35:03 +03:00
|
|
|
MACHINE_ARCH.hp300= m68k
|
2002-10-08 19:20:50 +04:00
|
|
|
MACHINE_ARCH.hpcarm= arm
|
2000-11-29 19:35:03 +03:00
|
|
|
MACHINE_ARCH.hpcmips= mipsel
|
2002-10-08 19:20:50 +04:00
|
|
|
MACHINE_ARCH.hpcsh= sh3el
|
2000-11-29 19:35:03 +03:00
|
|
|
MACHINE_ARCH.luna68k= m68k
|
|
|
|
MACHINE_ARCH.mac68k= m68k
|
|
|
|
MACHINE_ARCH.macppc= powerpc
|
|
|
|
MACHINE_ARCH.mipsco= mipseb
|
2002-10-08 19:20:50 +04:00
|
|
|
MACHINE_ARCH.mmeye= sh3eb
|
2000-11-29 19:35:03 +03:00
|
|
|
MACHINE_ARCH.mvme68k= m68k
|
2002-10-08 19:20:50 +04:00
|
|
|
MACHINE_ARCH.netwinder= arm
|
2000-11-29 19:35:03 +03:00
|
|
|
MACHINE_ARCH.news68k= m68k
|
|
|
|
MACHINE_ARCH.newsmips= mipseb
|
|
|
|
MACHINE_ARCH.next68k= m68k
|
|
|
|
MACHINE_ARCH.ofppc= powerpc
|
2002-10-08 19:20:50 +04:00
|
|
|
MACHINE_ARCH.playstation2=mipsel
|
2000-11-29 19:35:03 +03:00
|
|
|
MACHINE_ARCH.pmax= mipsel
|
|
|
|
MACHINE_ARCH.prep= powerpc
|
2002-10-08 19:20:50 +04:00
|
|
|
MACHINE_ARCH.sandpoint= powerpc
|
|
|
|
MACHINE_ARCH.sbmips= mipseb
|
2000-11-29 19:35:03 +03:00
|
|
|
MACHINE_ARCH.sgimips= mipseb
|
2002-10-08 19:20:50 +04:00
|
|
|
MACHINE_ARCH.shark= arm
|
2000-11-29 19:35:03 +03:00
|
|
|
MACHINE_ARCH.sun3= m68k
|
|
|
|
MACHINE_ARCH.x68k= m68k
|
|
|
|
|
|
|
|
##### Fetched directories from FTP server #####
|
|
|
|
|
|
|
|
.if defined(ALL_PORTS) && !empty(ALL_PORTS)
|
2002-09-29 18:29:19 +04:00
|
|
|
RSYNC_INCLUDE+= --include "/shared/"
|
|
|
|
RSYNC_EXCLUDE+= --exclude "/[a-z]*" \
|
|
|
|
--exclude "/shared/[a-z]*/"
|
2000-11-29 19:35:03 +03:00
|
|
|
.endif
|
|
|
|
|
2002-10-08 19:20:50 +04:00
|
|
|
RSYNC_ARCHS=
|
|
|
|
.for port in ${ALL_PORTS:O:u} # {
|
2002-09-29 18:29:19 +04:00
|
|
|
RSYNC_INCLUDE+= --include "/${port}/"
|
2000-11-29 19:35:03 +03:00
|
|
|
.if defined(MACHINE_ARCH.${port})
|
2002-10-08 19:20:50 +04:00
|
|
|
RSYNC_ARCHS+= ${MACHINE_ARCH.${port}}
|
2000-11-29 19:35:03 +03:00
|
|
|
.endif
|
2002-09-29 18:29:19 +04:00
|
|
|
.endfor # }
|
2002-10-08 19:20:50 +04:00
|
|
|
.for arch in ${RSYNC_ARCHS:O:u}
|
|
|
|
RSYNC_INCLUDE+= --include "/shared/${arch}/"
|
|
|
|
.endfor
|
2000-11-29 19:35:03 +03:00
|
|
|
|
|
|
|
##### Boot info and additional options for various platforms #####
|
|
|
|
|
|
|
|
.if defined(PUBLISHER)
|
|
|
|
MKISOFS_ARGS+= -P "${PUBLISHER}"
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(PREPARER)
|
|
|
|
MKISOFS_ARGS+= -p "${PREPARER}"
|
|
|
|
.endif
|
|
|
|
|
2002-10-08 19:20:50 +04:00
|
|
|
|
|
|
|
##### Per image settings #####
|
|
|
|
|
2002-09-29 18:29:19 +04:00
|
|
|
.for image in ${CD_IMAGES} # {
|
2000-11-29 19:35:03 +03:00
|
|
|
ports:=${BASE_PORTS.${image}}
|
|
|
|
|
|
|
|
.if !defined(VOLID.${image}) && !target(.BEGIN)
|
|
|
|
.BEGIN:
|
|
|
|
@echo "Error: VOLID.${image} not set in ${RELEASE}.conf"
|
|
|
|
@false
|
|
|
|
.endif
|
|
|
|
|
|
|
|
MKISOFS_ARGS.${image}= -V "${VOLID.${image}}"
|
|
|
|
|
2002-09-29 18:29:19 +04:00
|
|
|
pathlist.${image}:=${STAGEDIR}/${image}.pathlist
|
2002-10-03 07:58:56 +04:00
|
|
|
contents.${image}:=${IMAGEDIR}/${image}.contents
|
|
|
|
|
2002-09-29 18:29:19 +04:00
|
|
|
MKISOFS_ARGS.${image}+= -graft-points -path-list ${pathlist.${image}}
|
|
|
|
|
2000-11-29 19:35:03 +03:00
|
|
|
.if defined(ABSTRACT.${image})
|
|
|
|
MKISOFS_ARGS.${image}+= -abstract ${ABSTRACT.${image}}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Options specified in release config file
|
|
|
|
|
|
|
|
EXTFILES?=
|
|
|
|
INTFILES.${image}?=
|
|
|
|
INTDIRS.${image}?=
|
|
|
|
ADDFILES.${image}?=
|
|
|
|
|
2002-10-08 19:20:50 +04:00
|
|
|
bports= shared/ALL
|
2002-09-29 18:29:19 +04:00
|
|
|
.for port in ${ports} # {
|
2000-11-29 19:35:03 +03:00
|
|
|
EXTFILES+= ${EXTFILES.${port}}
|
|
|
|
INTFILES.${image}+= ${INTFILES.${port}}
|
|
|
|
INTDIRS.${image}+= ${INTDIRS.${port}}
|
|
|
|
ADDFILES.${image}+= ${ADDFILES.${port}}
|
|
|
|
MKISOFS_ARGS.${image}+= ${MKISOFS_ARGS.${port}}
|
2002-10-08 19:20:50 +04:00
|
|
|
# add shared/ALL and shared/${MACHINE_ARCH} to BASE_PORTS.${image}
|
|
|
|
bports+= ${port}
|
|
|
|
.if defined(MACHINE_ARCH.${port})
|
|
|
|
bports+= shared/${MACHINE_ARCH.${port}}
|
|
|
|
.endif
|
2002-09-29 18:29:19 +04:00
|
|
|
.endfor # }
|
2002-10-08 19:20:50 +04:00
|
|
|
BASE_PORTS.${image}:= ${bports:O:u}
|
|
|
|
|
2000-11-29 19:35:03 +03:00
|
|
|
|
|
|
|
# i386
|
|
|
|
|
|
|
|
.if !empty(ports:Mi386)
|
|
|
|
MKISOFS_ARGS.${image}+= -b ${BOOTFILE.i386} -c boot.catalog
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Mac (mac68k, macppc)
|
|
|
|
|
|
|
|
.if !empty(ports:Mmacppc)
|
2000-11-29 22:56:19 +03:00
|
|
|
MKISOFS_ARGS.${image}+= -hfs -part -hide-hfs-list ${.CURDIR}/hide-hfs.lst \
|
2002-09-29 11:23:15 +04:00
|
|
|
--macbin -map ${.CURDIR}/hfsmap.lst \
|
2002-10-21 09:08:23 +04:00
|
|
|
-boot-hfs-file ${MACPPC_IBOOTDIR}/macppcboot.raw
|
2000-11-29 22:56:19 +03:00
|
|
|
.elif defined(USE_APPLE_ISO) || !empty(ports:Mmac68k)
|
2000-11-30 03:04:08 +03:00
|
|
|
MKISOFS_ARGS.${image}+= -apple --macbin -map ${.CURDIR}/hfsmap.lst
|
2000-11-29 19:35:03 +03:00
|
|
|
.endif
|
|
|
|
|
|
|
|
# Sun (sparc, sparc64, sun3)
|
|
|
|
|
2000-11-29 22:56:19 +03:00
|
|
|
SUN_BOOT_ARGS.${image}:=
|
2002-09-29 18:29:19 +04:00
|
|
|
.if !empty(ports:Msparc*) || !empty(ports:Msun3*) # {
|
2000-11-29 19:35:03 +03:00
|
|
|
SUN_BOOT.123:= /dev/null
|
|
|
|
SUN_BOOT.4:= /dev/null
|
|
|
|
SUN_BOOT.5:= /dev/null
|
|
|
|
|
|
|
|
.if !empty(ports:Msparc)
|
|
|
|
SUN_BOOT.123:= ${BOOTFILE.sparc}
|
|
|
|
.endif
|
|
|
|
|
2002-09-29 18:29:19 +04:00
|
|
|
.if !empty(ports:Msun3) # {
|
2000-11-29 19:35:03 +03:00
|
|
|
.if !defined(BOOTFILE.sun3x)
|
|
|
|
# NetBSD >= 1.4; sun3 and sun3x are the same
|
|
|
|
SUN_BOOT.5:= ${BOOTFILE.sun3}
|
|
|
|
.endif
|
|
|
|
SUN_BOOT.4:= ${BOOTFILE.sun3}
|
2002-09-29 18:29:19 +04:00
|
|
|
.endif # }
|
2000-11-29 19:35:03 +03:00
|
|
|
|
|
|
|
.if !empty(ports:Msun3x) && defined(BOOTFILE.sun3x)
|
|
|
|
# NetBSD < 1.4; sun3 and sun3x are separate
|
|
|
|
SUN_BOOT.5:= ${BOOTFILE.sun3x}
|
|
|
|
.endif
|
|
|
|
|
2002-09-29 18:29:19 +04:00
|
|
|
.if !empty(ports:Msparc64) # {
|
2000-11-29 19:35:03 +03:00
|
|
|
.if (${SUN_BOOT.5} != "/dev/null")
|
|
|
|
# add warning
|
|
|
|
SUN_BOOT.5:= ${SUN_BOOT.5} ${BOOTFILE.sparc64}
|
|
|
|
.else
|
|
|
|
SUN_BOOT.5:= ${BOOTFILE.sparc64}
|
|
|
|
.endif
|
2002-09-29 18:29:19 +04:00
|
|
|
.endif # }
|
2000-11-29 19:35:03 +03:00
|
|
|
|
|
|
|
SUN_BOOT_ARGS.${image}:= ${SUN_BOOT.123} ${SUN_BOOT.123} ${SUN_BOOT.123} ${SUN_BOOT.4} ${SUN_BOOT.5}
|
2000-11-29 22:56:19 +03:00
|
|
|
|
|
|
|
.if empty(SUN_BOOT_ARGS.${image}:N/dev/null)
|
|
|
|
SUN_BOOT_ARGS.${image}:=
|
|
|
|
.endif
|
2002-09-29 18:29:19 +04:00
|
|
|
.endif # }
|
2000-11-29 19:35:03 +03:00
|
|
|
|
2002-09-29 18:29:19 +04:00
|
|
|
.endfor # image in ${CD_IMAGES} # }
|
2000-11-29 19:35:03 +03:00
|
|
|
|
|
|
|
##### Additional options for host OS's #####
|
|
|
|
|
|
|
|
# (USE_APPLE_ISO is tested above)
|
|
|
|
|
|
|
|
.if defined(USE_ROCK_RIDGE)
|
|
|
|
MKISOFS_ARGS+= -r
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(USE_LONG_NAMES)
|
|
|
|
MKISOFS_ARGS+= -l
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(USE_TRANS_TBL)
|
|
|
|
MKISOFS_ARGS+= -T
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(USE_JOLIET)
|
|
|
|
MKISOFS_ARGS+= -J -hide-joliet-list ${.CURDIR}/hide-jol.lst
|
|
|
|
.if defined(USE_TRANS_TBL)
|
|
|
|
MKISOFS_ARGS+= -hide-joliet-trans-tbl
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
##### File extract rule #####
|
|
|
|
|
|
|
|
USE-FILE: .USE
|
2000-11-30 03:04:08 +03:00
|
|
|
@if [ ! -r $@ ]; then case $> in \
|
2000-11-29 19:35:03 +03:00
|
|
|
/*,link) \
|
2002-09-29 18:29:19 +04:00
|
|
|
echo "cp ${>:S/,link$//} $@"; \
|
|
|
|
cp ${>:S/,link$//} $@;; \
|
2000-11-29 19:35:03 +03:00
|
|
|
*,link) \
|
2002-09-29 18:29:19 +04:00
|
|
|
echo "cp `pwd -P`/${>:S/,link$//} $@"; \
|
|
|
|
cp `pwd -P`/${>:S/,link$//} $@;; \
|
2000-11-29 19:35:03 +03:00
|
|
|
*.tgz,*) \
|
|
|
|
echo "Extracting: $> --> $@..."; \
|
2003-02-14 02:55:12 +03:00
|
|
|
tar --fast-read -xzf ${>:C/,.*$//} ${>:C/^.*,//} ; \
|
|
|
|
cp ${>:C/^.*,//} $@; rm -rf ${>:C/^.*,//} ;; \
|
2000-11-29 19:35:03 +03:00
|
|
|
*.gz) echo "gunzip -c <$> >$@"; gunzip -c <$> >$@;; \
|
|
|
|
*) echo "Unknown archive method for $@"; false;; \
|
2000-11-30 03:04:08 +03:00
|
|
|
esac; else true; fi
|
2000-11-29 19:35:03 +03:00
|
|
|
|
|
|
|
##### Makefile rules #####
|
|
|
|
|
2002-09-29 18:29:19 +04:00
|
|
|
.for image in ${CD_IMAGES} # {
|
2000-11-29 19:35:03 +03:00
|
|
|
all: ${IMAGEDIR}/${image}.iso
|
|
|
|
|
|
|
|
stage-${image}:
|
|
|
|
mkdir -p ${STAGEDIR}/${image} ${EXTFILEDIR}
|
2002-10-03 07:58:56 +04:00
|
|
|
rm -f ${pathlist.${image}} ${contents.${image}}
|
2000-11-29 19:35:03 +03:00
|
|
|
.if defined(BASE_PORTS.${image}) && !empty(BASE_PORTS.${image})
|
|
|
|
.for dir in ${INTDIRS.${image}}
|
|
|
|
mkdir -p ${STAGEDIR}/${image}/${dir}
|
|
|
|
.endfor
|
|
|
|
.for arch in ${BASE_PORTS.${image}}
|
2002-10-03 07:58:56 +04:00
|
|
|
@echo "${arch}=${DISTRIBDIR}/${arch}" >> ${pathlist.${image}}
|
|
|
|
@echo "${arch}" >> ${contents.${image}}
|
2000-11-29 19:35:03 +03:00
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
|
|
|
|
extfileprep:
|
2002-09-29 18:29:19 +04:00
|
|
|
.for file in ${EXTFILES} # {
|
2000-11-29 19:35:03 +03:00
|
|
|
extfileprep: ${EXTFILEDIR}/${file:C/:.*$//}
|
2002-09-29 18:29:19 +04:00
|
|
|
${EXTFILEDIR}/${file:C/:.*$//}: ${DISTRIBDIR}/${file:C/^.*://} USE-FILE
|
|
|
|
${DISTRIBDIR}/${file:C/^.*://}: .PHONY
|
|
|
|
.endfor # }
|
2000-11-29 19:35:03 +03:00
|
|
|
|
|
|
|
fileprep-${image}:
|
2002-09-29 18:29:19 +04:00
|
|
|
.for file in ${INTFILES.${image}} # {
|
2000-11-29 19:35:03 +03:00
|
|
|
fileprep-${image}: ${STAGEDIR}/${image}/${file:C/:.*$//}
|
2002-09-29 18:29:19 +04:00
|
|
|
${STAGEDIR}/${image}/${file:C/:.*$//}: ${DISTRIBDIR}/${file:C/^.*://} USE-FILE
|
|
|
|
${DISTRIBDIR}/${file:C/^.*://}: .PHONY
|
|
|
|
.endfor # }
|
|
|
|
.for file in ${ADDFILES.${image}} # {
|
2000-11-29 19:35:03 +03:00
|
|
|
fileprep-${image}: ${STAGEDIR}/${image}/${file:C/:.*$//}
|
|
|
|
${STAGEDIR}/${image}/${file:C/:.*$//}: ${file:C/^.*://} USE-FILE
|
|
|
|
${file:C/^.*://}: .PHONY
|
2002-09-29 18:29:19 +04:00
|
|
|
.endfor # }
|
2000-11-29 19:35:03 +03:00
|
|
|
|
|
|
|
# Size the CD image. This is done via the following formula:
|
|
|
|
# 1. Size the image produced by mkisofs.
|
|
|
|
# 2. Add images added by mksunbootcd by rounding to a 320k boundary and
|
|
|
|
# adding each Sun image rounded to a 320k boundary.
|
|
|
|
# 3. Add 64k if macppc is included (ofwboot munged to one 64k block).
|
|
|
|
# 4. Add bootfile sizes rounded up to 512 bytes for pmax and vax.
|
|
|
|
# 5. Round up to a 32k boundary, then add another 32k for TAO padding.
|
|
|
|
|
2000-11-29 22:56:19 +03:00
|
|
|
.if !empty(BASE_PORTS.${image}:Mmacppc)
|
|
|
|
size-${image}: all-macppc_installboot
|
|
|
|
.endif
|
|
|
|
|
|
|
|
size-${image}: stage-${image} extfileprep fileprep-${image}
|
2000-11-29 19:35:03 +03:00
|
|
|
@size=$$((`cd ${STAGEDIR}/${image} && ${MKISOFS} ${MKISOFS_ARGS} ${MKISOFS_ARGS.${image}} -print-size . 2>&1 | tee /dev/stderr | sed '/=/!d;s/^[^=]*=//'` * 2048)) && \
|
|
|
|
if [ "${SUN_BOOT_ARGS.${image}}" != "" ]; then \
|
|
|
|
size=$$(($$(($$size + 327679)) / 327680 * 327680)) && \
|
|
|
|
bootfiles=`for f in ${SUN_BOOT_ARGS.${image}:N/dev/null:O}; do echo $$f; done | uniq` && \
|
|
|
|
for f in $$bootfiles; do \
|
|
|
|
bfsize=`ls -l $$f | awk '{print $$5}'` && \
|
|
|
|
size=$$(($$size + $$(($$(($$bfsize + 327679)) / 327680 * 327680)))); \
|
|
|
|
done; \
|
|
|
|
fi && \
|
|
|
|
if [ "${BASE_PORTS.${image}:Mmacppc}" != "" ]; then \
|
|
|
|
size=$$(($$size + 65536)); \
|
|
|
|
fi && \
|
|
|
|
if [ "${BASE_PORTS.${image}:Mpmax}" != "" ]; then \
|
|
|
|
size=$$(($$size + $$(($$((`ls -l ${BOOTFILE.pmax} | awk '{print $$5}'` + 511)) / 512 * 512)))); \
|
|
|
|
fi && \
|
|
|
|
if [ "${BASE_PORTS.${image}:Mvax}" != "" ]; then \
|
|
|
|
size=$$(($$size + $$(($$((`ls -l ${BOOTFILE.vax} | awk '{print $$5}'` + 511)) / 512 * 512)))); \
|
|
|
|
fi && \
|
|
|
|
size=$$(($$(($$size + 16383)) / 16384 * 16384 + 32768)) && \
|
|
|
|
sizek=$$(($$size / 1024)) && \
|
|
|
|
echo "Projected size of ${image}.iso: $$size bytes ($${sizek}K)." && \
|
2002-09-29 11:23:15 +04:00
|
|
|
if [ $$sizek -gt ${CD_SIZE} ]; then echo "Image too large for ${CD_SIZE} KB CD!"; false; fi
|
2000-11-29 19:35:03 +03:00
|
|
|
|
2000-11-29 22:56:19 +03:00
|
|
|
# Actually build the image with all the bootstrap goo....
|
|
|
|
|
2002-09-29 18:29:19 +04:00
|
|
|
${IMAGEDIR}/${image}.iso: size-${image}
|
2002-10-03 07:58:56 +04:00
|
|
|
@sort -o ${contents.${image}} ${contents.${image}}
|
2001-01-17 05:07:25 +03:00
|
|
|
.if defined(LOG_MKISOFS)
|
|
|
|
cd ${STAGEDIR}/${image} && ${MKISOFS} -o $@ ${MKISOFS_ARGS} ${MKISOFS_ARGS.${image}} -v -v . >${IMAGEDIR}/${image}.iso.log 2>&1
|
|
|
|
.else
|
2000-11-29 22:56:19 +03:00
|
|
|
cd ${STAGEDIR}/${image} && ${MKISOFS} -o $@ ${MKISOFS_ARGS} ${MKISOFS_ARGS.${image}} .
|
2001-01-17 05:07:25 +03:00
|
|
|
.endif
|
2000-11-29 22:56:19 +03:00
|
|
|
.if !empty(SUN_BOOT_ARGS.${image})
|
2000-11-29 19:35:03 +03:00
|
|
|
${MKSUNBOOTCD} -c 640 $@ ${SUN_BOOT_ARGS.${image}}
|
|
|
|
.endif
|
|
|
|
.if !empty(BASE_PORTS.${image}:Mmacppc)
|
|
|
|
@blknum=$$((`ls -l $@ | awk '{print $$5}'` / 512)) && \
|
2000-11-29 22:56:19 +03:00
|
|
|
${MACPPC_IBOOTDIR}/macppc_installboot $@ $$blknum 756
|
2000-11-29 19:35:03 +03:00
|
|
|
dd if=${EXTFILEDIR}/macppc.ofwboot bs=64k count=1 conv=sync >>$@ 2>/dev/null
|
|
|
|
.endif
|
|
|
|
.if !empty(BASE_PORTS.${image}:Mpmax)
|
2002-09-29 11:23:15 +04:00
|
|
|
${PMAX_IBOOT} $@ ${BOOTFILE.pmax}
|
2000-11-29 19:35:03 +03:00
|
|
|
.endif
|
|
|
|
.if !empty(BASE_PORTS.${image}:Mvax)
|
2002-06-24 18:49:15 +04:00
|
|
|
${VAX_IBOOT} $@ ${BOOTFILE.vax}
|
2002-10-03 09:26:49 +04:00
|
|
|
.endif
|
|
|
|
.if !empty(BASE_PORTS.${image}:Malpha)
|
|
|
|
${ALPHA_IBOOT} $@ ${BOOTFILE.alpha}
|
2000-11-29 19:35:03 +03:00
|
|
|
.endif
|
|
|
|
@echo Rounding up to 32k boundary and padding 32k....
|
|
|
|
@size=`ls -l $@ | awk '{print $$5}'` && \
|
|
|
|
newsize=$$(($$(($$size + 32767)) / 32768 * 32768)) && \
|
|
|
|
dd if=/dev/zero bs=512 count=$$(($$(($$newsize - $$size)) / 512)) >>$@ 2>/dev/null
|
|
|
|
dd if=${EASTER_EGG} bs=32768 count=1 conv=sync >>$@ 2>/dev/null
|
|
|
|
|
2002-09-29 18:29:19 +04:00
|
|
|
.endfor # image in ${CD_IMAGES} # }
|
2000-11-29 19:35:03 +03:00
|
|
|
|
|
|
|
fetch:
|
2002-06-24 18:49:15 +04:00
|
|
|
@mkdir -p ${DISTRIBDIR}
|
2000-11-29 19:35:03 +03:00
|
|
|
@echo Fetching distributions....
|
2002-09-29 18:29:19 +04:00
|
|
|
${RSYNC} ${RSYNC_INCLUDE} ${RSYNC_ARGS} ${RSYNC_EXCLUDE} ${RSYNC_SITE}/ ${DISTRIBDIR}/
|
2000-11-29 19:35:03 +03:00
|
|
|
|
|
|
|
clean: cleanstagedir cleanimages
|
2002-06-24 18:49:15 +04:00
|
|
|
cleandir distclean: cleandistribdir
|
2000-11-29 19:35:03 +03:00
|
|
|
|
|
|
|
cleanimages:
|
|
|
|
.for image in ${CD_IMAGES}
|
2002-10-03 07:58:56 +04:00
|
|
|
-rm -f ${IMAGEDIR}/${image}.iso ${IMAGEDIR}/${image}.iso.log \
|
|
|
|
${contents.${image}}
|
2000-11-29 19:35:03 +03:00
|
|
|
.endfor
|
|
|
|
|
|
|
|
cleanstagedir:
|
|
|
|
-rm -rf ${STAGEDIR} ${EXTFILEDIR}
|
|
|
|
|
2002-06-24 18:49:15 +04:00
|
|
|
cleandistribdir:
|
|
|
|
-rm -rf ${DISTRIBDIR}
|