osi-tools/runtests

84 lines
2.8 KiB
Makefile
Executable File

#!/usr/bin/make -f
# 2018 Luke Shumaker
# Runtime/user options##########################################################
GITREV ?= systemd/master
WORKDIR ?= $(CURDIR)/workdir
# Configure Make ###############################################################
.ONESHELL:
SHELL = bash -eE -o pipefail
.DELETE_ON_ERROR:
.SECONDARY:
.DEFAULT_GOAL = all
################################################################################
.PHONY: FORCE
${WORKDIR}/systemd.git: FORCE
mkdir -p -- '$(@D)'
gitget bare https://git.parabola.nu/~lukeshu/systemd.git '$@'
test -d '$@'
touch '$@'
${WORKDIR}/.COMMIT.mk: ${WORKDIR}/systemd.git
cd $< && git rev-parse --verify '${GITREV}' | sed 's/^/COMMIT=/' | ./write-ifchanged '$@'
-include ${WORKDIR}/.COMMIT.mk
# Build systemd 232
${WORKDIR}/build-232/build.raw: osi-mk.d/libretools.sh
${WORKDIR}/build-232/build.raw: osi-mk.d/builddeps.sh
${WORKDIR}/build-232/build.raw: osi-mk.d/systemd-dhcpcd.sh
${WORKDIR}/build-232/build.raw: osi-mk.d/systemd-osi-run.sh
${WORKDIR}/build-232/build.raw: abs/systemd-232 $(wildcard abs/systemd-232/*)
${WORKDIR}/build-232/build.raw: | ${WORKDIR}/systemd.git
${WORKDIR}/build-232/build.raw:
rm -f -- '$@'
mkdir -p -- '$(@D)'
./osi-mk \
--size=4G \
--package='base' \
$(addpreix --module=,$(filter osi-mk.d/%.sh,$^)) \
--directory="$workdir/systemd.git:/home/testuser/packages/srcdest/systemd" \
--directory="abs/systemd-232:/home/testuser/packages/abs/systemd" \
'$@'
${WORKDIR}/build-232/build.log: %/build.log: %/build.raw
./osi-run '$<' <<-EOF | tee '$@'
#!/usr/bin/env bash
set -ex
cd ~/packages/abs/systemd
script --return --quiet --command 'sudo libremakepkg' /dev/null
EOF
all: ${WORKDIR}/build-232/pkgdest
# Build the code under under test
${WORKDIR}/build-$(COMMIT)/build.raw: osi-mk.d/libretools.sh
${WORKDIR}/build-$(COMMIT)/build.raw: osi-mk.d/builddeps.sh
${WORKDIR}/build-$(COMMIT)/build.raw: osi-mk.d/systemd-dhcpcd.sh
${WORKDIR}/build-$(COMMIT)/build.raw: osi-mk.d/systemd-osi-run.sh
${WORKDIR}/build-$(COMMIT)/build.raw: abs/systemd $(wildcard abs/systemd/*)
${WORKDIR}/build-$(COMMIT)/build.raw: | ${WORKDIR}/systemd.git
rm -f -- '$@'
mkdir -p -- '$(@D)'
./osi-mk \
--size=4G \
--package='base' \
$(addpreix --module=,$(filter osi-mk.d/%.sh,$^)) \
--directory="$workdir/systemd.git:/home/testuser/packages/srcdest/systemd" \
--directory="abs/systemd:/home/testuser/packages/abs/systemd" \
'$@'
${WORKDIR}/build-$(COMMIT)/build.log: %/build.log: %/build.raw
./osi-run '$<' <<-EOF | tee '$@'
#!/usr/bin/env bash
set -ex
cd ~/packages/abs/systemd
sed 's:@COMMIT@:${COMMIT}:' < PKGBUILD.in > PKGBUILD
script --return --quiet --command 'sudo libremakepkg' /dev/null
EOF
all: ${WORKDIR}/build-$(COMMIT)/pkgdest
%/pkgdest: %/build.log
rm -rf -- '$@'
./osi-extract '$*/build.raw' /home/testuser/packages/pkgdest '$@'