Commit 1ccc94ff authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Pavel Emelyanov

scripts/build: add clang targets

With this, one can do a CRUI build via QEMU+Docker using clang
as a compiler, for example:

	make -C scripts/build alpine-clang
	make -C scripts/build ppc64le-clang

For alpine, default clang version is used. For others, a version has
to be specified explicitly, as there is no package called "clang" in
Ubuntu Trusty (which is used as a base for most arches). Since
clang-3.8 appears to be available from Trusty, and this is the current
stable version of clang, let's use it.

travis-ci: success for QEMU+Dockerfile improvements + clang build
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Acked-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 3541b0d8
FROM alpine:3.4
ARG CC=gcc
RUN apk update && apk add \
build-base \
coreutils \
......@@ -9,7 +10,8 @@ RUN apk update && apk add \
libaio-dev \
libcap-dev \
libnl3-dev \
pkgconfig
pkgconfig \
$CC
COPY . /criu
WORKDIR /criu
RUN make mrproper && make -j $(nproc)
RUN make mrproper && make -j $(nproc) CC=$CC
ARG CC=gcc
RUN apt-get clean
RUN apt-get update
......@@ -16,11 +18,12 @@ RUN apt-get install -y \
libnl-3-dev \
libselinux-dev \
pkg-config \
git-core
git-core \
$CC
COPY . /criu
WORKDIR /criu
RUN make mrproper && make -j $(nproc)
RUN make mrproper && make -j $(nproc) CC=$CC
RUN make mrproper
RUN bash -c 'CLEAN="$(git clean -ndx --exclude=scripts/build)"; echo "${CLEAN}"; test -z "${CLEAN}"; exit $?'
......@@ -12,10 +12,19 @@ binfmt_misc:
.PHONY: binfmt_misc
alpine:
docker build -t criu-$@ -f Dockerfile.alpine ../..
docker build -t criu-$@ -f Dockerfile.alpine $(DB_ARGS) ../..
%: Dockerfile.% qemu-user-static binfmt_misc
docker build -t criu-$@ -f $< ../..
docker build -t criu-$@ -f $< $(DB_ARGS) ../..
%-clang: DB_ARGS=--build-arg CC=clang-3.8
alpine-clang: DB_ARGS=--build-arg CC=clang
alpine-clang: alpine
armv7hf-clang: armv7hf
aarch64-clang: aarch64
ppc64le-clang: ppc64le
x86_64-clang: x86_64
.PHONY: alpine-clang armv7hf-clang aarch64-clang ppc64le-clang x86_64-clang
clean:
rm -rf qemu-user-static
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment