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-07-15 20:37:01 +03:00
BUILDER_ARGS = /usr/bin/docker run --rm --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-07-15 20:37:01 +03:00
docker build -t $( BUILDER_IMG) -f Dockerfile.builder .
2016-06-04 17:48:06 +03:00
2016-07-15 20:37:01 +03:00
build : buildimg
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-07-15 20:37:01 +03:00
sh checkout.sh
2016-06-14 23:27:14 +03:00
$( BUILDER_ARGS) -v /etc:/host/etc \
-v /ostree/repo/tmp/vmcheck.ro/usr:/host/usr \
2016-07-15 20:37:01 +03:00
$( BUILDER_IMG) make install DESTDIR = /host
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 \
2016-07-15 20:37:01 +03:00
$( BUILDER_IMG) make install DESTDIR = /host
2016-07-06 16:26:02 +03:00
check : build
$( BUILDER_RUN) make check
2016-07-15 20:37:01 +03:00
clean : buildimg
2016-07-06 16:26:02 +03:00
$( BUILDER_RUN) make clean