arm64 libc: hide .cerror, .curbrk, .minbrk for WITHOUT_SYMVER
[freebsd-src.git] / release / Makefile.vm
blob902442fdfdd894629cc5b521caa885e359304ebf
2 # $FreeBSD$
5 # Makefile for building virtual machine and cloud provider disk images.
8 VMTARGETS=      vm-image
9 VMFORMATS?=     vhd vmdk qcow2 raw
10 VMSIZE?=        20G
11 VMBASE?=        vm
13 VHD_DESC=       Azure, VirtualPC, Hyper-V, Xen disk image
14 VMDK_DESC=      VMWare, VirtualBox disk image
15 QCOW2_DESC=     Qemu, KVM disk image
16 RAW_DESC=       Unformatted raw disk image
18 CLOUDWARE?=     AZURE \
19                 EC2 \
20                 GCE \
21                 OPENSTACK \
22                 VAGRANT-VIRTUALBOX \
23                 VAGRANT-VMWARE
24 AZURE_FORMAT=   vhdf
25 AZURE_DESC=     Microsoft Azure platform image
26 AZURE_DISK=     ${OSRELEASE}.${AZURE_FORMAT}
27 EC2_FORMAT=     raw
28 EC2_DESC=       Amazon EC2 image
29 EC2_DISK=       ${OSRELEASE}.${EC2_FORMAT}
30 GCE_FORMAT=     raw
31 GCE_DESC=       Google Compute Engine image
32 GCE_DISK=       disk.${GCE_FORMAT}
33 OPENSTACK_FORMAT=qcow2
34 OPENSTACK_DESC= OpenStack platform image
35 OPENSTACK_DISK= ${OSRELEASE}.${OPENSTACK_FORMAT}
36 VAGRANT-VIRTUALBOX_FORMAT=      vmdk
37 VAGRANT-VIRTUALBOX_DESC=        Vagrant Image for VirtualBox
38 VAGRANT-VIRTUALBOX_DISK=        ${OSRELEASE}.vbox.${VAGRANT_FORMAT}
39 VAGRANT-VMWARE_FORMAT=  vmdk
40 VAGRANT-VMWARE_DESC=    Vagrant Image for VMWare
41 VAGRANT-VMWARE_DISK=    ${OSRELEASE}.vmware.${VAGRANT_FORMAT}
43 .if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
44 . for _CW in ${CLOUDWARE}
45 CLOUDTARGETS+=  cw-${_CW:tl}
46 CLEANDIRS+=     cw-${_CW:tl}
47 CLEANFILES+=    ${_CW:tl}.img \
48                 ${_CW:tl}.${${_CW:tu}_FORMAT} \
49                 ${_CW:tl}.${${_CW:tu}_FORMAT}.raw \
50                 cw${_CW:tl}-package
51 CLOUDINSTALL+=  cw${_CW:tl}-install
52 CLOUDPACKAGE+=  cw${_CW:tl}-package
53 ${_CW:tu}IMAGE= ${_CW:tl}.${${_CW:tu}_FORMAT}
54 .  if exists(${.CURDIR}/tools/${_CW:tl}.conf) && !defined(${_CW:tu}CONF)
55 ${_CW:tu}CONF?= ${.CURDIR}/tools/${_CW:tl}.conf
56 .  endif
58 cw-${_CW:tl}:
59         mkdir -p ${.OBJDIR}/${.TARGET}
60         env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
61                 ${.CURDIR}/scripts/mk-vmimage.sh \
62                 -C ${.CURDIR}/tools/vmimage.subr -d ${.OBJDIR}/${.TARGET} \
63                 -i ${.OBJDIR}/${_CW:tl}.img -s ${VMSIZE} -f ${${_CW}_FORMAT} \
64                 -S ${WORLDDIR} -o ${.OBJDIR}/${${_CW}IMAGE} -c ${${_CW}CONF}
65         touch ${.TARGET}
67 cw${_CW:tl}-install:
68         mkdir -p ${DESTDIR}/${_CW:tl}
69         cp -p ${${_CW}IMAGE} \
70                 ${DESTDIR}/${_CW:tl}/${${_CW}_DISK}
71         cd ${DESTDIR}/${_CW:tl} && sha512 ${${_CW}_DISK}* > \
72                 ${DESTDIR}/${_CW:tl}/CHECKSUM.SHA512
73         cd ${DESTDIR}/${_CW:tl} && sha256 ${${_CW}_DISK}* > \
74                 ${DESTDIR}/${_CW:tl}/CHECKSUM.SHA256
76 cw${_CW:tl}-package:
77         @# Special target to handle packaging cloud images in the formats
78         @# specific to each hosting provider.
79 .if exists(${.CURDIR}/tools/${_CW:tl}-package.sh)
80         env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
81                 ${.CURDIR}/tools/${_CW:tl}-package.sh \
82                 -D ${DESTDIR} -I ${${_CW}_DISK} -S ${WORLDDIR}
83 .endif
84         touch ${.TARGET}
86 . endfor
87 .endif
89 .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
90 CLEANDIRS+=     ${VMTARGETS}
91 . for FORMAT in ${VMFORMATS}
92 CLEANFILES+=    ${FORMAT}.img
93 CLEANFILES+=    ${VMBASE}.${FORMAT}
94 . endfor
95 .endif
97 vm-base:        vm-image
99 vm-image:
100 .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
101 . for FORMAT in ${VMFORMATS}
102         mkdir -p ${.OBJDIR}/${.TARGET}
103         env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
104                 ${.CURDIR}/scripts/mk-vmimage.sh \
105                 -C ${.CURDIR}/tools/vmimage.subr -d ${.OBJDIR}/${.TARGET} \
106                 -i ${.OBJDIR}/${FORMAT}.img -s ${VMSIZE} -f ${FORMAT} \
107                 -S ${WORLDDIR} -o ${.OBJDIR}/${VMBASE}.${FORMAT}
108 . endfor
109 .endif
110         touch ${.TARGET}
112 vm-cloudware:   ${CLOUDTARGETS}
114 list-vmtargets: list-cloudware
115         @${ECHO}
116         @${ECHO} "Supported virtual machine disk image formats:"
117 .for FORMAT in ${VMFORMATS:tu}
118         @${ECHO} "  ${FORMAT:tl}: ${${FORMAT}_DESC}"
119 .endfor
121 list-cloudware:
122 .if !empty(CLOUDWARE)
123         @${ECHO}
124         @${ECHO} "Supported cloud hosting provider images:"
125 . for _CW in ${CLOUDWARE}
126         @${ECHO} "  ${_CW:tu}: ${${_CW:tu}_DESC}"
127 . endfor
128 .endif
130 vm-install:
131 .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
132         mkdir -p ${DESTDIR}/vmimages
133 . for FORMAT in ${VMFORMATS}
134         cp -p ${VMBASE}.${FORMAT} \
135                 ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
136 . endfor
137 . if defined(WITH_COMPRESSED_VMIMAGES) && !empty(WITH_COMPRESSED_VMIMAGES)
138 .  for FORMAT in ${VMFORMATS}
139         # Don't keep the originals.  There is a copy in ${.OBJDIR} if needed.
140         ${XZ_CMD} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
141 .  endfor
142 . endif
143         cd ${DESTDIR}/vmimages && sha512 ${OSRELEASE}* > \
144                 ${DESTDIR}/vmimages/CHECKSUM.SHA512
145         cd ${DESTDIR}/vmimages && sha256 ${OSRELEASE}* > \
146                 ${DESTDIR}/vmimages/CHECKSUM.SHA256
147 .endif
149 vm-release:
150 .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
151         ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${VMTARGETS}
152 .endif
154 cloudware-release:
155 .if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
156         ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDTARGETS}
157 .endif
159 cloudware-install:
160 .if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
161         ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDINSTALL}
162 .endif
164 .include "${.CURDIR}/Makefile.ec2"
165 .include "${.CURDIR}/Makefile.azure"
166 .include "${.CURDIR}/Makefile.gce"
167 .include "${.CURDIR}/Makefile.vagrant"