2015-05-11 22:14:03 +00:00
|
|
|
#
|
|
|
|
# This Makefile helps create the directory structure on ftp-master,
|
|
|
|
# making staging builds a bit more sane.
|
|
|
|
#
|
|
|
|
# You probably do not want to use this. Really.
|
|
|
|
# You have been warned.
|
|
|
|
#
|
2015-05-12 01:20:27 +00:00
|
|
|
# Seriously.
|
|
|
|
#
|
|
|
|
# Don't use this unless you know why you're using it.
|
|
|
|
#
|
2015-05-11 22:14:03 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
.include "${.CURDIR}/Makefile"
|
|
|
|
|
2015-05-12 00:27:52 +00:00
|
|
|
RELEASEDIR?= /R
|
2015-05-12 01:27:58 +00:00
|
|
|
FTPDIR?= ${RELEASEDIR}/ftp-stage
|
2015-05-26 17:40:36 +00:00
|
|
|
.if exists(${RELEASEDIR})
|
2015-05-11 22:14:03 +00:00
|
|
|
STAGE_TARGETS?= iso-images-stage
|
2015-05-26 17:40:36 +00:00
|
|
|
.endif
|
2015-05-11 22:14:03 +00:00
|
|
|
|
2015-05-22 21:04:42 +00:00
|
|
|
.if (defined(EMBEDDED_TARGET) && !empty(EMBEDDED_TARGET)) || (defined(EMBEDDEDBUILD) && !empty(EMBEDDEDBUILD))
|
2017-07-05 16:55:45 +00:00
|
|
|
. if ${TARGET:Marm*} != "" || ${EMBEDDED_TARGET:Marm*} != ""
|
2015-05-21 22:11:57 +00:00
|
|
|
EMBEDDED= 1
|
2015-05-21 22:50:39 +00:00
|
|
|
. endif
|
2015-05-21 22:11:57 +00:00
|
|
|
.endif
|
|
|
|
|
2015-05-11 22:14:03 +00:00
|
|
|
# snapshot
|
2016-05-27 01:07:48 +00:00
|
|
|
.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" || ${BRANCH:MALPHA*} != ""
|
2015-05-11 22:14:03 +00:00
|
|
|
SNAPSHOT= 1
|
|
|
|
TLD?= ${FTPDIR}/snapshots
|
2015-05-26 20:51:44 +00:00
|
|
|
. if !defined(SVNREVISION) || empty(SVNREVISION)
|
|
|
|
. for _D in /usr/bin /usr/local/bin
|
|
|
|
. for _S in svnversion svnliteversion
|
|
|
|
. if exists(${_D}/${_S})
|
2015-05-11 22:14:03 +00:00
|
|
|
SVNVERSION?= ${_D}/${_S}
|
2015-05-26 20:51:44 +00:00
|
|
|
. endif
|
|
|
|
. endfor
|
2015-05-11 22:14:03 +00:00
|
|
|
. endfor
|
2015-05-26 20:51:44 +00:00
|
|
|
. if exists(${SVNVERSION}) && !empty(SVNVERSION)
|
|
|
|
SVNREVISION!= ${SVNVERSION} ${WORLDDIR}/Makefile
|
|
|
|
. endif
|
2015-05-26 21:58:22 +00:00
|
|
|
. endif # !defined(SVNREVISION)
|
2015-05-26 20:51:44 +00:00
|
|
|
. if !defined(BUILDDATE) || empty(BUILDDATE)
|
|
|
|
. if exists(${.CURDIR}/${.OBJDIR}/dist/base/bin/sh)
|
2015-05-21 22:11:57 +00:00
|
|
|
BUILDDATE!= cd ${.CURDIR} && date -j -f '%s' $$(stat -f "%c" ${.OBJDIR}/dist/base/bin/sh) +%Y%m%d
|
2015-05-26 20:51:44 +00:00
|
|
|
. else
|
2015-05-21 22:11:57 +00:00
|
|
|
BUILDDATE!= date +%Y%m%d
|
2015-05-26 20:51:44 +00:00
|
|
|
. endif
|
2015-05-21 22:11:57 +00:00
|
|
|
. endif
|
2015-05-27 17:33:30 +00:00
|
|
|
_SNAP_SUFFIX:= ${BUILDDATE}-r${SVNREVISION}
|
2015-05-11 22:14:03 +00:00
|
|
|
.else
|
|
|
|
# release
|
|
|
|
SNAPSHOT=
|
|
|
|
TLD?= ${FTPDIR}/releases
|
|
|
|
.endif
|
|
|
|
|
2015-05-21 22:11:57 +00:00
|
|
|
.if defined(EMBEDDED) && !empty(EMBEDDED)
|
2017-10-05 23:01:33 +00:00
|
|
|
. if ${TARGET:Marm*} != "" && (${TARGET_ARCH:Marmv[67]} != "" || ${TARGET_ARCH} == "aarch64")
|
2015-05-21 22:11:57 +00:00
|
|
|
. if !defined(BOARDNAME) && empty(BOARDNAME)
|
|
|
|
BOARDNAME:= ${KERNCONF}
|
|
|
|
. else
|
|
|
|
OLDNAME:= ${KERNCONF}
|
|
|
|
. endif
|
2016-05-27 01:07:48 +00:00
|
|
|
. if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" || ${BRANCH:MALPHA*} != ""
|
2015-05-21 22:11:57 +00:00
|
|
|
SNAPSHOT= 1
|
|
|
|
. endif
|
2015-05-22 21:04:42 +00:00
|
|
|
IMAGES:= img
|
2015-05-21 22:11:57 +00:00
|
|
|
. endif # arm/armv6
|
|
|
|
.endif # embedded
|
|
|
|
|
2015-05-11 22:14:03 +00:00
|
|
|
.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
|
|
|
|
STAGE_TARGETS+= vm-images-stage
|
|
|
|
VM_DIR= ${TLD}/VM-IMAGES/${REVISION}-${BRANCH}/${TARGET_ARCH}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
CLEANFILES+= ${STAGE_TARGETS}
|
2015-10-14 22:33:11 +00:00
|
|
|
CHECKSUM_FILES?= SHA512 SHA256
|
2015-05-11 22:14:03 +00:00
|
|
|
SNAP_SUFFIX!= echo ${_SNAP_SUFFIX:S,^-,,1} | tr -d ' '
|
|
|
|
ISO_DIR= ${TLD}/${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}
|
|
|
|
FTP_DIR= ${TLD}/${TARGET}/${TARGET_ARCH}/${REVISION}-${BRANCH}
|
|
|
|
|
2015-05-12 00:30:56 +00:00
|
|
|
remove-old-bits:
|
|
|
|
rm -rf ${FTPDIR}
|
|
|
|
|
2015-05-11 22:14:03 +00:00
|
|
|
iso-images-stage:
|
|
|
|
mkdir -p ${ISO_DIR}
|
|
|
|
mkdir -p ${TLD}/ISO-IMAGES/${REVISION}
|
2015-05-26 17:44:31 +00:00
|
|
|
.if defined(SNAPSHOT) && !empty(SNAPSHOT)
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && rm -f CHECKSUM.*
|
2015-05-26 17:44:31 +00:00
|
|
|
. for IMAGE in ${IMAGES}
|
|
|
|
. if defined(EMBEDDED) && !empty(EMBEDDED)
|
|
|
|
. if defined(OLDNAME) && !empty(OLDNAME)
|
2015-05-21 22:11:57 +00:00
|
|
|
@# arm/armv6 IMX6 -> WANDBOARD, for example.
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && \
|
|
|
|
mv ${OSRELEASE}-${OLDNAME}.${IMAGE}.xz \
|
|
|
|
${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz
|
2015-05-26 17:44:31 +00:00
|
|
|
. endif
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && \
|
|
|
|
mv ${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz \
|
|
|
|
${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}.${IMAGE}.xz
|
|
|
|
cp -p ${RELEASEDIR}/${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}.${IMAGE}.xz \
|
|
|
|
${ISO_DIR}/${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}.${IMAGE}.xz
|
|
|
|
cd ${TLD}/ISO-IMAGES/${REVISION} && \
|
|
|
|
ln -s \
|
|
|
|
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}.${IMAGE}.xz
|
2015-05-26 17:44:31 +00:00
|
|
|
. endif # not embedded
|
|
|
|
. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE})
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && \
|
|
|
|
mv ${OSRELEASE}-${IMAGE} \
|
2015-05-26 17:34:56 +00:00
|
|
|
${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}
|
2015-05-22 21:04:42 +00:00
|
|
|
cp -p ${RELEASEDIR}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} \
|
|
|
|
${ISO_DIR}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}
|
2015-05-11 22:14:03 +00:00
|
|
|
cd ${TLD}/ISO-IMAGES/${REVISION} && \
|
|
|
|
ln -s \
|
2015-05-22 21:04:42 +00:00
|
|
|
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}
|
2015-05-26 17:44:31 +00:00
|
|
|
. endif
|
|
|
|
. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz)
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && \
|
|
|
|
mv ${OSRELEASE}-${IMAGE}.xz \
|
2015-05-26 17:34:56 +00:00
|
|
|
${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz
|
2015-05-22 21:04:42 +00:00
|
|
|
cp -p ${RELEASEDIR}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz \
|
|
|
|
${ISO_DIR}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz
|
2015-05-21 20:18:13 +00:00
|
|
|
cd ${TLD}/ISO-IMAGES/${REVISION} && \
|
|
|
|
ln -s \
|
2015-05-22 21:04:42 +00:00
|
|
|
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz
|
2015-05-26 17:44:31 +00:00
|
|
|
. endif
|
|
|
|
. endfor # images loop
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && rm -f CHECKSUM.*
|
2015-05-26 17:44:31 +00:00
|
|
|
. for CHECKSUM in ${CHECKSUM_FILES}
|
|
|
|
. if defined(EMBEDDED) && !empty(EMBEDDED)
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \
|
2015-05-21 22:11:57 +00:00
|
|
|
CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}
|
2015-05-22 21:04:42 +00:00
|
|
|
cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX} \
|
|
|
|
${ISO_DIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}
|
2015-05-21 22:11:57 +00:00
|
|
|
cd ${TLD}/ISO-IMAGES/${REVISION} && \
|
|
|
|
ln -s \
|
|
|
|
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}
|
2015-05-26 17:44:31 +00:00
|
|
|
. else # not embedded
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \
|
2015-05-21 20:18:13 +00:00
|
|
|
CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX}
|
2015-05-22 21:04:42 +00:00
|
|
|
cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX} \
|
|
|
|
${ISO_DIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX}
|
2015-05-12 01:04:02 +00:00
|
|
|
cd ${TLD}/ISO-IMAGES/${REVISION} && \
|
2015-05-12 00:55:28 +00:00
|
|
|
ln -s \
|
2015-05-21 20:18:13 +00:00
|
|
|
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX}
|
2015-05-26 17:44:31 +00:00
|
|
|
. endif #
|
|
|
|
. endfor # checksum files
|
|
|
|
.else # not snapshot
|
|
|
|
. for IMAGE in ${IMAGES}
|
|
|
|
. if defined(EMBEDDED) && !empty(EMBEDDED)
|
|
|
|
. if defined(OLDNAME) && !empty(OLDNAME)
|
2015-05-22 21:04:42 +00:00
|
|
|
@# arm/armv6 IMX6 -> WANDBOARD, for example.
|
|
|
|
cd ${RELEASEDIR} && \
|
|
|
|
mv ${OSRELEASE}-${OLDNAME}.${IMAGE}.xz \
|
|
|
|
${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz
|
2015-05-26 17:44:31 +00:00
|
|
|
. endif
|
2015-05-22 21:04:42 +00:00
|
|
|
cp -p ${RELEASEDIR}/${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz \
|
|
|
|
${ISO_DIR}/${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz
|
|
|
|
cd ${TLD}/ISO-IMAGES/${REVISION} && \
|
|
|
|
ln -s \
|
|
|
|
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz
|
2015-05-26 17:44:31 +00:00
|
|
|
. endif # not embedded
|
|
|
|
. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE})
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && \
|
|
|
|
cp -p ${RELEASEDIR}/${OSRELEASE}-${IMAGE} \
|
|
|
|
${ISO_DIR}/${OSRELEASE}-${IMAGE}
|
|
|
|
cd ${TLD}/ISO-IMAGES/${REVISION} && \
|
|
|
|
ln -s \
|
|
|
|
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${IMAGE}
|
2015-05-26 17:44:31 +00:00
|
|
|
. endif
|
|
|
|
. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz)
|
2015-05-22 21:04:42 +00:00
|
|
|
cp -p ${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz \
|
|
|
|
${ISO_DIR}/${OSRELEASE}-${IMAGE}.xz
|
|
|
|
cd ${TLD}/ISO-IMAGES/${REVISION} && \
|
|
|
|
ln -s \
|
|
|
|
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${IMAGE}.xz
|
2015-05-26 17:44:31 +00:00
|
|
|
. endif
|
|
|
|
. endfor # images loop
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && rm -f CHECKSUM.*
|
2015-05-26 17:44:31 +00:00
|
|
|
. for CHECKSUM in ${CHECKSUM_FILES}
|
|
|
|
. if defined(EMBEDDED) && !empty(EMBEDDED)
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \
|
|
|
|
CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}
|
|
|
|
cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME} \
|
|
|
|
${ISO_DIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}
|
|
|
|
cd ${TLD}/ISO-IMAGES/${REVISION} && \
|
|
|
|
ln -s \
|
|
|
|
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}
|
2015-05-26 17:44:31 +00:00
|
|
|
. else # not embedded
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \
|
2015-05-21 20:22:55 +00:00
|
|
|
CHECKSUM.${CHECKSUM}-${OSRELEASE}
|
2015-05-22 21:04:42 +00:00
|
|
|
cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE} \
|
|
|
|
${ISO_DIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}
|
|
|
|
cd ${TLD}/ISO-IMAGES/${REVISION} && \
|
|
|
|
ln -s \
|
|
|
|
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE}
|
2015-05-26 17:44:31 +00:00
|
|
|
. endif
|
|
|
|
. endfor # checksum files
|
|
|
|
.endif # release
|
|
|
|
.if exists(${RELEASEDIR}/ftp)
|
2015-05-11 22:14:03 +00:00
|
|
|
mkdir -p ${FTP_DIR}
|
2015-05-22 21:04:42 +00:00
|
|
|
cp -p ${RELEASEDIR}/ftp/*.txz ${RELEASEDIR}/ftp/MANIFEST ${FTP_DIR}
|
2015-05-11 22:14:03 +00:00
|
|
|
cd ${TLD}/${TARGET} && \
|
|
|
|
ln -s ${TARGET_ARCH}/${REVISION}-${BRANCH} \
|
|
|
|
${REVISION}-${BRANCH}
|
2015-05-26 17:44:31 +00:00
|
|
|
.endif
|
2015-05-11 22:14:03 +00:00
|
|
|
|
|
|
|
vm-images-stage:
|
2015-05-22 21:38:11 +00:00
|
|
|
mkdir -p ${VM_DIR}
|
|
|
|
.if defined(SNAPSHOT) && !empty(SNAPSHOT)
|
|
|
|
. if exists(${VM_DIR}/Latest)
|
|
|
|
rm -rf ${VM_DIR}/Latest
|
|
|
|
. endif
|
|
|
|
mkdir -p ${VM_DIR}/Latest
|
|
|
|
mkdir -p ${VM_DIR}/${BUILDDATE}
|
|
|
|
. for VMFORMAT in ${VMFORMATS}
|
|
|
|
cd ${RELEASEDIR}/vmimages && \
|
|
|
|
mv ${OSRELEASE}.${VMFORMAT}.xz \
|
|
|
|
${OSRELEASE}-${SNAP_SUFFIX}.${VMFORMAT}.xz
|
|
|
|
cp -p ${RELEASEDIR}/vmimages/${OSRELEASE}-${SNAP_SUFFIX}.${VMFORMAT}.xz \
|
|
|
|
${VM_DIR}/${BUILDDATE}/${OSRELEASE}-${SNAP_SUFFIX}.${VMFORMAT}.xz
|
|
|
|
cd ${VM_DIR}/Latest && \
|
|
|
|
ln -s ../${BUILDDATE}/${OSRELEASE}-${SNAP_SUFFIX}.${VMFORMAT}.xz \
|
|
|
|
${OSRELEASE}.${VMFORMAT}.xz
|
|
|
|
. endfor
|
|
|
|
cd ${RELEASEDIR}/vmimages && rm -f CHECKSUM.*
|
|
|
|
. for CHECKSUM in ${CHECKSUM_FILES}
|
|
|
|
cd ${RELEASEDIR}/vmimages && \
|
|
|
|
${CHECKSUM:tl} ${OSRELEASE}* > CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX}
|
|
|
|
cp -p ${RELEASEDIR}/vmimages/CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX} \
|
|
|
|
${VM_DIR}/${BUILDDATE}/CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX}
|
|
|
|
cd ${VM_DIR}/Latest && \
|
|
|
|
ln -s ../${BUILDDATE}/CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX} \
|
|
|
|
CHECKSUM.${CHECKSUM}
|
|
|
|
. endfor
|
|
|
|
.else # not snapshot
|
|
|
|
. if exists(${VM_DIR}/Latest)
|
|
|
|
rm -rf ${VM_DIR}/Latest
|
|
|
|
. endif
|
|
|
|
mkdir -p ${VM_DIR}/Latest
|
|
|
|
. for VMFORMAT in ${VMFORMATS}
|
|
|
|
cp -p ${RELEASEDIR}/vmimages/${OSRELEASE}.${VMFORMAT}.xz \
|
|
|
|
${VM_DIR}/Latest/${OSRELEASE}.${VMFORMAT}.xz
|
|
|
|
. endfor
|
|
|
|
. for CHECKSUM in ${CHECKSUM_FILES}
|
|
|
|
cp -p ${RELEASEDIR}/vmimages/CHECKSUM.${CHECKSUM} \
|
|
|
|
${VM_DIR}/Latest/CHECKSUM.${CHECKSUM}
|
|
|
|
. endfor
|
|
|
|
.endif
|
2015-05-11 22:14:03 +00:00
|
|
|
|
2015-05-12 00:30:56 +00:00
|
|
|
ftp-stage: remove-old-bits ${STAGE_TARGETS}
|
2015-05-11 22:14:03 +00:00
|
|
|
|