xref: /freebsd/release/Makefile (revision a68d274b869a4f3698d4e2bfbcd2e5715500cc3c)
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)
26*a68d274bSGlen Barber#  WITH_VMIMAGES: if set, build virtual machine images with the release
2712ad0bb1SNathan Whitehorn#  TARGET/TARGET_ARCH: architecture of built release
28b03ddec9SJohn Baldwin#
29ab0e9cdcSPoul-Henning Kamp
3012ad0bb1SNathan WhitehornWORLDDIR?=	${.CURDIR}/..
3112ad0bb1SNathan WhitehornPORTSDIR?=	/usr/ports
3212ad0bb1SNathan WhitehornDOCDIR?=	/usr/doc
3312ad0bb1SNathan WhitehornRELNOTES_LANG?= en_US.ISO8859-1
343b485e46SGlen BarberXZCMD?=		/usr/bin/xz
35fff8eb57SJohn Baldwin
36464485c8SHiroki Sato.if !defined(TARGET) || empty(TARGET)
37464485c8SHiroki SatoTARGET=		${MACHINE}
38464485c8SHiroki Sato.endif
39464485c8SHiroki Sato.if !defined(TARGET_ARCH) || empty(TARGET_ARCH)
400bd47e83SNathan Whitehorn.if ${TARGET} == ${MACHINE}
41464485c8SHiroki SatoTARGET_ARCH=	${MACHINE_ARCH}
428f1f55e9SRuslan Ermilov.else
43464485c8SHiroki SatoTARGET_ARCH=	${TARGET}
44464485c8SHiroki Sato.endif
458f1f55e9SRuslan Ermilov.endif
4612ad0bb1SNathan WhitehornIMAKE=		${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}
47876acefaSHiroki SatoDISTDIR=	dist
488f1f55e9SRuslan Ermilov
49de17cbccSHiroki Sato# Define OSRELEASE by using newvars.sh
50de17cbccSHiroki Sato.if !defined(OSRELEASE) || empty(OSRELEASE)
51de17cbccSHiroki Sato.for _V in TYPE BRANCH REVISION
52de17cbccSHiroki Sato${_V}!=	eval $$(awk '/^${_V}=/{print}' ${.CURDIR}/../sys/conf/newvers.sh); echo $$${_V}
53de17cbccSHiroki Sato.endfor
54de17cbccSHiroki Sato.for _V in ${TARGET_ARCH}
55de17cbccSHiroki Sato.if !empty(TARGET:M${_V})
56de17cbccSHiroki SatoOSRELEASE=	${TYPE}-${REVISION}-${BRANCH}-${TARGET}
57de17cbccSHiroki Sato.else
58de17cbccSHiroki SatoOSRELEASE=	${TYPE}-${REVISION}-${BRANCH}-${TARGET}-${TARGET_ARCH}
59de17cbccSHiroki Sato.endif
60de17cbccSHiroki Sato.endfor
61de17cbccSHiroki Sato.endif
62de17cbccSHiroki Sato
6312ad0bb1SNathan Whitehorn.if !exists(${DOCDIR})
6412ad0bb1SNathan WhitehornNODOC= true
6512ad0bb1SNathan Whitehorn.endif
6612ad0bb1SNathan Whitehorn.if !exists(${PORTSDIR})
6712ad0bb1SNathan WhitehornNOPORTS= true
68dd1a1b3dSJoerg Wunsch.endif
69dd1a1b3dSJoerg Wunsch
7012ad0bb1SNathan WhitehornEXTRA_PACKAGES=
716daa108fSRuslan Ermilov.if !defined(NOPORTS)
7212ad0bb1SNathan WhitehornEXTRA_PACKAGES+= ports.txz
736daa108fSRuslan Ermilov.endif
744731faa3SJordan K. Hubbard.if !defined(NOSRC)
7512ad0bb1SNathan WhitehornEXTRA_PACKAGES+= src.txz
762e3a1557SKen Smith.endif
77a1b193b5SJohn Baldwin.if !defined(NODOC)
7812ad0bb1SNathan WhitehornEXTRA_PACKAGES+= reldoc
79b2200964SJohn Baldwin.endif
80b2200964SJohn Baldwin
8112ad0bb1SNathan WhitehornRELEASE_TARGETS= ftp
82876acefaSHiroki SatoIMAGES=
8312ad0bb1SNathan Whitehorn.if exists(${.CURDIR}/${TARGET}/mkisoimages.sh)
8412ad0bb1SNathan WhitehornRELEASE_TARGETS+= cdrom
858cec99b6SGlen BarberIMAGES+=	disc1.iso bootonly.iso
86d8824524SGlen Barber. if defined(WITH_DVD) && !empty(WITH_DVD)
87dc244562SGlen BarberRELEASE_TARGETS+= dvdrom
88dc244562SGlen BarberIMAGES+=	dvd1.iso
89dc244562SGlen Barber. endif
906daa108fSRuslan Ermilov.endif
9112ad0bb1SNathan Whitehorn.if exists(${.CURDIR}/${TARGET}/make-memstick.sh)
923c334738SGlen BarberRELEASE_TARGETS+= memstick.img
93a9da1707SGlen BarberRELEASE_TARGETS+= mini-memstick.img
943c334738SGlen BarberIMAGES+=	memstick.img
95a9da1707SGlen BarberIMAGES+=	mini-memstick.img
96e738d1eaSJohn Baldwin.endif
97e738d1eaSJohn Baldwin
98*a68d274bSGlen BarberVMTARGETS=	vm-base vm-image
99*a68d274bSGlen BarberVMFORMATS?=	vhd vmdk qcow2 raw
100*a68d274bSGlen BarberVMSIZE?=	20G		# size in Gb
101*a68d274bSGlen BarberVMBASE?=	vm		# name of the filesystem image
102*a68d274bSGlen Barber
10346b13263SHiroki SatoCLEANFILES=	packagesystem *.txz MANIFEST system ${IMAGES}
1040c535991SGlen Barber.if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES)
1050c535991SGlen Barber. for I in ${IMAGES}
10655af5cf1SGlen BarberCLEANFILES+=	${I}.xz
1070c535991SGlen Barber. endfor
1080c535991SGlen Barber.endif
109cd15d7f3SGlen Barber.if defined(WITH_DVD) && !empty(WITH_DVD)
110cd15d7f3SGlen BarberCLEANFILES+=	pkg-stage
111cd15d7f3SGlen Barber.endif
112*a68d274bSGlen Barber.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
113*a68d274bSGlen BarberCLEANFILES+=	${VMBASE}.img
114*a68d274bSGlen Barber. for FORMAT in ${VMFORMATS}
115*a68d274bSGlen BarberCLEANFILES+=	vm.${FORMAT}
116*a68d274bSGlen Barber. endfor
117*a68d274bSGlen Barber.endif
11846b13263SHiroki SatoCLEANDIRS=	dist ftp release bootonly dvd
119*a68d274bSGlen Barber.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
120*a68d274bSGlen BarberCLEANDIRS+=	${VMTARGETS}
121*a68d274bSGlen Barber.endif
12246b13263SHiroki Satobeforeclean:
12346b13263SHiroki Sato	chflags -R noschg .
1248eb4e096SRuslan Ermilov.include <bsd.obj.mk>
12546b13263SHiroki Satoclean: beforeclean
12612ad0bb1SNathan Whitehorn
12712ad0bb1SNathan Whitehornbase.txz:
128876acefaSHiroki Sato	mkdir -p ${DISTDIR}
129876acefaSHiroki Sato	cd ${WORLDDIR} && ${IMAKE} distributeworld DISTDIR=${.OBJDIR}/${DISTDIR}
13012ad0bb1SNathan Whitehorn# Set up mergemaster root database
131672d7ddbSSean Bruno	sh ${.CURDIR}/scripts/mm-mtree.sh -m ${WORLDDIR} -F \
132876acefaSHiroki Sato	    "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" -D "${.OBJDIR}/${DISTDIR}/base"
133e9120a25SGlen Barber	etcupdate extract -B -M "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" \
134d6d73d47SJohn Hay	    -s ${WORLDDIR} -d "${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate"
135bfc3bab8SNathan Whitehorn# Package all components
136876acefaSHiroki Sato	cd ${WORLDDIR} && ${IMAKE} packageworld DISTDIR=${.OBJDIR}/${DISTDIR}
137876acefaSHiroki Sato	mv ${DISTDIR}/*.txz .
13812ad0bb1SNathan Whitehorn
13912ad0bb1SNathan Whitehornkernel.txz:
140876acefaSHiroki Sato	mkdir -p ${DISTDIR}
141876acefaSHiroki Sato	cd ${WORLDDIR} && ${IMAKE} distributekernel packagekernel DISTDIR=${.OBJDIR}/${DISTDIR}
142876acefaSHiroki Sato	mv ${DISTDIR}/kernel*.txz .
14312ad0bb1SNathan Whitehorn
14412ad0bb1SNathan Whitehornsrc.txz:
145876acefaSHiroki Sato	mkdir -p ${DISTDIR}/usr
14612ad0bb1SNathan Whitehorn	ln -fs ${WORLDDIR} ${DISTDIR}/usr/src
1479f5907dbSGlen Barber	cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/src.txz --exclude .svn --exclude .zfs \
14823659c9dSGlen Barber	    --exclude .git --exclude @ --exclude usr/src/release/dist usr/src
14912ad0bb1SNathan Whitehorn
15012ad0bb1SNathan Whitehornports.txz:
151876acefaSHiroki Sato	mkdir -p ${DISTDIR}/usr
15212ad0bb1SNathan Whitehorn	ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports
15312ad0bb1SNathan Whitehorn	cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/ports.txz \
15423659c9dSGlen Barber	    --exclude .git --exclude .svn \
15512ad0bb1SNathan Whitehorn	    --exclude usr/ports/distfiles --exclude usr/ports/packages \
15612ad0bb1SNathan Whitehorn	    --exclude 'usr/ports/INDEX*' --exclude work usr/ports
15712ad0bb1SNathan Whitehorn
15812ad0bb1SNathan Whitehornreldoc:
15912ad0bb1SNathan Whitehorn	cd ${.CURDIR}/doc && ${MAKE} all install clean 'FORMATS=html txt' \
16012ad0bb1SNathan Whitehorn	    INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc
161876acefaSHiroki Sato	mkdir -p reldoc
16212ad0bb1SNathan Whitehorn.for i in hardware readme relnotes errata
16353089271STijl Coosemans	ln -f rdoc/${RELNOTES_LANG}/${i}/article.txt reldoc/${i:tu}.TXT
16453089271STijl Coosemans	ln -f rdoc/${RELNOTES_LANG}/${i}/article.html reldoc/${i:tu}.HTM
16512ad0bb1SNathan Whitehorn.endfor
166876acefaSHiroki Sato	cp rdoc/${RELNOTES_LANG}/readme/docbook.css reldoc
16712ad0bb1SNathan Whitehorn
16812ad0bb1SNathan Whitehornsystem: packagesystem
16912ad0bb1SNathan Whitehorn# Install system
170876acefaSHiroki Sato	mkdir -p release
1716e352319SNathan Whitehorn	cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \
172ba7bd912SGlen Barber		DESTDIR=${.OBJDIR}/release MK_RESCUE=no MK_KERNEL_SYMBOLS=no \
173ffc6fb79SGlen Barber		MK_PROFILE=no MK_SENDMAIL=no MK_TESTS=no MK_LIB32=no \
174ffc6fb79SGlen Barber		MK_DEBUG_FILES=no
17512ad0bb1SNathan Whitehorn# Copy distfiles
176876acefaSHiroki Sato	mkdir -p release/usr/freebsd-dist
177ffc6fb79SGlen Barber	for dist in MANIFEST $$(ls *.txz | grep -v -- '-dbg'); \
178ffc6fb79SGlen Barber	    do cp $${dist} release/usr/freebsd-dist; \
179ffc6fb79SGlen Barber	done
18012ad0bb1SNathan Whitehorn# Copy documentation, if generated
18112ad0bb1SNathan Whitehorn.if !defined(NODOC)
182876acefaSHiroki Sato	cp reldoc/* release
18312ad0bb1SNathan Whitehorn.endif
18412ad0bb1SNathan Whitehorn# Set up installation environment
185de17cbccSHiroki Sato	ln -fs /tmp/bsdinstall_etc/resolv.conf release/etc/resolv.conf
186876acefaSHiroki Sato	echo sendmail_enable=\"NONE\" > release/etc/rc.conf
187876acefaSHiroki Sato	echo hostid_enable=\"NO\" >> release/etc/rc.conf
18873e46dbaSGlen Barber	echo debug.witness.trace=0 >> release/etc/sysctl.conf
189876acefaSHiroki Sato	cp ${.CURDIR}/rc.local release/etc
190876acefaSHiroki Sato	touch ${.TARGET}
19112ad0bb1SNathan Whitehorn
19246c413feSNathan Whitehornbootonly: packagesystem
19346c413feSNathan Whitehorn# Install system
194876acefaSHiroki Sato	mkdir -p bootonly
19546c413feSNathan Whitehorn	cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \
196ba7bd912SGlen Barber	    DESTDIR=${.OBJDIR}/bootonly MK_AMD=no MK_AT=no \
197ba7bd912SGlen Barber	    MK_GAMES=no MK_GROFF=no \
198ba7bd912SGlen Barber	    MK_INSTALLLIB=no MK_LIB32=no MK_MAIL=no \
199ba7bd912SGlen Barber	    MK_NCP=no MK_TOOLCHAIN=no MK_PROFILE=no \
200ba7bd912SGlen Barber	    MK_INSTALLIB=no MK_RESCUE=no MK_DICT=no \
201ffc6fb79SGlen Barber	    MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no
20246c413feSNathan Whitehorn# Copy manifest only (no distfiles) to get checksums
203876acefaSHiroki Sato	mkdir -p bootonly/usr/freebsd-dist
204876acefaSHiroki Sato	cp MANIFEST bootonly/usr/freebsd-dist
20546c413feSNathan Whitehorn# Copy documentation, if generated
20646c413feSNathan Whitehorn.if !defined(NODOC)
207876acefaSHiroki Sato	cp reldoc/* bootonly
20846c413feSNathan Whitehorn.endif
20946c413feSNathan Whitehorn# Set up installation environment
210de17cbccSHiroki Sato	ln -fs /tmp/bsdinstall_etc/resolv.conf bootonly/etc/resolv.conf
211876acefaSHiroki Sato	echo sendmail_enable=\"NONE\" > bootonly/etc/rc.conf
212876acefaSHiroki Sato	echo hostid_enable=\"NO\" >> bootonly/etc/rc.conf
21373e46dbaSGlen Barber	echo debug.witness.trace=0 >> bootonly/etc/sysctl.conf
214876acefaSHiroki Sato	cp ${.CURDIR}/rc.local bootonly/etc
21546c413feSNathan Whitehorn
216dc244562SGlen Barberdvd:
217dc244562SGlen Barber# Install system
218dc244562SGlen Barber	mkdir -p ${.TARGET}
219dc244562SGlen Barber	cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \
220ba7bd912SGlen Barber		DESTDIR=${.OBJDIR}/${.TARGET} MK_RESCUE=no MK_KERNEL_SYMBOLS=no \
221ffc6fb79SGlen Barber		MK_TESTS=no MK_DEBUG_FILES=no
222dc244562SGlen Barber# Copy distfiles
223dc244562SGlen Barber	mkdir -p ${.TARGET}/usr/freebsd-dist
224ffc6fb79SGlen Barber	for dist in MANIFEST $$(ls *.txz | grep -v -- '-dbg'); \
225ffc6fb79SGlen Barber	    do cp $${dist} ${.TARGET}/usr/freebsd-dist; \
226ffc6fb79SGlen Barber	done
227dc244562SGlen Barber# Copy documentation, if generated
228dc244562SGlen Barber.if !defined(NODOC)
229dc244562SGlen Barber	cp reldoc/* ${.TARGET}
230dc244562SGlen Barber.endif
231dc244562SGlen Barber# Set up installation environment
232dc244562SGlen Barber	ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf
233dc244562SGlen Barber	echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf
234dc244562SGlen Barber	echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf
23573e46dbaSGlen Barber	echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf
236dc244562SGlen Barber	cp ${.CURDIR}/rc.local ${.TARGET}/etc
237dc244562SGlen Barber	touch ${.TARGET}
238dc244562SGlen Barber
2398cec99b6SGlen Barberrelease.iso: disc1.iso
2408cec99b6SGlen Barberdisc1.iso: system
241876acefaSHiroki Sato	sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.TARGET} release
24212ad0bb1SNathan Whitehorn
243dc244562SGlen Barberdvd1.iso: dvd pkg-stage
244dc244562SGlen Barber	sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.TARGET} dvd
245dc244562SGlen Barber
24646c413feSNathan Whitehornbootonly.iso: bootonly
247876acefaSHiroki Sato	sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.TARGET} bootonly
24846c413feSNathan Whitehorn
249cb95a96bSGlen Barbermemstick: memstick.img
2503c334738SGlen Barbermemstick.img: system
251876acefaSHiroki Sato	sh ${.CURDIR}/${TARGET}/make-memstick.sh release ${.TARGET}
25212ad0bb1SNathan Whitehorn
253a9da1707SGlen Barbermini-memstick: mini-memstick.img
254a9da1707SGlen Barbermini-memstick.img: system
255a9da1707SGlen Barber	sh ${.CURDIR}/${TARGET}/make-memstick.sh bootonly ${.TARGET}
256a9da1707SGlen Barber
25712ad0bb1SNathan Whitehornpackagesystem: base.txz kernel.txz ${EXTRA_PACKAGES}
258876acefaSHiroki Sato	sh ${.CURDIR}/scripts/make-manifest.sh *.txz > MANIFEST
259299a8b95SNathan Whitehorn	touch ${.TARGET}
26012ad0bb1SNathan Whitehorn
261dc244562SGlen Barberpkg-stage:
2626f50c4eaSGlen Barber.if !defined(NOPKG)
2636f50c4eaSGlen Barber	env REPOS_DIR=${.CURDIR}/pkg_repos/ \
2646f50c4eaSGlen Barber		sh ${.CURDIR}/scripts/pkg-stage.sh
2650d0e89b7SGlen Barber	mkdir -p ${.OBJDIR}/dvd/packages/repos/
2660d0e89b7SGlen Barber	cp ${.CURDIR}/scripts/FreeBSD_install_cdrom.conf \
2670d0e89b7SGlen Barber		${.OBJDIR}/dvd/packages/repos/
268dc244562SGlen Barber.endif
2690d0e89b7SGlen Barber	touch ${.TARGET}
270dc244562SGlen Barber
2718cec99b6SGlen Barbercdrom: disc1.iso bootonly.iso
272dc244562SGlen Barberdvdrom: dvd1.iso
27312ad0bb1SNathan Whitehornftp: packagesystem
274299a8b95SNathan Whitehorn	rm -rf ftp
275876acefaSHiroki Sato	mkdir -p ftp
276299a8b95SNathan Whitehorn	cp *.txz MANIFEST ftp
27712ad0bb1SNathan Whitehorn
2780bd47e83SNathan Whitehornrelease:
2790bd47e83SNathan Whitehorn	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj
2800bd47e83SNathan Whitehorn	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${RELEASE_TARGETS}
28112ad0bb1SNathan Whitehorn
282299a8b95SNathan Whitehorninstall:
283876acefaSHiroki Sato.if defined(DESTDIR) && !empty(DESTDIR)
284876acefaSHiroki Sato	mkdir -p ${DESTDIR}
285876acefaSHiroki Sato.endif
286de17cbccSHiroki Sato	cp -a ftp ${DESTDIR}/
287de17cbccSHiroki Sato.for I in ${IMAGES}
288de17cbccSHiroki Sato	cp -p ${I} ${DESTDIR}/${OSRELEASE}-${I}
289510f3303SGlen Barber. if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES)
2903b485e46SGlen Barber	${XZCMD} -k ${DESTDIR}/${OSRELEASE}-${I}
291cbc0e08aSGlen Barber. endif
292de17cbccSHiroki Sato.endfor
293de17cbccSHiroki Sato	cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256
294de17cbccSHiroki Sato	cd ${DESTDIR} && md5 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.MD5
295*a68d274bSGlen Barber.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
296*a68d274bSGlen Barber	mkdir -p ${DESTDIR}/vmimages
297*a68d274bSGlen Barber. for FORMAT in ${VMFORMATS}
298*a68d274bSGlen Barber	cp -p ${VMBASE}.${FORMAT} \
299*a68d274bSGlen Barber		${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
300*a68d274bSGlen Barber. endfor
301*a68d274bSGlen Barber. if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES)
302*a68d274bSGlen Barber# This is very time consuming, so defer it after the images are moved to
303*a68d274bSGlen Barber# the DESTDIR.
304*a68d274bSGlen Barber.  for FORMAT in ${VMFORMATS}
305*a68d274bSGlen Barber	# Don't keep the originals.  There is a copy in ${.OBJDIR} if needed.
306*a68d274bSGlen Barber	${XZCMD} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
307*a68d274bSGlen Barber.  endfor
308*a68d274bSGlen Barber. endif
309*a68d274bSGlen Barber	cd ${DESTDIR}/vmimages && sha256 ${OSRELEASE}* > \
310*a68d274bSGlen Barber		${DESTDIR}/vmimages/CHECKSUM.SHA256
311*a68d274bSGlen Barber	cd ${DESTDIR}/vmimages && md5 ${OSRELEASE}* > \
312*a68d274bSGlen Barber		${DESTDIR}/vmimages/CHECKSUM.MD5
313*a68d274bSGlen Barber.endif
314*a68d274bSGlen Barber
315*a68d274bSGlen Barbervm-base:
316*a68d274bSGlen Barber.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
317*a68d274bSGlen Barber	env IMAKE=${IMAKE} WORLDDIR=${WORLDDIR} \
318*a68d274bSGlen Barber		VMBASE=${VMBASE}.img VMSIZE=${VMSIZE} DESTDIR=${.TARGET} \
319*a68d274bSGlen Barber		TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
320*a68d274bSGlen Barber		${.CURDIR}/scripts/mk-vmimage.sh ${.TARGET}
321*a68d274bSGlen Barber.endif
322*a68d274bSGlen Barber	touch ${.TARGET}
323*a68d274bSGlen Barber
324*a68d274bSGlen Barbervm-image: vm-base
325*a68d274bSGlen Barber.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
326*a68d274bSGlen Barber. for FORMAT in ${VMFORMATS}
327*a68d274bSGlen Barber	env FORMAT=${FORMAT} VMIMAGE=${VMBASE}.${FORMAT} VMBASE=${VMBASE}.img \
328*a68d274bSGlen Barber		TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
329*a68d274bSGlen Barber		${.CURDIR}/scripts/mk-vmimage.sh ${.TARGET}
330*a68d274bSGlen Barber. endfor
331*a68d274bSGlen Barber.endif
332*a68d274bSGlen Barber	touch ${.TARGET}
333