Makefile.vm (7d2ef96183ea3e29543eca16bf5774b054046373) Makefile.vm (1e7c1f17428a0b342afd622fad341a389bed7a3f)
1#
2# $FreeBSD$
3#
4#
5# Makefile for building virtual machine and cloud provider disk images.
6#
7
1#
2# $FreeBSD$
3#
4#
5# Makefile for building virtual machine and cloud provider disk images.
6#
7
8VMTARGETS= vm-base vm-image
8VMTARGETS= vm-image
9VMFORMATS?= vhd vmdk qcow2 raw
10VMSIZE?= 20G
11VMBASE?= vm
12
13CLOUDWARE?= AZURE \
14 OPENSTACK
15AZURE_FORMAT= vhdf
16OPENSTACK_FORMAT=qcow2

--- 15 unchanged lines hidden (view full) ---

32.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
33CLEANDIRS+= ${VMTARGETS}
34CLEANFILES+= ${VMBASE}.img
35. for FORMAT in ${VMFORMATS}
36CLEANFILES+= ${VMBASE}.${FORMAT}
37. endfor
38.endif
39
9VMFORMATS?= vhd vmdk qcow2 raw
10VMSIZE?= 20G
11VMBASE?= vm
12
13CLOUDWARE?= AZURE \
14 OPENSTACK
15AZURE_FORMAT= vhdf
16OPENSTACK_FORMAT=qcow2

--- 15 unchanged lines hidden (view full) ---

32.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
33CLEANDIRS+= ${VMTARGETS}
34CLEANFILES+= ${VMBASE}.img
35. for FORMAT in ${VMFORMATS}
36CLEANFILES+= ${VMBASE}.${FORMAT}
37. endfor
38.endif
39
40vm-base:
41.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
42. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh)
43 env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
44 ${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \
45 ${VMBASE}.img ${WORLDDIR} ${.OBJDIR}/${.TARGET} ${VMSIZE}
46. endif
47.endif
48 touch ${.TARGET}
40vm-base: vm-image
49
41
50vm-image: vm-base
42vm-image:
51.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
52. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh)
53. for FORMAT in ${VMFORMATS}
54 env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
43.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
44. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh)
45. for FORMAT in ${VMFORMATS}
46 env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
55 ${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \
56 ${VMBASE}.img ${FORMAT} ${VMBASE}.${FORMAT}
47 ${.CURDIR}/${TARGET}/mk-vmimage.sh \
48 -C ${.CURDIR}/tools/vmimage.subr -d ${.TARGET} \
49 -i ${VMBASE}.img -s ${VMSIZE} -f ${FORMAT} \
50 -S ${WORLDDIR} -o ${VMBASE}.${FORMAT}
57. endfor
58. endif
59.endif
60 touch ${.TARGET}
61
62vm-cloudware: ${CLOUDTARGETS}
63
64vm-azure:
51. endfor
52. endif
53.endif
54 touch ${.TARGET}
55
56vm-cloudware: ${CLOUDTARGETS}
57
58vm-azure:
65.if exists(${.CURDIR}/${TARGET}/mk-azure.sh)
66 env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} AZURECONF=${AZURECONF} \
67 AZURE_FORMAT=${AZURE_FORMAT} \
68 ${.CURDIR}/${TARGET}/mk-azure.sh ${.TARGET} azure.img \
69 ${WORLDDIR} ${.TARGET} ${VMSIZE} ${AZUREIMAGE}
59.if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh)
60 env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
61 ${.CURDIR}/${TARGET}/mk-vmimage.sh \
62 -C ${.CURDIR}/tools/vmimage.subr -d ${.TARGET} \
63 -i azure.img -s ${VMSIZE} -f ${AZURE_FORMAT} \
64 -S ${WORLDDIR} -o ${AZUREIMAGE} -c ${AZURECONF}
70.endif
71 touch ${.TARGET}
72
73vm-openstack:
65.endif
66 touch ${.TARGET}
67
68vm-openstack:
74.if exists(${.CURDIR}/${TARGET}/mk-openstack.sh)
69.if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh)
75 env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
70 env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
76 OPENSTACKCONF=${OPENSTACKCONF} \
77 OPENSTACK_FORMAT=${OPENSTACK_FORMAT} \
78 ${.CURDIR}/${TARGET}/mk-openstack.sh ${.TARGET} openstack.img \
79 ${WORLDDIR} ${.TARGET} ${VMSIZE} ${OPENSTACKIMAGE}
71 ${.CURDIR}/${TARGET}/mk-vmimage.sh \
72 -C ${.CURDIR}/tools/vmimage.subr -d ${.TARGET} \
73 -i openstack.img -s ${VMSIZE} -f ${OPENSTACK_FORMAT} \
74 -S ${WORLDDIR} -o ${OPENSTACKIMAGE} -c ${OPENSTACKCONF}
80.endif
81 touch ${.TARGET}
75.endif
76 touch ${.TARGET}