2009-03-22 02:52:38 +03:00
|
|
|
# $NetBSD: Makefile,v 1.42 2009/03/21 23:52:38 tsutsui 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.
|
|
|
|
##############################################################################
|
|
|
|
|
2009-03-09 14:34:37 +03:00
|
|
|
all: cdimages
|
2008-10-26 02:27:34 +04:00
|
|
|
|
2009-03-09 14:34:37 +03:00
|
|
|
.include <bsd.own.mk>
|
2000-11-29 19:35:03 +03:00
|
|
|
|
|
|
|
.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)
|
2006-09-17 07:56:03 +04:00
|
|
|
SUBDIR+= macppc_mkboothfs macppc_installboot
|
2000-11-29 19:35:03 +03:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !empty(SUBDIR)
|
|
|
|
.include <bsd.subdir.mk>
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.include <bsd.obj.mk>
|
2003-07-10 15:23:53 +04:00
|
|
|
.include <bsd.own.mk>
|
2000-11-29 19:35:03 +03:00
|
|
|
|
|
|
|
##### Default paths for programs #####
|
|
|
|
|
2009-03-22 01:41:57 +03:00
|
|
|
MKISOFS?= /usr/local/bin/mkisofs
|
2000-11-29 19:35:03 +03:00
|
|
|
RSYNC?= /usr/pkg/bin/rsync
|
2003-07-10 14:33:58 +04:00
|
|
|
ALPHA_IBOOT?= ${TOOL_INSTALLBOOT} -m alpha -o sunsum,append
|
|
|
|
PMAX_IBOOT?= ${TOOL_INSTALLBOOT} -m pmax -o sunsum,append
|
2004-02-29 04:08:22 +03:00
|
|
|
VAX_IBOOT?= ${TOOL_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}
|
2006-09-17 07:56:03 +04:00
|
|
|
MACPPC_MKBOOTHFSDIR!= cd ${.CURDIR}/macppc_mkboothfs && ${PRINTOBJDIR}
|
2000-11-29 19:35:03 +03:00
|
|
|
.endif
|
2007-03-04 07:59:41 +03:00
|
|
|
.if !empty(ALL_PORTS:Msgimips)
|
|
|
|
SGIMIPS_SGIVOL?= ${TOOLDIR}/bin/nbsgivol
|
|
|
|
.endif
|
2000-11-29 19:35:03 +03:00
|
|
|
|
2007-12-08 00:08:58 +03:00
|
|
|
##### rsync settings #####
|
|
|
|
|
|
|
|
# rsync host; check mirrors on http://www.NetBSD.org/mirrors/#rsync
|
|
|
|
# (note not all rsync mirrors provide NetBSD-daily)
|
|
|
|
RSYNC_HOST?= rsync.NetBSD.org
|
|
|
|
|
|
|
|
# extra path for rsync mirrors ("/pub", "/netbsd" etc.)
|
|
|
|
RSYNC_PATH_PREFIX?=
|
|
|
|
|
|
|
|
.if ${RELEASE} == "current"
|
|
|
|
# daily date dir name
|
|
|
|
BRANCH?= HEAD
|
|
|
|
#DAILY_DIR?= yyyymmddhhmmZ
|
|
|
|
RSYNC_PATH?= ${RSYNC_PATH_PREFIX}/NetBSD-daily/${BRANCH}/${DAILY_DIR}
|
|
|
|
.else
|
|
|
|
# extra suffix on pre-release ("_BETA2", "_RC5" etc.)
|
|
|
|
RELEASE_SUFFIX?=
|
|
|
|
RSYNC_PATH?= ${RSYNC_PATH_PREFIX}/NetBSD/${RELEASENAME}${RELEASE_SUFFIX}
|
|
|
|
|
|
|
|
# alternative for NetBSD-daily sets of stable branches
|
|
|
|
#DAILY_DIR?= yyyymmddhhmmZ
|
|
|
|
#BRANCH?= netbsd-4
|
|
|
|
#RSYNC_PATH?= ${RSYNC_PATH_PREFIX}/NetBSD-daily/${BRANCH}/${DAILY_DIR}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
RSYNC_SITE?= rsync://${RSYNC_HOST}${RSYNC_PATH}
|
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
|
2004-10-14 03:28:34 +04:00
|
|
|
MACHINE_ARCH.iyonix= arm
|
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)
|
2006-09-17 07:20:46 +04:00
|
|
|
RSYNC_INCLUDE+= --include "/shared"
|
2002-09-29 18:29:19 +04:00
|
|
|
RSYNC_EXCLUDE+= --exclude "/[a-z]*" \
|
2006-09-17 07:20:46 +04:00
|
|
|
--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} # {
|
2006-09-17 07:20:46 +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}
|
2006-09-17 07:20:46 +04:00
|
|
|
RSYNC_INCLUDE+= --include "/shared/${arch}"
|
2002-10-08 19:20:50 +04:00
|
|
|
.endfor
|
2000-11-29 19:35:03 +03:00
|
|
|
|
|
|
|
##### Boot info and additional options for various platforms #####
|
|
|
|
|
|
|
|
.if defined(PUBLISHER)
|
2007-02-20 21:09:05 +03:00
|
|
|
MKISOFS_ARGS+= -publisher "${PUBLISHER}"
|
2000-11-29 19:35:03 +03:00
|
|
|
.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}?=
|
|
|
|
|
2009-03-22 02:52:38 +03:00
|
|
|
bports= # empty first
|
2005-01-20 11:05:55 +03:00
|
|
|
# For a source only cd just ignore the shared/ALL directory
|
2009-03-09 14:34:37 +03:00
|
|
|
.if ${ports} != "source" && exists(${DISTRIBDIR}/shared/ALL)
|
2009-03-22 02:52:38 +03:00
|
|
|
bports+= shared/ALL
|
2005-01-20 11:05:55 +03:00
|
|
|
.endif
|
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}
|
2009-03-09 14:34:37 +03:00
|
|
|
.if defined(MACHINE_ARCH.${port}) && \
|
|
|
|
exists(${DISTRIBDIR}/shared/${MACHINE_ARCH.${port}})
|
2002-10-08 19:20:50 +04:00
|
|
|
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)
|
2007-03-08 16:51:37 +03:00
|
|
|
.if empty(INTFILES.i386:Mbootxx_cd9660)
|
|
|
|
# non-emulation boot
|
|
|
|
MKISOFS_ARGS.${image}+= -b ${BOOTFILE.i386} -c boot.catalog -no-emul-boot
|
|
|
|
.else
|
|
|
|
#2.88MB emulation boot
|
2000-11-29 19:35:03 +03:00
|
|
|
MKISOFS_ARGS.${image}+= -b ${BOOTFILE.i386} -c boot.catalog
|
|
|
|
.endif
|
2007-03-08 16:51:37 +03:00
|
|
|
.endif
|
2000-11-29 19:35:03 +03:00
|
|
|
|
2004-12-31 11:34:13 +03:00
|
|
|
# amd64
|
|
|
|
|
|
|
|
.if !empty(ports:Mamd64)
|
2007-03-08 16:51:37 +03:00
|
|
|
.if empty(INTFILES.amd64:Mbootxx_cd9660)
|
|
|
|
# non-emulation boot
|
|
|
|
MKISOFS_ARGS.${image}+= -b ${BOOTFILE.amd64} -c boot.catalog -no-emul-boot
|
|
|
|
.else
|
|
|
|
#2.88MB emulation boot
|
2004-12-31 11:34:13 +03:00
|
|
|
MKISOFS_ARGS.${image}+= -b ${BOOTFILE.amd64} -c boot.catalog
|
|
|
|
.endif
|
2007-03-08 16:51:37 +03:00
|
|
|
.endif
|
2004-12-31 11:34:13 +03:00
|
|
|
|
2000-11-29 19:35:03 +03:00
|
|
|
# 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 \
|
2006-09-17 07:56:03 +04:00
|
|
|
-boot-hfs-file ${MACPPC_MKBOOTHFSDIR}/boothfs
|
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*) # {
|
2003-03-07 12:52:59 +03:00
|
|
|
SUN_BOOT.123:= -
|
|
|
|
SUN_BOOT.4:= -
|
|
|
|
SUN_BOOT.5:= -
|
2000-11-29 19:35:03 +03:00
|
|
|
|
|
|
|
.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) # {
|
2003-03-07 12:52:59 +03:00
|
|
|
.if (${SUN_BOOT.5} != "-")
|
2000-11-29 19:35:03 +03:00
|
|
|
# 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} # {
|
2009-03-09 14:34:37 +03:00
|
|
|
cdimages: ${IMAGEDIR}/${image}.iso
|
2000-11-29 19:35:03 +03:00
|
|
|
|
|
|
|
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.
|
2003-03-07 12:52:59 +03:00
|
|
|
# 2. Add images added by distrib/common/sunbootcd.sh by rounding to a 320k
|
|
|
|
# boundary and adding each Sun image rounded to a 320k boundary.
|
2006-09-17 07:56:03 +04:00
|
|
|
# 3. Add bootfile sizes rounded up to 512 bytes for pmax and vax.
|
|
|
|
# 4. Round up to a 32k boundary, then add another 32k for TAO padding.
|
2000-11-29 19:35:03 +03:00
|
|
|
|
2000-11-29 22:56:19 +03:00
|
|
|
.if !empty(BASE_PORTS.${image}:Mmacppc)
|
2006-09-17 07:56:03 +04:00
|
|
|
size-${image}: all-macppc_mkboothfs all-macppc_installboot
|
2000-11-29 22:56:19 +03:00
|
|
|
.endif
|
2007-03-04 07:59:41 +03:00
|
|
|
|
|
|
|
SGIVOLHDR.size= 4096
|
2000-11-29 22:56:19 +03:00
|
|
|
|
|
|
|
size-${image}: stage-${image} extfileprep fileprep-${image}
|
2006-09-17 07:56:03 +04:00
|
|
|
.if !empty(BASE_PORTS.${image}:Mmacppc)
|
|
|
|
${MACPPC_MKBOOTHFSDIR}/macppc_mkboothfs ${MACPPC_MKBOOTHFSDIR}/boothfs
|
|
|
|
.endif
|
2008-10-26 02:27:34 +04:00
|
|
|
@size=$$((`cd ${STAGEDIR}/${image} && \
|
|
|
|
${MKISOFS} ${MKISOFS_ARGS} ${MKISOFS_ARGS.${image}} \
|
2009-01-28 20:11:54 +03:00
|
|
|
-print-size . 2>&1 \
|
2008-10-26 02:27:34 +04:00
|
|
|
| tee /dev/stderr \
|
2009-01-28 20:11:54 +03:00
|
|
|
| ${TOOL_SED} '/=/!d;s/^[^=]*=//'` \
|
|
|
|
\* 2048)) && \
|
2000-11-29 19:35:03 +03:00
|
|
|
if [ "${SUN_BOOT_ARGS.${image}}" != "" ]; then \
|
|
|
|
size=$$(($$(($$size + 327679)) / 327680 * 327680)) && \
|
2003-03-07 12:52:59 +03:00
|
|
|
bootfiles=`for f in ${SUN_BOOT_ARGS.${image}:N-:O}; do echo $$f; done | uniq` && \
|
2000-11-29 19:35:03 +03:00
|
|
|
for f in $$bootfiles; do \
|
2007-12-08 15:30:18 +03:00
|
|
|
bfsize=$$(${TOOL_STAT} -f '%z' $$f) && \
|
2000-11-29 19:35:03 +03:00
|
|
|
size=$$(($$size + $$(($$(($$bfsize + 327679)) / 327680 * 327680)))); \
|
|
|
|
done; \
|
|
|
|
fi && \
|
|
|
|
if [ "${BASE_PORTS.${image}:Mpmax}" != "" ]; then \
|
2007-12-08 15:30:18 +03:00
|
|
|
size=$$(($$size + $$(($$(($$(${TOOL_STAT} -f '%z' ${BOOTFILE.pmax}) + 511)) / 512 * 512)))); \
|
2000-11-29 19:35:03 +03:00
|
|
|
fi && \
|
|
|
|
if [ "${BASE_PORTS.${image}:Mvax}" != "" ]; then \
|
2007-12-08 15:30:18 +03:00
|
|
|
size=$$(($$size + $$(($$(($$(${TOOL_STAT} -f '%z' ${BOOTFILE.vax}) + 511)) / 512 * 512)))); \
|
2000-11-29 19:35:03 +03:00
|
|
|
fi && \
|
2007-03-04 07:27:21 +03:00
|
|
|
if [ "${BASE_PORTS.${image}:Msgimips}" != "" -a \
|
2005-10-22 19:56:16 +04:00
|
|
|
"${EXTFILES.sgimips}" != "" ]; then \
|
2007-03-04 07:59:41 +03:00
|
|
|
size=$$(($$size + ${SGIVOLHDR.size} * 512)); \
|
2005-10-04 23:29:34 +04:00
|
|
|
fi && \
|
2000-11-29 19:35:03 +03:00
|
|
|
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})
|
2003-07-10 14:33:58 +04:00
|
|
|
SUNLABEL=${TOOL_SUNLABEL:Q} \
|
|
|
|
${HOST_SH} ${NETBSDSRCDIR}/distrib/common/sunbootcd.sh \
|
2003-03-07 12:52:59 +03:00
|
|
|
${.TARGET} ${SUN_BOOT_ARGS.${image}}
|
2000-11-29 19:35:03 +03:00
|
|
|
.endif
|
|
|
|
.if !empty(BASE_PORTS.${image}:Mmacppc)
|
2006-09-17 07:56:03 +04:00
|
|
|
${MACPPC_IBOOTDIR}/macppc_installboot \
|
|
|
|
$@ ${EXTFILEDIR}/macppc.bootxx /ofwboot
|
2000-11-29 19:35:03 +03:00
|
|
|
.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}
|
2005-10-04 23:29:34 +04:00
|
|
|
.endif
|
2005-10-22 19:56:16 +04:00
|
|
|
.if !empty(BASE_PORTS.${image}:Msgimips) && defined(EXTFILES.sgimips)
|
2005-10-04 23:29:34 +04:00
|
|
|
@echo "Prepending SGI volume header"
|
2007-03-04 07:59:41 +03:00
|
|
|
mv $@ $@.raw
|
|
|
|
dd if=/dev/zero of=$@.tmp bs=512 count=${SGIVOLHDR.size}
|
|
|
|
dd if=$@.raw of=$@.tmp bs=512 seek=${SGIVOLHDR.size}
|
|
|
|
${SGIMIPS_SGIVOL} -f -i -h ${SGIVOLHDR.size} $@.tmp
|
|
|
|
${SGIMIPS_SGIVOL} -f -w aoutboot ${STAGEDIR}/${image}/aoutboot $@.tmp
|
|
|
|
${SGIMIPS_SGIVOL} -f -w ip2xboot ${STAGEDIR}/${image}/ip2xboot $@.tmp
|
|
|
|
${SGIMIPS_SGIVOL} -f -w ip3xboot ${STAGEDIR}/${image}/ip3xboot $@.tmp
|
|
|
|
mv $@.tmp $@
|
|
|
|
rm -f $@.raw $@.tmp
|
2000-11-29 19:35:03 +03:00
|
|
|
.endif
|
|
|
|
@echo Rounding up to 32k boundary and padding 32k....
|
2007-12-07 21:35:21 +03:00
|
|
|
@size=$$(${TOOL_STAT} -f '%z' $@); \
|
|
|
|
pad=$$(( 32768 - ( $$size & 32767 ) )); \
|
|
|
|
[ $$pad = 32768 ] || \
|
|
|
|
dd if=/dev/zero bs=1 count=$$pad >>$@ 2>/dev/null
|
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
|
|
|
|
|
|
|
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}
|