xref: /freebsd/release/Makefile (revision e9ba25aabf6932646ddf0eb2144f40003349d921)
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)
114afe7cf5SGlen Barber#  release: Invokes real-release, vm-release, and cloudware-release targets
124afe7cf5SGlen Barber#  real-release: Build all media and FTP distribution area
134afe7cf5SGlen Barber#  vm-release: Build all virtual machine image targets
144afe7cf5SGlen Barber#  cloudware-release: Build all cloud hosting provider targets
152d4ff62fSGlen Barber#  install: Invokes the release-install and vm-install targets
162d4ff62fSGlen Barber#  release-install: Copies all release installation media into ${DESTDIR}
172d4ff62fSGlen Barber#  vm-install: Copies all virtual machine images into ${DESTDIR}
18bd668f6fSPoul-Henning Kamp#
1912ad0bb1SNathan Whitehorn# Variables affecting the build process:
2012ad0bb1SNathan Whitehorn#  WORLDDIR: location of src tree -- must have built world and default kernel
2112ad0bb1SNathan Whitehorn#            (by default, the directory above this one)
2212ad0bb1SNathan Whitehorn#  PORTSDIR: location of ports tree to distribute (default: /usr/ports)
231b8a3e1dSDevin Teske#  XTRADIR:  xtra-bits-dir argument for <arch>/mkisoimages.sh
249d22cb2eSHiroki Sato#  NOPKG:    if set, do not distribute third-party packages
2512ad0bb1SNathan Whitehorn#  NOPORTS:  if set, do not distribute ports tree
2612ad0bb1SNathan Whitehorn#  NOSRC:    if set, do not distribute source tree
27f7f650c7SGlen Barber#  WITH_DVD: if set, generate dvd1.iso
2855af5cf1SGlen Barber#  WITH_COMPRESSED_IMAGES: if set, compress installation images with xz(1)
29cbc0e08aSGlen Barber#		(uncompressed images are not removed)
30a68d274bSGlen Barber#  WITH_VMIMAGES: if set, build virtual machine images with the release
31a9278c16SGlen Barber#  WITH_COMPRESSED_VMIMAGES: if set, compress virtual machine disk images
32a9278c16SGlen Barber#  		with xz(1) (extremely time consuming)
332d4ff62fSGlen Barber#  WITH_CLOUDWARE: if set, build cloud hosting disk images with the release
3412ad0bb1SNathan Whitehorn#  TARGET/TARGET_ARCH: architecture of built release
35b03ddec9SJohn Baldwin#
36ab0e9cdcSPoul-Henning Kamp
3712ad0bb1SNathan WhitehornWORLDDIR?=	${.CURDIR}/..
3812ad0bb1SNathan WhitehornPORTSDIR?=	/usr/ports
39fff8eb57SJohn Baldwin
40464485c8SHiroki Sato.if !defined(TARGET) || empty(TARGET)
41464485c8SHiroki SatoTARGET=		${MACHINE}
42464485c8SHiroki Sato.endif
43464485c8SHiroki Sato.if !defined(TARGET_ARCH) || empty(TARGET_ARCH)
440bd47e83SNathan Whitehorn.if ${TARGET} == ${MACHINE}
45464485c8SHiroki SatoTARGET_ARCH=	${MACHINE_ARCH}
468f1f55e9SRuslan Ermilov.else
47464485c8SHiroki SatoTARGET_ARCH=	${TARGET}
48464485c8SHiroki Sato.endif
498f1f55e9SRuslan Ermilov.endif
5012ad0bb1SNathan WhitehornIMAKE=		${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}
51876acefaSHiroki SatoDISTDIR=	dist
528f1f55e9SRuslan Ermilov
5308f1325dSGlen Barber# Define OSRELEASE by using newvers.sh
54de17cbccSHiroki Sato.if !defined(OSRELEASE) || empty(OSRELEASE)
55de17cbccSHiroki Sato.for _V in TYPE BRANCH REVISION
56de17cbccSHiroki Sato${_V}!=	eval $$(awk '/^${_V}=/{print}' ${.CURDIR}/../sys/conf/newvers.sh); echo $$${_V}
57de17cbccSHiroki Sato.endfor
58de17cbccSHiroki Sato.for _V in ${TARGET_ARCH}
59de17cbccSHiroki Sato.if !empty(TARGET:M${_V})
60de17cbccSHiroki SatoOSRELEASE=	${TYPE}-${REVISION}-${BRANCH}-${TARGET}
61745ca085SGlen BarberVOLUME_LABEL=	${REVISION:C/[.-]/_/g}_${BRANCH:C/[.-]/_/g}_${TARGET}
62de17cbccSHiroki Sato.else
63de17cbccSHiroki SatoOSRELEASE=	${TYPE}-${REVISION}-${BRANCH}-${TARGET}-${TARGET_ARCH}
64745ca085SGlen BarberVOLUME_LABEL=	${REVISION:C/[.-]/_/g}_${BRANCH:C/[.-]/_/g}_${TARGET_ARCH}
65de17cbccSHiroki Sato.endif
66de17cbccSHiroki Sato.endfor
67de17cbccSHiroki Sato.endif
68de17cbccSHiroki Sato
6969c7d069SGlen Barber.if !defined(VOLUME_LABEL) || empty(VOLUME_LABEL)
7069c7d069SGlen BarberVOLUME_LABEL=	FreeBSD_Install
7169c7d069SGlen Barber.endif
72ac23f460SGlen Barber
7312ad0bb1SNathan Whitehorn.if !exists(${PORTSDIR})
7412ad0bb1SNathan WhitehornNOPORTS= true
75dd1a1b3dSJoerg Wunsch.endif
76dd1a1b3dSJoerg Wunsch
7712ad0bb1SNathan WhitehornEXTRA_PACKAGES=
786daa108fSRuslan Ermilov.if !defined(NOPORTS)
7912ad0bb1SNathan WhitehornEXTRA_PACKAGES+= ports.txz
806daa108fSRuslan Ermilov.endif
814731faa3SJordan K. Hubbard.if !defined(NOSRC)
8212ad0bb1SNathan WhitehornEXTRA_PACKAGES+= src.txz
832e3a1557SKen Smith.endif
84b2200964SJohn Baldwin
8512ad0bb1SNathan WhitehornRELEASE_TARGETS= ftp
86876acefaSHiroki SatoIMAGES=
8712ad0bb1SNathan Whitehorn.if exists(${.CURDIR}/${TARGET}/mkisoimages.sh)
8812ad0bb1SNathan WhitehornRELEASE_TARGETS+= cdrom
898cec99b6SGlen BarberIMAGES+=	disc1.iso bootonly.iso
90d8824524SGlen Barber. if defined(WITH_DVD) && !empty(WITH_DVD)
91dc244562SGlen BarberRELEASE_TARGETS+= dvdrom
92dc244562SGlen BarberIMAGES+=	dvd1.iso
93dc244562SGlen Barber. endif
946daa108fSRuslan Ermilov.endif
9512ad0bb1SNathan Whitehorn.if exists(${.CURDIR}/${TARGET}/make-memstick.sh)
963c334738SGlen BarberRELEASE_TARGETS+= memstick.img
97a9da1707SGlen BarberRELEASE_TARGETS+= mini-memstick.img
983c334738SGlen BarberIMAGES+=	memstick.img
99a9da1707SGlen BarberIMAGES+=	mini-memstick.img
100e738d1eaSJohn Baldwin.endif
101e738d1eaSJohn Baldwin
102a55e34ebSGlen BarberCLEANFILES=	packagesystem *.txz MANIFEST release ${IMAGES}
1030c535991SGlen Barber.if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES)
1040c535991SGlen Barber. for I in ${IMAGES}
10555af5cf1SGlen BarberCLEANFILES+=	${I}.xz
1060c535991SGlen Barber. endfor
1070c535991SGlen Barber.endif
108cd15d7f3SGlen Barber.if defined(WITH_DVD) && !empty(WITH_DVD)
109cd15d7f3SGlen BarberCLEANFILES+=	pkg-stage
110cd15d7f3SGlen Barber.endif
111a55e34ebSGlen BarberCLEANDIRS=	dist ftp disc1 bootonly dvd
11246b13263SHiroki Satobeforeclean:
11346b13263SHiroki Sato	chflags -R noschg .
1148eb4e096SRuslan Ermilov.include <bsd.obj.mk>
11546b13263SHiroki Satoclean: beforeclean
11612ad0bb1SNathan Whitehorn
11712ad0bb1SNathan Whitehornbase.txz:
118876acefaSHiroki Sato	mkdir -p ${DISTDIR}
119876acefaSHiroki Sato	cd ${WORLDDIR} && ${IMAKE} distributeworld DISTDIR=${.OBJDIR}/${DISTDIR}
12013cb0041SJessica Clarke# TODO: Add NO_ROOT mode to mm-tree.sh and etcupdate
12113cb0041SJessica Clarke.if !defined(NO_ROOT)
12212ad0bb1SNathan Whitehorn# Set up mergemaster root database
123672d7ddbSSean Bruno	sh ${.CURDIR}/scripts/mm-mtree.sh -m ${WORLDDIR} -F \
12454a03abbSBryan Drewery	    "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} ${.MAKE.JOBS:D-j${.MAKE.JOBS}}" \
12554a03abbSBryan Drewery	    -D "${.OBJDIR}/${DISTDIR}/base"
126*e9ba25aaSJessica Clarke	sh ${WORLDDIR}/usr.sbin/etcupdate/etcupdate.sh extract -B \
127*e9ba25aaSJessica Clarke	    -M "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" \
128d6d73d47SJohn Hay	    -s ${WORLDDIR} -d "${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate"
12913cb0041SJessica Clarke.endif
130bfc3bab8SNathan Whitehorn# Package all components
131876acefaSHiroki Sato	cd ${WORLDDIR} && ${IMAKE} packageworld DISTDIR=${.OBJDIR}/${DISTDIR}
132876acefaSHiroki Sato	mv ${DISTDIR}/*.txz .
13312ad0bb1SNathan Whitehorn
13412ad0bb1SNathan Whitehornkernel.txz:
135876acefaSHiroki Sato	mkdir -p ${DISTDIR}
136876acefaSHiroki Sato	cd ${WORLDDIR} && ${IMAKE} distributekernel packagekernel DISTDIR=${.OBJDIR}/${DISTDIR}
137876acefaSHiroki Sato	mv ${DISTDIR}/kernel*.txz .
13812ad0bb1SNathan Whitehorn
13912ad0bb1SNathan Whitehornsrc.txz:
140876acefaSHiroki Sato	mkdir -p ${DISTDIR}/usr
14112ad0bb1SNathan Whitehorn	ln -fs ${WORLDDIR} ${DISTDIR}/usr/src
142fcf12081SJessica Clarke	cd ${DISTDIR} && ${TAR_CMD} cLvf - --exclude .svn --exclude .zfs \
143bd9cab6fSRui Paulo	    --exclude .git --exclude @ --exclude usr/src/release/dist usr/src | \
144bd9cab6fSRui Paulo	    ${XZ_CMD} > ${.OBJDIR}/src.txz
14512ad0bb1SNathan Whitehorn
14612ad0bb1SNathan Whitehornports.txz:
147876acefaSHiroki Sato	mkdir -p ${DISTDIR}/usr
14812ad0bb1SNathan Whitehorn	ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports
149fcf12081SJessica Clarke	cd ${DISTDIR} && ${TAR_CMD} cLvf - \
15023659c9dSGlen Barber	    --exclude .git --exclude .svn \
15112ad0bb1SNathan Whitehorn	    --exclude usr/ports/distfiles --exclude usr/ports/packages \
152bd9cab6fSRui Paulo	    --exclude 'usr/ports/INDEX*' --exclude work usr/ports | \
153bd9cab6fSRui Paulo	    ${XZ_CMD} > ${.OBJDIR}/ports.txz
15412ad0bb1SNathan Whitehorn
155a55e34ebSGlen Barberdisc1: packagesystem
15612ad0bb1SNathan Whitehorn# Install system
157a55e34ebSGlen Barber	mkdir -p ${.TARGET}
1584bbfa3d3SEd Maste	cd ${WORLDDIR} && ${IMAKE} installworld installkernel distribution \
15913f7dbe8SEd Maste	    DESTDIR=${.OBJDIR}/${.TARGET} MK_AT=no \
1604c0ef5dbSNathan Whitehorn	    MK_INSTALLLIB=no MK_LIB32=no MK_MAIL=no \
161eacff37aSEd Maste	    MK_TOOLCHAIN=no MK_PROFILE=no \
1624c0ef5dbSNathan Whitehorn	    MK_RESCUE=no MK_DICT=no \
1632502c66bSRoger Pau Monné	    MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no \
1642502c66bSRoger Pau Monné	    -DDB_FROM_SRC
16512ad0bb1SNathan Whitehorn# Copy distfiles
166a55e34ebSGlen Barber	mkdir -p ${.TARGET}/usr/freebsd-dist
16788343186SGlen Barber	for dist in MANIFEST $$(ls *.txz | grep -vE -- '(base|lib32)-dbg'); \
168a55e34ebSGlen Barber	    do cp $${dist} ${.TARGET}/usr/freebsd-dist; \
169ffc6fb79SGlen Barber	done
17013cb0041SJessica Clarke.if defined(NO_ROOT)
17113cb0041SJessica Clarke	echo "./usr/freebsd-dist type=dir uname=root gname=wheel mode=0755" >> ${.TARGET}/METALOG
17213cb0041SJessica Clarke	for dist in MANIFEST $$(ls *.txz | grep -vE -- '(base|lib32)-dbg'); \
17313cb0041SJessica Clarke	    do echo "./usr/freebsd-dist/$${dist} type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG; \
17413cb0041SJessica Clarke	done
17513cb0041SJessica Clarke.endif
17612ad0bb1SNathan Whitehorn# Set up installation environment
177a55e34ebSGlen Barber	ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf
178a55e34ebSGlen Barber	echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf
179a55e34ebSGlen Barber	echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf
1808c14a409SGlen Barber	echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf
181a55e34ebSGlen Barber	echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf
1826e49372eSKyle Evans	echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf
183a55e34ebSGlen Barber	cp ${.CURDIR}/rc.local ${.TARGET}/etc
18413cb0041SJessica Clarke.if defined(NO_ROOT)
18513cb0041SJessica Clarke	echo "./etc/resolv.conf type=link uname=root gname=wheel mode=0644 link=/tmp/bsdinstall_etc/resolv.conf" >> ${.TARGET}/METALOG
18613cb0041SJessica Clarke	echo "./etc/rc.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
18713cb0041SJessica Clarke	echo "./etc/sysctl.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
18813cb0041SJessica Clarke	echo "./boot/loader.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
18913cb0041SJessica Clarke	echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
19013cb0041SJessica Clarke.endif
191876acefaSHiroki Sato	touch ${.TARGET}
19212ad0bb1SNathan Whitehorn
19346c413feSNathan Whitehornbootonly: packagesystem
19446c413feSNathan Whitehorn# Install system
195a55e34ebSGlen Barber	mkdir -p ${.TARGET}
1964bbfa3d3SEd Maste	cd ${WORLDDIR} && ${IMAKE} installworld installkernel distribution \
19713f7dbe8SEd Maste	    DESTDIR=${.OBJDIR}/${.TARGET} MK_AT=no \
198738919c0SBaptiste Daroussin	    MK_GAMES=no \
199ba7bd912SGlen Barber	    MK_INSTALLLIB=no MK_LIB32=no MK_MAIL=no \
200eacff37aSEd Maste	    MK_TOOLCHAIN=no MK_PROFILE=no \
20101d57ec0SBryan Drewery	    MK_RESCUE=no MK_DICT=no \
2022502c66bSRoger Pau Monné	    MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no \
2032502c66bSRoger Pau Monné	    -DDB_FROM_SRC
20446c413feSNathan Whitehorn# Copy manifest only (no distfiles) to get checksums
205a55e34ebSGlen Barber	mkdir -p ${.TARGET}/usr/freebsd-dist
206a55e34ebSGlen Barber	cp MANIFEST ${.TARGET}/usr/freebsd-dist
20713cb0041SJessica Clarke.if defined(NO_ROOT)
20813cb0041SJessica Clarke	echo "./usr/freebsd-dist type=dir uname=root gname=wheel mode=0755" >> ${.TARGET}/METALOG
20913cb0041SJessica Clarke	echo "./usr/freebsd-dist/MANIFEST type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
21013cb0041SJessica Clarke.endif
21146c413feSNathan Whitehorn# Set up installation environment
212a55e34ebSGlen Barber	ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf
213a55e34ebSGlen Barber	echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf
214a55e34ebSGlen Barber	echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf
2158c14a409SGlen Barber	echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf
216a55e34ebSGlen Barber	echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf
2176e49372eSKyle Evans	echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf
218a55e34ebSGlen Barber	cp ${.CURDIR}/rc.local ${.TARGET}/etc
21913cb0041SJessica Clarke.if defined(NO_ROOT)
22013cb0041SJessica Clarke	echo "./etc/resolv.conf type=link uname=root gname=wheel mode=0644 link=/tmp/bsdinstall_etc/resolv.conf" >> ${.TARGET}/METALOG
22113cb0041SJessica Clarke	echo "./etc/rc.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
22213cb0041SJessica Clarke	echo "./etc/sysctl.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
22313cb0041SJessica Clarke	echo "./boot/loader.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
22413cb0041SJessica Clarke	echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
22513cb0041SJessica Clarke.endif
22646c413feSNathan Whitehorn
227a55e34ebSGlen Barberdvd: packagesystem
228dc244562SGlen Barber# Install system
229dc244562SGlen Barber	mkdir -p ${.TARGET}
2304bbfa3d3SEd Maste	cd ${WORLDDIR} && ${IMAKE} installworld installkernel distribution \
231ba7bd912SGlen Barber		DESTDIR=${.OBJDIR}/${.TARGET} MK_RESCUE=no MK_KERNEL_SYMBOLS=no \
2322502c66bSRoger Pau Monné		MK_TESTS=no MK_DEBUG_FILES=no \
2332502c66bSRoger Pau Monné		-DDB_FROM_SRC
234dc244562SGlen Barber# Copy distfiles
235dc244562SGlen Barber	mkdir -p ${.TARGET}/usr/freebsd-dist
23688343186SGlen Barber	for dist in MANIFEST $$(ls *.txz | grep -v -- '(base|lib32)-dbg'); \
237ffc6fb79SGlen Barber	    do cp $${dist} ${.TARGET}/usr/freebsd-dist; \
238ffc6fb79SGlen Barber	done
23913cb0041SJessica Clarke.if defined(NO_ROOT)
24013cb0041SJessica Clarke	echo "./usr/freebsd-dist type=dir uname=root gname=wheel mode=0755" >> ${.TARGET}/METALOG
24113cb0041SJessica Clarke	for dist in MANIFEST $$(ls *.txz | grep -vE -- '(base|lib32)-dbg'); \
24213cb0041SJessica Clarke	    do echo "./usr/freebsd-dist/$${dist} type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG; \
24313cb0041SJessica Clarke	done
24413cb0041SJessica Clarke.endif
245dc244562SGlen Barber# Set up installation environment
246dc244562SGlen Barber	ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf
247dc244562SGlen Barber	echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf
248dc244562SGlen Barber	echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf
2498c14a409SGlen Barber	echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf
2507f100614SGlen Barber	echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf
2516e49372eSKyle Evans	echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf
252dc244562SGlen Barber	cp ${.CURDIR}/rc.local ${.TARGET}/etc
25313cb0041SJessica Clarke.if defined(NO_ROOT)
25413cb0041SJessica Clarke	echo "./etc/resolv.conf type=link uname=root gname=wheel mode=0644 link=/tmp/bsdinstall_etc/resolv.conf" >> ${.TARGET}/METALOG
25513cb0041SJessica Clarke	echo "./etc/rc.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
25613cb0041SJessica Clarke	echo "./etc/sysctl.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
25713cb0041SJessica Clarke	echo "./boot/loader.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
25813cb0041SJessica Clarke	echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
25913cb0041SJessica Clarke.endif
260dc244562SGlen Barber	touch ${.TARGET}
261dc244562SGlen Barber
2628cec99b6SGlen Barberrelease.iso: disc1.iso
263a55e34ebSGlen Barberdisc1.iso: disc1
26413cb0041SJessica Clarke	cd disc1 && sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_CD ../${.TARGET} .${NO_ROOT:D/METALOG} ${XTRADIR}
26512ad0bb1SNathan Whitehorn
266dc244562SGlen Barberdvd1.iso: dvd pkg-stage
26713cb0041SJessica Clarke	cd dvd && sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_DVD ../${.TARGET} .${NO_ROOT:D/METALOG} ${XTRADIR}
268dc244562SGlen Barber
26946c413feSNathan Whitehornbootonly.iso: bootonly
27013cb0041SJessica Clarke	cd bootonly && sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_BO ../${.TARGET} .${NO_ROOT:D/METALOG} ${XTRADIR}
27146c413feSNathan Whitehorn
272cb95a96bSGlen Barbermemstick: memstick.img
273a55e34ebSGlen Barbermemstick.img: disc1
27413cb0041SJessica Clarke	cd disc1 && sh ${.CURDIR}/${TARGET}/make-memstick.sh .${NO_ROOT:D/METALOG} ../${.TARGET}
27512ad0bb1SNathan Whitehorn
276a9da1707SGlen Barbermini-memstick: mini-memstick.img
277a55e34ebSGlen Barbermini-memstick.img: bootonly
27813cb0041SJessica Clarke	cd bootonly && sh ${.CURDIR}/${TARGET}/make-memstick.sh .${NO_ROOT:D/METALOG} ../${.TARGET}
279a9da1707SGlen Barber
28012ad0bb1SNathan Whitehornpackagesystem: base.txz kernel.txz ${EXTRA_PACKAGES}
281876acefaSHiroki Sato	sh ${.CURDIR}/scripts/make-manifest.sh *.txz > MANIFEST
282299a8b95SNathan Whitehorn	touch ${.TARGET}
28312ad0bb1SNathan Whitehorn
284dc244562SGlen Barberpkg-stage:
28513cb0041SJessica Clarke# TODO: Support for -DNO_ROOT
2868f229143SGlen Barber.if !defined(NOPKG) || empty(NOPKG)
287fefd0439SGlen Barber	env PORTSDIR=${PORTSDIR} REPOS_DIR=${.CURDIR}/pkg_repos/ \
2886f50c4eaSGlen Barber		sh ${.CURDIR}/scripts/pkg-stage.sh
2890d0e89b7SGlen Barber	mkdir -p ${.OBJDIR}/dvd/packages/repos/
2900d0e89b7SGlen Barber	cp ${.CURDIR}/scripts/FreeBSD_install_cdrom.conf \
2910d0e89b7SGlen Barber		${.OBJDIR}/dvd/packages/repos/
292dc244562SGlen Barber.endif
2930d0e89b7SGlen Barber	touch ${.TARGET}
294dc244562SGlen Barber
2958cec99b6SGlen Barbercdrom: disc1.iso bootonly.iso
296dc244562SGlen Barberdvdrom: dvd1.iso
29712ad0bb1SNathan Whitehornftp: packagesystem
298299a8b95SNathan Whitehorn	rm -rf ftp
299876acefaSHiroki Sato	mkdir -p ftp
300299a8b95SNathan Whitehorn	cp *.txz MANIFEST ftp
30112ad0bb1SNathan Whitehorn
3024afe7cf5SGlen Barberrelease:	real-release vm-release cloudware-release
303fdbd473cSGlen Barber	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} release-done
304fdbd473cSGlen Barber	true
305fdbd473cSGlen Barber
306fdbd473cSGlen Barberrelease-done:
307fdbd473cSGlen Barber	touch release
3084afe7cf5SGlen Barber
3094afe7cf5SGlen Barberreal-release:
3100bd47e83SNathan Whitehorn	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj
3110bd47e83SNathan Whitehorn	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${RELEASE_TARGETS}
31212ad0bb1SNathan Whitehorn
31332a4dda8SGlen Barberinstall:	release-install vm-install
3142d4ff62fSGlen Barber
3152d4ff62fSGlen Barberrelease-install:
316876acefaSHiroki Sato.if defined(DESTDIR) && !empty(DESTDIR)
317876acefaSHiroki Sato	mkdir -p ${DESTDIR}
318876acefaSHiroki Sato.endif
319de17cbccSHiroki Sato	cp -a ftp ${DESTDIR}/
3203083b412SMitchell Horne.if !empty(IMAGES)
321de17cbccSHiroki Sato.for I in ${IMAGES}
322de17cbccSHiroki Sato	cp -p ${I} ${DESTDIR}/${OSRELEASE}-${I}
323510f3303SGlen Barber. if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES)
324bd9cab6fSRui Paulo	${XZ_CMD} -k ${DESTDIR}/${OSRELEASE}-${I}
325cbc0e08aSGlen Barber. endif
326de17cbccSHiroki Sato.endfor
32734187a08SGlen Barber	cd ${DESTDIR} && sha512 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA512
328de17cbccSHiroki Sato	cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256
3293083b412SMitchell Horne.endif
330a68d274bSGlen Barber
33129b282f3SGlen Barber.include "${.CURDIR}/Makefile.inc1"
3326513e474SGlen Barber.include "${.CURDIR}/Makefile.vm"
333