summaryrefslogtreecommitdiff
path: root/release/Makefile.vm
diff options
context:
space:
mode:
authorGlen Barber <gjb@FreeBSD.org>2014-10-29 14:57:30 +0000
committerGlen Barber <gjb@FreeBSD.org>2014-10-29 14:57:30 +0000
commit6513e474ac5b1450691119b31343805f1d1266fc (patch)
tree2119f0e84ed1a204bb7f7b6c967ffcdf8453f18a /release/Makefile.vm
parent2a382033b5c379d4d57f4030f6045bbd5527a1e9 (diff)
downloadsrc-test-6513e474ac5b1450691119b31343805f1d1266fc.tar.gz
src-test-6513e474ac5b1450691119b31343805f1d1266fc.zip
Move virtual machine / cloud provider targets and
options from release/Makefile to their own Makefile. Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/projects/release-vmimage/; revision=273823
Diffstat (limited to 'release/Makefile.vm')
-rw-r--r--release/Makefile.vm57
1 files changed, 57 insertions, 0 deletions
diff --git a/release/Makefile.vm b/release/Makefile.vm
new file mode 100644
index 0000000000000..1d1f64223f531
--- /dev/null
+++ b/release/Makefile.vm
@@ -0,0 +1,57 @@
+#
+# $FreeBSD$
+#
+#
+# Makefile for building virtual machine and cloud provider disk images.
+#
+
+VMTARGETS= vm-base vm-image
+VMFORMATS?= vhd vmdk qcow2 raw
+VMSIZE?= 20G
+VMBASE?= vm
+AZURECONF?= ${.CURDIR}/tools/azure.conf
+
+.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
+CLEANDIRS+= ${VMTARGETS}
+CLEANFILES+= ${VMBASE}.img
+. for FORMAT in ${VMFORMATS}
+CLEANFILES+= ${VMBASE}.${FORMAT}
+. endfor
+.endif
+
+.if exists(${.CURDIR}/${TARGET}/mk-azure.sh)
+CLEANFILES+= ${OSRELEASE}.vhd \
+ ${OSRELEASE}.vhd.raw \
+ azure.img
+CLEANDIRS+= vm-azure
+.endif
+
+vm-base:
+.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
+. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh)
+ env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
+ ${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \
+ ${VMBASE}.img ${WORLDDIR} ${.OBJDIR}/${.TARGET} ${VMSIZE}
+. endif
+.endif
+ touch ${.TARGET}
+
+vm-image: vm-base
+.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
+. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh)
+. for FORMAT in ${VMFORMATS}
+ env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
+ ${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \
+ ${VMBASE}.img ${FORMAT} ${VMBASE}.${FORMAT}
+. endfor
+. endif
+.endif
+ touch ${.TARGET}
+
+vm-azure:
+.if exists(${.CURDIR}/${TARGET}/mk-azure.sh)
+ env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} AZURECONF=${AZURECONF} \
+ ${.CURDIR}/${TARGET}/mk-azure.sh ${.TARGET} azure.img \
+ ${WORLDDIR} ${.TARGET} ${VMSIZE} ${OSRELEASE}.vhd
+.endif
+ touch ${.TARGET}