2013-08-23 11:14:18 +02:00
|
|
|
GITVER := $(shell git rev-parse --short HEAD)
|
2013-09-29 10:26:53 +02:00
|
|
|
VERSION = 0.22
|
2013-05-19 09:39:56 +02:00
|
|
|
SHIN += $(shell find -type f -name '*.sh.in')
|
|
|
|
SCRIPTS += $(SHIN:.sh.in=.sh)
|
2019-03-24 20:42:51 -07:00
|
|
|
DATECODE=$(shell date "+%Y%m%d")
|
2017-10-06 23:05:07 -07:00
|
|
|
SHELL=/bin/bash
|
2017-08-13 23:44:29 -07:00
|
|
|
|
2017-08-16 22:39:44 -07:00
|
|
|
T_PLATFORMS=rpi{,2,3}{,-musl} beaglebone{,-musl} cubieboard2{,-musl} odroid-c2{,-musl} usbarmory{,-musl} GCP{,-musl}
|
|
|
|
T_ARCHS=i686 x86_64{,-musl} armv{6,7}l{,-musl} aarch64{,-musl}
|
2017-08-13 23:44:29 -07:00
|
|
|
|
2017-08-18 21:14:00 -07:00
|
|
|
T_SBC_IMGS=rpi{,2,3}{,-musl} beaglebone{,-musl} cubieboard2{,-musl} odroid-c2{,-musl} usbarmory{,-musl}
|
|
|
|
T_CLOUD_IMGS=GCP{,-musl}
|
|
|
|
|
2017-08-27 20:10:38 -07:00
|
|
|
T_PXE_ARCHS=x86_64{,-musl}
|
|
|
|
|
2019-03-24 20:42:51 -07:00
|
|
|
T_MASTERDIRS=x86_64{,-musl} i686
|
|
|
|
|
2017-08-13 23:44:29 -07:00
|
|
|
ARCHS=$(shell echo $(T_ARCHS))
|
2017-08-16 22:39:44 -07:00
|
|
|
PLATFORMS=$(shell echo $(T_PLATFORMS))
|
2017-08-18 21:14:00 -07:00
|
|
|
SBC_IMGS=$(shell echo $(T_SBC_IMGS))
|
|
|
|
CLOUD_IMGS=$(shell echo $(T_CLOUD_IMGS))
|
2017-08-27 20:10:38 -07:00
|
|
|
PXE_ARCHS=$(shell echo $(T_PXE_ARCHS))
|
2019-03-24 20:42:51 -07:00
|
|
|
MASTERDIRS=$(shell echo $(T_MASTERDIRS))
|
2017-08-16 22:39:44 -07:00
|
|
|
|
2019-03-24 20:42:51 -07:00
|
|
|
ALL_ROOTFS=$(foreach arch,$(ARCHS),void-$(arch)-ROOTFS-$(DATECODE).tar.xz)
|
|
|
|
ALL_PLATFORMFS=$(foreach platform,$(PLATFORMS),void-$(platform)-PLATFORMFS-$(DATECODE).tar.xz)
|
|
|
|
ALL_SBC_IMAGES=$(foreach platform,$(SBC_IMGS),void-$(platform)-$(DATECODE).img.xz)
|
|
|
|
ALL_CLOUD_IMAGES=$(foreach cloud,$(CLOUD_IMGS),void-$(cloud)-$(DATECODE).tar.gz)
|
|
|
|
ALL_PXE_ARCHS=$(foreach arch,$(PXE_ARCHS),void-$(arch)-NETBOOT-$(DATECODE).tar.gz)
|
|
|
|
ALL_MASTERDIRS=$(foreach arch,$(MASTERDIRS), masterdir-$(arch))
|
2017-08-13 23:44:29 -07:00
|
|
|
|
|
|
|
SUDO := sudo
|
2013-05-19 09:39:56 +02:00
|
|
|
|
2018-09-14 02:00:05 -07:00
|
|
|
XBPS_REPOSITORY := -r https://alpha.de.repo.voidlinux.org/current -r https://alpha.de.repo.voidlinux.org/current/musl -r https://alpha.de.repo.voidlinux.org/current/aarch64
|
2017-08-21 00:04:17 -07:00
|
|
|
COMPRESSOR_THREADS=2
|
2017-08-20 23:10:15 -05:00
|
|
|
|
2013-05-19 09:39:56 +02:00
|
|
|
%.sh: %.sh.in
|
|
|
|
sed -e "s|@@MKLIVE_VERSION@@|$(VERSION) $(GITVER)|g" $^ > $@
|
2014-01-11 18:51:47 +01:00
|
|
|
chmod +x $@
|
2013-05-19 09:39:56 +02:00
|
|
|
|
|
|
|
all: $(SCRIPTS)
|
2012-06-12 16:27:17 +02:00
|
|
|
|
2017-08-13 23:44:29 -07:00
|
|
|
clean:
|
|
|
|
rm -v *.sh
|
|
|
|
|
2019-03-24 20:42:51 -07:00
|
|
|
distdir-$(DATECODE):
|
|
|
|
mkdir -p distdir-$(DATECODE)
|
2017-08-20 14:59:43 -07:00
|
|
|
|
2019-03-24 20:42:51 -07:00
|
|
|
dist: distdir-$(DATECODE)
|
|
|
|
mv void*$(DATECODE)* distdir-$(DATECODE)/
|
2017-08-20 14:59:43 -07:00
|
|
|
|
2017-08-13 23:44:29 -07:00
|
|
|
rootfs-all: $(ALL_ROOTFS)
|
|
|
|
|
|
|
|
rootfs-all-print:
|
2017-08-29 21:31:38 -07:00
|
|
|
@echo $(ALL_ROOTFS) | sed "s: :\n:g"
|
2017-08-13 23:44:29 -07:00
|
|
|
|
2019-03-24 20:42:51 -07:00
|
|
|
void-%-ROOTFS-$(DATECODE).tar.xz: $(SCRIPTS)
|
2017-08-21 00:04:17 -07:00
|
|
|
$(SUDO) ./mkrootfs.sh $(XBPS_REPOSITORY) -x $(COMPRESSOR_THREADS) $*
|
2017-08-13 23:44:29 -07:00
|
|
|
|
2017-10-06 23:08:54 -07:00
|
|
|
platformfs-all: $(ALL_PLATFORMFS)
|
2017-08-16 22:39:44 -07:00
|
|
|
|
|
|
|
platformfs-all-print:
|
|
|
|
@echo $(ALL_PLATFORMFS) | sed "s: :\n:g"
|
|
|
|
|
2019-03-24 20:42:51 -07:00
|
|
|
void-%-PLATFORMFS-$(DATECODE).tar.xz: $(SCRIPTS)
|
|
|
|
$(SUDO) ./mkplatformfs.sh $(XBPS_REPOSITORY) -x $(COMPRESSOR_THREADS) $* void-$(shell ./lib.sh platform2arch $*)-ROOTFS-$(DATECODE).tar.xz
|
2017-08-29 21:31:38 -07:00
|
|
|
|
2017-08-19 00:16:50 -07:00
|
|
|
images-all: platformfs-all images-all-sbc images-all-cloud
|
|
|
|
|
|
|
|
images-all-sbc: $(ALL_SBC_IMAGES)
|
|
|
|
|
2019-05-25 17:44:21 -07:00
|
|
|
images-all-sbc-print:
|
|
|
|
@echo $(ALL_SBC_IMAGES) | sed "s: :\n:g"
|
|
|
|
|
2017-08-19 00:16:50 -07:00
|
|
|
images-all-cloud: $(ALL_CLOUD_IMAGES)
|
2017-08-18 21:14:00 -07:00
|
|
|
|
|
|
|
images-all-print:
|
2017-08-29 21:31:38 -07:00
|
|
|
@echo $(ALL_SBC_IMAGES) $(ALL_CLOUD_IMAGES) | sed "s: :\n:g"
|
2017-08-18 21:14:00 -07:00
|
|
|
|
2019-03-24 20:42:51 -07:00
|
|
|
void-%-$(DATECODE).img.xz: void-%-PLATFORMFS-$(DATECODE).tar.xz
|
|
|
|
$(SUDO) ./mkimage.sh -x $(COMPRESSOR_THREADS) void-$*-PLATFORMFS-$(DATECODE).tar.xz
|
2017-08-18 21:14:00 -07:00
|
|
|
|
2017-08-29 21:31:38 -07:00
|
|
|
# Some of the images MUST be compressed with gzip rather than xz, this
|
|
|
|
# rule services those images.
|
2019-03-24 20:42:51 -07:00
|
|
|
void-%-$(DATECODE).tar.gz: void-%-PLATFORMFS-$(DATECODE).tar.xz
|
|
|
|
$(SUDO) ./mkimage.sh -x $(COMPRESSOR_THREADS) void-$*-PLATFORMFS-$(DATECODE).tar.xz
|
2017-08-18 21:14:00 -07:00
|
|
|
|
2017-08-27 20:10:38 -07:00
|
|
|
pxe-all: $(ALL_PXE_ARCHS)
|
|
|
|
|
|
|
|
pxe-all-print:
|
2017-08-29 21:31:38 -07:00
|
|
|
@echo $(ALL_PXE_ARCHS) | sed "s: :\n:g"
|
2017-08-18 21:14:00 -07:00
|
|
|
|
2019-03-24 20:42:51 -07:00
|
|
|
void-%-NETBOOT-$(DATECODE).tar.gz: $(SCRIPTS) void-%-ROOTFS-$(DATECODE).tar.xz
|
|
|
|
$(SUDO) ./mknet.sh void-$*-ROOTFS-$(DATECODE).tar.xz
|
|
|
|
|
|
|
|
masterdir-all-print:
|
|
|
|
@echo $(ALL_MASTERDIRS) | sed "s: :\n:g"
|
|
|
|
|
|
|
|
masterdir-all: $(ALL_MASTERDIRS)
|
|
|
|
|
|
|
|
masterdir-%:
|
|
|
|
$(SUDO) docker build --build-arg REPOSITORY=$(XBPS_REPOSITORY) --build-arg ARCH=$* -t voidlinux/masterdir-$*:$(DATECODE) .
|
2017-08-18 21:14:00 -07:00
|
|
|
|
2019-03-24 20:42:51 -07:00
|
|
|
.PHONY: clean dist rootfs-all-print rootfs-all platformfs-all-print platformfs-all pxe-all-print pxe-all masterdir-all-print masterdir-all masterdir-push-all
|