xref: /freebsd/release/Makefile (revision 7f1006142521e92318e5ec9ab699625e21dc7302)
197d92980SPeter Wemm# $FreeBSD$
20202c140SRodney W. Grimes#
312ad0bb1SNathan Whitehorn# Makefile for building releases and release media.
4bd668f6fSPoul-Henning Kamp#
512ad0bb1SNathan Whitehorn# User-driven targets:
68cec99b6SGlen Barber#  cdrom: Builds release CD-ROM media (disc1.iso)
75d27274aSGlen Barber#  dvdrom: Builds release DVD-ROM media (dvd1.iso)
83c334738SGlen Barber#  memstick: Builds memory stick image (memstick.img)
9a9da1707SGlen Barber#  mini-memstick: Builds minimal memory stick image (mini-memstick.img)
1012ad0bb1SNathan Whitehorn#  ftp: Sets up FTP distribution area (ftp)
1112ad0bb1SNathan Whitehorn#  release: Build all media and FTP distribution area
12299a8b95SNathan Whitehorn#  install: Copies all release media into ${DESTDIR}
13bd668f6fSPoul-Henning Kamp#
1412ad0bb1SNathan Whitehorn# Variables affecting the build process:
1512ad0bb1SNathan Whitehorn#  WORLDDIR: location of src tree -- must have built world and default kernel
1612ad0bb1SNathan Whitehorn#            (by default, the directory above this one)
1712ad0bb1SNathan Whitehorn#  PORTSDIR: location of ports tree to distribute (default: /usr/ports)
1812ad0bb1SNathan Whitehorn#  DOCDIR:   location of doc tree (default: /usr/doc)
199d22cb2eSHiroki Sato#  NOPKG:    if set, do not distribute third-party packages
2012ad0bb1SNathan Whitehorn#  NOPORTS:  if set, do not distribute ports tree
2112ad0bb1SNathan Whitehorn#  NOSRC:    if set, do not distribute source tree
2212ad0bb1SNathan Whitehorn#  NODOC:    if set, do not generate release documentation
23f7f650c7SGlen Barber#  WITH_DVD: if set, generate dvd1.iso
2455af5cf1SGlen Barber#  WITH_COMPRESSED_IMAGES: if set, compress installation images with xz(1)
25cbc0e08aSGlen Barber#		(uncompressed images are not removed)
26a68d274bSGlen Barber#  WITH_VMIMAGES: if set, build virtual machine images with the release
27a9278c16SGlen Barber#  WITH_COMPRESSED_VMIMAGES: if set, compress virtual machine disk images
28a9278c16SGlen Barber#  		with xz(1) (extremely time consuming)
2912ad0bb1SNathan Whitehorn#  TARGET/TARGET_ARCH: architecture of built release
30b03ddec9SJohn Baldwin#
31ab0e9cdcSPoul-Henning Kamp
3212ad0bb1SNathan WhitehornWORLDDIR?=	${.CURDIR}/..
3312ad0bb1SNathan WhitehornPORTSDIR?=	/usr/ports
3412ad0bb1SNathan WhitehornDOCDIR?=	/usr/doc
3512ad0bb1SNathan WhitehornRELNOTES_LANG?= en_US.ISO8859-1
363b485e46SGlen BarberXZCMD?=		/usr/bin/xz
37fff8eb57SJohn Baldwin
38464485c8SHiroki Sato.if !defined(TARGET) || empty(TARGET)
39464485c8SHiroki SatoTARGET=		${MACHINE}
40464485c8SHiroki Sato.endif
41464485c8SHiroki Sato.if !defined(TARGET_ARCH) || empty(TARGET_ARCH)
420bd47e83SNathan Whitehorn.if ${TARGET} == ${MACHINE}
43464485c8SHiroki SatoTARGET_ARCH=	${MACHINE_ARCH}
448f1f55e9SRuslan Ermilov.else
45464485c8SHiroki SatoTARGET_ARCH=	${TARGET}
46464485c8SHiroki Sato.endif
478f1f55e9SRuslan Ermilov.endif
4812ad0bb1SNathan WhitehornIMAKE=		${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}
49876acefaSHiroki SatoDISTDIR=	dist
508f1f55e9SRuslan Ermilov
51de17cbccSHiroki Sato# Define OSRELEASE by using newvars.sh
52de17cbccSHiroki Sato.if !defined(OSRELEASE) || empty(OSRELEASE)
53de17cbccSHiroki Sato.for _V in TYPE BRANCH REVISION
54de17cbccSHiroki Sato${_V}!=	eval $$(awk '/^${_V}=/{print}' ${.CURDIR}/../sys/conf/newvers.sh); echo $$${_V}
55de17cbccSHiroki Sato.endfor
56de17cbccSHiroki Sato.for _V in ${TARGET_ARCH}
57de17cbccSHiroki Sato.if !empty(TARGET:M${_V})
58de17cbccSHiroki SatoOSRELEASE=	${TYPE}-${REVISION}-${BRANCH}-${TARGET}
59745ca085SGlen BarberVOLUME_LABEL=	${REVISION:C/[.-]/_/g}_${BRANCH:C/[.-]/_/g}_${TARGET}
60de17cbccSHiroki Sato.else
61de17cbccSHiroki SatoOSRELEASE=	${TYPE}-${REVISION}-${BRANCH}-${TARGET}-${TARGET_ARCH}
62745ca085SGlen BarberVOLUME_LABEL=	${REVISION:C/[.-]/_/g}_${BRANCH:C/[.-]/_/g}_${TARGET_ARCH}
63de17cbccSHiroki Sato.endif
64de17cbccSHiroki Sato.endfor
65de17cbccSHiroki Sato.endif
66de17cbccSHiroki Sato
6769c7d069SGlen Barber.if !defined(VOLUME_LABEL) || empty(VOLUME_LABEL)
6869c7d069SGlen BarberVOLUME_LABEL=	FreeBSD_Install
6969c7d069SGlen Barber.endif
70ac23f460SGlen Barber
7112ad0bb1SNathan Whitehorn.if !exists(${DOCDIR})
7212ad0bb1SNathan WhitehornNODOC= true
7312ad0bb1SNathan Whitehorn.endif
7412ad0bb1SNathan Whitehorn.if !exists(${PORTSDIR})
7512ad0bb1SNathan WhitehornNOPORTS= true
76dd1a1b3dSJoerg Wunsch.endif
77dd1a1b3dSJoerg Wunsch
7812ad0bb1SNathan WhitehornEXTRA_PACKAGES=
796daa108fSRuslan Ermilov.if !defined(NOPORTS)
8012ad0bb1SNathan WhitehornEXTRA_PACKAGES+= ports.txz
816daa108fSRuslan Ermilov.endif
824731faa3SJordan K. Hubbard.if !defined(NOSRC)
8312ad0bb1SNathan WhitehornEXTRA_PACKAGES+= src.txz
842e3a1557SKen Smith.endif
85a1b193b5SJohn Baldwin.if !defined(NODOC)
8612ad0bb1SNathan WhitehornEXTRA_PACKAGES+= reldoc
87b2200964SJohn Baldwin.endif
88b2200964SJohn Baldwin
8912ad0bb1SNathan WhitehornRELEASE_TARGETS= ftp
90876acefaSHiroki SatoIMAGES=
9112ad0bb1SNathan Whitehorn.if exists(${.CURDIR}/${TARGET}/mkisoimages.sh)
9212ad0bb1SNathan WhitehornRELEASE_TARGETS+= cdrom
938cec99b6SGlen BarberIMAGES+=	disc1.iso bootonly.iso
94d8824524SGlen Barber. if defined(WITH_DVD) && !empty(WITH_DVD)
95dc244562SGlen BarberRELEASE_TARGETS+= dvdrom
96dc244562SGlen BarberIMAGES+=	dvd1.iso
97dc244562SGlen Barber. endif
986daa108fSRuslan Ermilov.endif
9912ad0bb1SNathan Whitehorn.if exists(${.CURDIR}/${TARGET}/make-memstick.sh)
1003c334738SGlen BarberRELEASE_TARGETS+= memstick.img
101a9da1707SGlen BarberRELEASE_TARGETS+= mini-memstick.img
1023c334738SGlen BarberIMAGES+=	memstick.img
103a9da1707SGlen BarberIMAGES+=	mini-memstick.img
104e738d1eaSJohn Baldwin.endif
105e738d1eaSJohn Baldwin
106a68d274bSGlen BarberVMTARGETS=	vm-base vm-image
107a68d274bSGlen BarberVMFORMATS?=	vhd vmdk qcow2 raw
108cadb91b0SGlen BarberVMSIZE?=	20G
109cadb91b0SGlen BarberVMBASE?=	vm
1103991f309SGlen BarberAZURECONF?=	${.CURDIR}/tools/azure.conf
111a68d274bSGlen Barber
11246b13263SHiroki SatoCLEANFILES=	packagesystem *.txz MANIFEST system ${IMAGES}
1130c535991SGlen Barber.if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES)
1140c535991SGlen Barber. for I in ${IMAGES}
11555af5cf1SGlen BarberCLEANFILES+=	${I}.xz
1160c535991SGlen Barber. endfor
1170c535991SGlen Barber.endif
118cd15d7f3SGlen Barber.if defined(WITH_DVD) && !empty(WITH_DVD)
119cd15d7f3SGlen BarberCLEANFILES+=	pkg-stage
120cd15d7f3SGlen Barber.endif
121a68d274bSGlen Barber.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
122a68d274bSGlen BarberCLEANFILES+=	${VMBASE}.img
123a68d274bSGlen Barber. for FORMAT in ${VMFORMATS}
124c9250956SGlen BarberCLEANFILES+=	${VMBASE}.${FORMAT}
125a68d274bSGlen Barber. endfor
126a68d274bSGlen Barber.endif
12746b13263SHiroki SatoCLEANDIRS=	dist ftp release bootonly dvd
128a68d274bSGlen Barber.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
129a68d274bSGlen BarberCLEANDIRS+=	${VMTARGETS}
130a68d274bSGlen Barber.endif
1313991f309SGlen Barber.if exists(${.CURDIR}/${TARGET}/mk-azure.sh)
1323991f309SGlen BarberCLEANFILES+=	${OSRELEASE}.vhd \
1333991f309SGlen Barber		${OSRELEASE}.vhd.raw \
1343991f309SGlen Barber		azure.img
1353991f309SGlen BarberCLEANDIRS+=	vm-azure
1363991f309SGlen Barber.endif
13746b13263SHiroki Satobeforeclean:
13846b13263SHiroki Sato	chflags -R noschg .
1398eb4e096SRuslan Ermilov.include <bsd.obj.mk>
14046b13263SHiroki Satoclean: beforeclean
14112ad0bb1SNathan Whitehorn
14212ad0bb1SNathan Whitehornbase.txz:
143876acefaSHiroki Sato	mkdir -p ${DISTDIR}
144876acefaSHiroki Sato	cd ${WORLDDIR} && ${IMAKE} distributeworld DISTDIR=${.OBJDIR}/${DISTDIR}
14512ad0bb1SNathan Whitehorn# Set up mergemaster root database
146672d7ddbSSean Bruno	sh ${.CURDIR}/scripts/mm-mtree.sh -m ${WORLDDIR} -F \
147876acefaSHiroki Sato	    "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" -D "${.OBJDIR}/${DISTDIR}/base"
148e9120a25SGlen Barber	etcupdate extract -B -M "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" \
149d6d73d47SJohn Hay	    -s ${WORLDDIR} -d "${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate"
150bfc3bab8SNathan Whitehorn# Package all components
151876acefaSHiroki Sato	cd ${WORLDDIR} && ${IMAKE} packageworld DISTDIR=${.OBJDIR}/${DISTDIR}
152876acefaSHiroki Sato	mv ${DISTDIR}/*.txz .
15312ad0bb1SNathan Whitehorn
15412ad0bb1SNathan Whitehornkernel.txz:
155876acefaSHiroki Sato	mkdir -p ${DISTDIR}
156876acefaSHiroki Sato	cd ${WORLDDIR} && ${IMAKE} distributekernel packagekernel DISTDIR=${.OBJDIR}/${DISTDIR}
157876acefaSHiroki Sato	mv ${DISTDIR}/kernel*.txz .
15812ad0bb1SNathan Whitehorn
15912ad0bb1SNathan Whitehornsrc.txz:
160876acefaSHiroki Sato	mkdir -p ${DISTDIR}/usr
16112ad0bb1SNathan Whitehorn	ln -fs ${WORLDDIR} ${DISTDIR}/usr/src
1629f5907dbSGlen Barber	cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/src.txz --exclude .svn --exclude .zfs \
16323659c9dSGlen Barber	    --exclude .git --exclude @ --exclude usr/src/release/dist usr/src
16412ad0bb1SNathan Whitehorn
16512ad0bb1SNathan Whitehornports.txz:
166876acefaSHiroki Sato	mkdir -p ${DISTDIR}/usr
16712ad0bb1SNathan Whitehorn	ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports
16812ad0bb1SNathan Whitehorn	cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/ports.txz \
16923659c9dSGlen Barber	    --exclude .git --exclude .svn \
17012ad0bb1SNathan Whitehorn	    --exclude usr/ports/distfiles --exclude usr/ports/packages \
17112ad0bb1SNathan Whitehorn	    --exclude 'usr/ports/INDEX*' --exclude work usr/ports
17212ad0bb1SNathan Whitehorn
17312ad0bb1SNathan Whitehornreldoc:
17412ad0bb1SNathan Whitehorn	cd ${.CURDIR}/doc && ${MAKE} all install clean 'FORMATS=html txt' \
17512ad0bb1SNathan Whitehorn	    INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc
176876acefaSHiroki Sato	mkdir -p reldoc
17712ad0bb1SNathan Whitehorn.for i in hardware readme relnotes errata
17853089271STijl Coosemans	ln -f rdoc/${RELNOTES_LANG}/${i}/article.txt reldoc/${i:tu}.TXT
17953089271STijl Coosemans	ln -f rdoc/${RELNOTES_LANG}/${i}/article.html reldoc/${i:tu}.HTM
18012ad0bb1SNathan Whitehorn.endfor
181876acefaSHiroki Sato	cp rdoc/${RELNOTES_LANG}/readme/docbook.css reldoc
18212ad0bb1SNathan Whitehorn
18312ad0bb1SNathan Whitehornsystem: packagesystem
18412ad0bb1SNathan Whitehorn# Install system
185876acefaSHiroki Sato	mkdir -p release
1866e352319SNathan Whitehorn	cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \
187ba7bd912SGlen Barber		DESTDIR=${.OBJDIR}/release MK_RESCUE=no MK_KERNEL_SYMBOLS=no \
188ffc6fb79SGlen Barber		MK_PROFILE=no MK_SENDMAIL=no MK_TESTS=no MK_LIB32=no \
189ffc6fb79SGlen Barber		MK_DEBUG_FILES=no
19012ad0bb1SNathan Whitehorn# Copy distfiles
191876acefaSHiroki Sato	mkdir -p release/usr/freebsd-dist
192ffc6fb79SGlen Barber	for dist in MANIFEST $$(ls *.txz | grep -v -- '-dbg'); \
193ffc6fb79SGlen Barber	    do cp $${dist} release/usr/freebsd-dist; \
194ffc6fb79SGlen Barber	done
19512ad0bb1SNathan Whitehorn# Copy documentation, if generated
19612ad0bb1SNathan Whitehorn.if !defined(NODOC)
197876acefaSHiroki Sato	cp reldoc/* release
19812ad0bb1SNathan Whitehorn.endif
19912ad0bb1SNathan Whitehorn# Set up installation environment
200de17cbccSHiroki Sato	ln -fs /tmp/bsdinstall_etc/resolv.conf release/etc/resolv.conf
201876acefaSHiroki Sato	echo sendmail_enable=\"NONE\" > release/etc/rc.conf
202876acefaSHiroki Sato	echo hostid_enable=\"NO\" >> release/etc/rc.conf
20373e46dbaSGlen Barber	echo debug.witness.trace=0 >> release/etc/sysctl.conf
204*7f100614SGlen Barber	echo vfs.mountroot.timeout=\"10\" >> release/boot/loader.conf
205876acefaSHiroki Sato	cp ${.CURDIR}/rc.local release/etc
206876acefaSHiroki Sato	touch ${.TARGET}
20712ad0bb1SNathan Whitehorn
20846c413feSNathan Whitehornbootonly: packagesystem
20946c413feSNathan Whitehorn# Install system
210876acefaSHiroki Sato	mkdir -p bootonly
21146c413feSNathan Whitehorn	cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \
212ba7bd912SGlen Barber	    DESTDIR=${.OBJDIR}/bootonly MK_AMD=no MK_AT=no \
213ba7bd912SGlen Barber	    MK_GAMES=no MK_GROFF=no \
214ba7bd912SGlen Barber	    MK_INSTALLLIB=no MK_LIB32=no MK_MAIL=no \
215ba7bd912SGlen Barber	    MK_NCP=no MK_TOOLCHAIN=no MK_PROFILE=no \
216ba7bd912SGlen Barber	    MK_INSTALLIB=no MK_RESCUE=no MK_DICT=no \
217ffc6fb79SGlen Barber	    MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no
21846c413feSNathan Whitehorn# Copy manifest only (no distfiles) to get checksums
219876acefaSHiroki Sato	mkdir -p bootonly/usr/freebsd-dist
220876acefaSHiroki Sato	cp MANIFEST bootonly/usr/freebsd-dist
22146c413feSNathan Whitehorn# Copy documentation, if generated
22246c413feSNathan Whitehorn.if !defined(NODOC)
223876acefaSHiroki Sato	cp reldoc/* bootonly
22446c413feSNathan Whitehorn.endif
22546c413feSNathan Whitehorn# Set up installation environment
226de17cbccSHiroki Sato	ln -fs /tmp/bsdinstall_etc/resolv.conf bootonly/etc/resolv.conf
227876acefaSHiroki Sato	echo sendmail_enable=\"NONE\" > bootonly/etc/rc.conf
228876acefaSHiroki Sato	echo hostid_enable=\"NO\" >> bootonly/etc/rc.conf
22973e46dbaSGlen Barber	echo debug.witness.trace=0 >> bootonly/etc/sysctl.conf
230*7f100614SGlen Barber	echo vfs.mountroot.timeout=\"10\" >> bootonly/boot/loader.conf
231876acefaSHiroki Sato	cp ${.CURDIR}/rc.local bootonly/etc
23246c413feSNathan Whitehorn
233dc244562SGlen Barberdvd:
234dc244562SGlen Barber# Install system
235dc244562SGlen Barber	mkdir -p ${.TARGET}
236dc244562SGlen Barber	cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \
237ba7bd912SGlen Barber		DESTDIR=${.OBJDIR}/${.TARGET} MK_RESCUE=no MK_KERNEL_SYMBOLS=no \
238ffc6fb79SGlen Barber		MK_TESTS=no MK_DEBUG_FILES=no
239dc244562SGlen Barber# Copy distfiles
240dc244562SGlen Barber	mkdir -p ${.TARGET}/usr/freebsd-dist
241ffc6fb79SGlen Barber	for dist in MANIFEST $$(ls *.txz | grep -v -- '-dbg'); \
242ffc6fb79SGlen Barber	    do cp $${dist} ${.TARGET}/usr/freebsd-dist; \
243ffc6fb79SGlen Barber	done
244dc244562SGlen Barber# Copy documentation, if generated
245dc244562SGlen Barber.if !defined(NODOC)
246dc244562SGlen Barber	cp reldoc/* ${.TARGET}
247dc244562SGlen Barber.endif
248dc244562SGlen Barber# Set up installation environment
249dc244562SGlen Barber	ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf
250dc244562SGlen Barber	echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf
251dc244562SGlen Barber	echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf
25273e46dbaSGlen Barber	echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf
253*7f100614SGlen Barber	echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf
254dc244562SGlen Barber	cp ${.CURDIR}/rc.local ${.TARGET}/etc
255dc244562SGlen Barber	touch ${.TARGET}
256dc244562SGlen Barber
2578cec99b6SGlen Barberrelease.iso: disc1.iso
2588cec99b6SGlen Barberdisc1.iso: system
259ac23f460SGlen Barber	sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_CD ${.TARGET} release
26012ad0bb1SNathan Whitehorn
261dc244562SGlen Barberdvd1.iso: dvd pkg-stage
262ac23f460SGlen Barber	sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_DVD ${.TARGET} dvd
263dc244562SGlen Barber
26446c413feSNathan Whitehornbootonly.iso: bootonly
265ac23f460SGlen Barber	sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_BO ${.TARGET} bootonly
26646c413feSNathan Whitehorn
267cb95a96bSGlen Barbermemstick: memstick.img
2683c334738SGlen Barbermemstick.img: system
269876acefaSHiroki Sato	sh ${.CURDIR}/${TARGET}/make-memstick.sh release ${.TARGET}
27012ad0bb1SNathan Whitehorn
271a9da1707SGlen Barbermini-memstick: mini-memstick.img
272a9da1707SGlen Barbermini-memstick.img: system
273a9da1707SGlen Barber	sh ${.CURDIR}/${TARGET}/make-memstick.sh bootonly ${.TARGET}
274a9da1707SGlen Barber
27512ad0bb1SNathan Whitehornpackagesystem: base.txz kernel.txz ${EXTRA_PACKAGES}
276876acefaSHiroki Sato	sh ${.CURDIR}/scripts/make-manifest.sh *.txz > MANIFEST
277299a8b95SNathan Whitehorn	touch ${.TARGET}
27812ad0bb1SNathan Whitehorn
279dc244562SGlen Barberpkg-stage:
2806f50c4eaSGlen Barber.if !defined(NOPKG)
2816f50c4eaSGlen Barber	env REPOS_DIR=${.CURDIR}/pkg_repos/ \
2826f50c4eaSGlen Barber		sh ${.CURDIR}/scripts/pkg-stage.sh
2830d0e89b7SGlen Barber	mkdir -p ${.OBJDIR}/dvd/packages/repos/
2840d0e89b7SGlen Barber	cp ${.CURDIR}/scripts/FreeBSD_install_cdrom.conf \
2850d0e89b7SGlen Barber		${.OBJDIR}/dvd/packages/repos/
286dc244562SGlen Barber.endif
2870d0e89b7SGlen Barber	touch ${.TARGET}
288dc244562SGlen Barber
2898cec99b6SGlen Barbercdrom: disc1.iso bootonly.iso
290dc244562SGlen Barberdvdrom: dvd1.iso
29112ad0bb1SNathan Whitehornftp: packagesystem
292299a8b95SNathan Whitehorn	rm -rf ftp
293876acefaSHiroki Sato	mkdir -p ftp
294299a8b95SNathan Whitehorn	cp *.txz MANIFEST ftp
29512ad0bb1SNathan Whitehorn
2960bd47e83SNathan Whitehornrelease:
2970bd47e83SNathan Whitehorn	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj
2980bd47e83SNathan Whitehorn	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${RELEASE_TARGETS}
2994e187d25SGlen Barber.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
3004e187d25SGlen Barber	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${VMTARGETS}
3014e187d25SGlen Barber.endif
30212ad0bb1SNathan Whitehorn
303299a8b95SNathan Whitehorninstall:
304876acefaSHiroki Sato.if defined(DESTDIR) && !empty(DESTDIR)
305876acefaSHiroki Sato	mkdir -p ${DESTDIR}
306876acefaSHiroki Sato.endif
307de17cbccSHiroki Sato	cp -a ftp ${DESTDIR}/
308de17cbccSHiroki Sato.for I in ${IMAGES}
309de17cbccSHiroki Sato	cp -p ${I} ${DESTDIR}/${OSRELEASE}-${I}
310510f3303SGlen Barber. if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES)
3113b485e46SGlen Barber	${XZCMD} -k ${DESTDIR}/${OSRELEASE}-${I}
312cbc0e08aSGlen Barber. endif
313de17cbccSHiroki Sato.endfor
314de17cbccSHiroki Sato	cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256
315de17cbccSHiroki Sato	cd ${DESTDIR} && md5 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.MD5
316a68d274bSGlen Barber.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
317a68d274bSGlen Barber	mkdir -p ${DESTDIR}/vmimages
318a68d274bSGlen Barber. for FORMAT in ${VMFORMATS}
319a68d274bSGlen Barber	cp -p ${VMBASE}.${FORMAT} \
320a68d274bSGlen Barber		${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
321a68d274bSGlen Barber. endfor
322a9278c16SGlen Barber. if defined(WITH_COMPRESSED_VMIMAGES) && !empty(WITH_COMPRESSED_VMIMAGES)
323a68d274bSGlen Barber# This is very time consuming, so defer it after the images are moved to
324a68d274bSGlen Barber# the DESTDIR.
325a68d274bSGlen Barber.  for FORMAT in ${VMFORMATS}
326a68d274bSGlen Barber	# Don't keep the originals.  There is a copy in ${.OBJDIR} if needed.
327a68d274bSGlen Barber	${XZCMD} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
328a68d274bSGlen Barber.  endfor
329a68d274bSGlen Barber. endif
330a68d274bSGlen Barber	cd ${DESTDIR}/vmimages && sha256 ${OSRELEASE}* > \
331a68d274bSGlen Barber		${DESTDIR}/vmimages/CHECKSUM.SHA256
332a68d274bSGlen Barber	cd ${DESTDIR}/vmimages && md5 ${OSRELEASE}* > \
333a68d274bSGlen Barber		${DESTDIR}/vmimages/CHECKSUM.MD5
334a68d274bSGlen Barber.endif
335a68d274bSGlen Barber
336a68d274bSGlen Barbervm-base:
337a68d274bSGlen Barber.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
338a2950cc4SGlen Barber. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh)
3390bc9be5eSGlen Barber	env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
3400bc9be5eSGlen Barber		${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \
3410bc9be5eSGlen Barber		${VMBASE}.img ${WORLDDIR} ${.OBJDIR}/${.TARGET} ${VMSIZE}
342a68d274bSGlen Barber. endif
343a2950cc4SGlen Barber.endif
344a68d274bSGlen Barber	touch ${.TARGET}
345a68d274bSGlen Barber
346a68d274bSGlen Barbervm-image: vm-base
347a68d274bSGlen Barber.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
348a2950cc4SGlen Barber. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh)
349a68d274bSGlen Barber.  for FORMAT in ${VMFORMATS}
3500bc9be5eSGlen Barber	env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
3510bc9be5eSGlen Barber		${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \
3520bc9be5eSGlen Barber		${VMBASE}.img ${FORMAT} ${VMBASE}.${FORMAT}
353a68d274bSGlen Barber.  endfor
354a68d274bSGlen Barber. endif
355a2950cc4SGlen Barber.endif
356a68d274bSGlen Barber	touch ${.TARGET}
3573991f309SGlen Barber
3583991f309SGlen Barbervm-azure:
3593991f309SGlen Barber.if exists(${.CURDIR}/${TARGET}/mk-azure.sh)
3603991f309SGlen Barber	env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} AZURECONF=${AZURECONF} \
3613991f309SGlen Barber		${.CURDIR}/${TARGET}/mk-azure.sh ${.TARGET} azure.img \
3623991f309SGlen Barber		${WORLDDIR} ${.TARGET} ${VMSIZE} ${OSRELEASE}.vhd
3633991f309SGlen Barber.endif
3643991f309SGlen Barber	touch ${.TARGET}
365