2016-06-04 17:48:06 +03:00
all :
2016-07-06 16:26:02 +03:00
echo "Targets: buildimg build install ofsinstall check clean"
2016-06-04 17:48:06 +03:00
2016-06-22 18:51:45 +03:00
BUILDER_ARGS = sudo /usr/bin/docker run --rm -ti --privileged -v /var/roothome:/root
2016-06-14 23:27:14 +03:00
BUILDER_IMG = rpm-ostree-builder
BUILDER_RUN = $( BUILDER_ARGS) $( BUILDER_IMG)
2016-06-04 17:48:06 +03:00
2016-07-06 16:26:02 +03:00
.PHONY : dockerwait buildimg build install ofsinstall check clean
# necessary precaution in case we're operating on a freshly
# booted VM
dockerwait :
@echo "Waiting for docker service to start..." ; \
timeout = 10; \
while [ $$ timeout -gt 0 ] ; do \
if systemctl show -p SubState docker.service | grep -q = running; then \
exit 0; \
fi ; \
timeout = $$ ( ( timeout - 1) ) ; \
sleep 1; \
done ; \
echo "Waited too long for docker service to start" ; \
exit 1
buildimg : dockerwait
2016-06-14 23:27:14 +03:00
sudo docker build -t $( BUILDER_IMG) -f Dockerfile.builder .
2016-06-04 17:48:06 +03:00
2016-07-06 16:26:02 +03:00
b uild : dockerwait
2016-06-28 23:22:49 +03:00
if ! test -f ../configure; then \
$( BUILDER_RUN) env NOCONFIGURE = 1 ./autogen.sh; \
fi
if ! test -f ../Makefile; then \
2016-07-06 16:26:02 +03:00
$( BUILDER_RUN) env CFLAGS = '$(CFLAGS)' \
./configure --prefix= /usr --libdir= /usr/lib64; \
2016-06-28 23:22:49 +03:00
fi
2016-07-06 16:26:02 +03:00
$( BUILDER_RUN) make -j4 CFLAGS = " $( CFLAGS) "
2016-06-04 17:48:06 +03:00
install : build
2016-06-14 23:27:14 +03:00
sudo sh checkout.sh
$( BUILDER_ARGS) -v /etc:/host/etc \
-v /ostree/repo/tmp/vmcheck.ro/usr:/host/usr \
$( BUILDER_IMG) sudo make install DESTDIR = /host
2016-06-15 00:12:17 +03:00
sudo VERSION = $( VERSION) sh commit_and_deploy.sh
2016-06-28 23:22:49 +03:00
ofsinstall : build
ostree admin unlock || :
$( BUILDER_ARGS) -v /etc:/host/etc \
-v /usr:/host/usr \
$( BUILDER_IMG) sudo make install DESTDIR = /host
2016-07-06 16:26:02 +03:00
check : build
$( BUILDER_RUN) make check
clean :
$( BUILDER_RUN) make clean