Merge "Rebase after "Bugfix Broadcast Group"."
[armband.git] / Makefile
1 root:=$(shell pwd)
2
3 all: build
4
5 .PHONY: submodules-init submodules-clean
6 submodules-init:
7         @git submodule -q init
8         @git submodule -q sync
9         @git submodule update
10
11 # Cleans any changes made to submodules
12 submodules-clean:
13         @git submodule -q foreach \
14                 'git am --abort; \
15                 git checkout -q armband-workbench-root; \
16                 git branch -q -D armband-workbench; \
17                 git tag -d armband-workbench-root; \
18                 git reset -q --hard HEAD; git clean -xdff'
19
20 .PHONY: patches-export patches-import
21 # Generate patches from submodules
22 patches-export:
23         @git submodule -q foreach 'mkdir -p ${root}/patches/$$name'
24         @git submodule -q foreach 'git format-patch \
25                 -o ${root}/patches/$$name -N armband-workbench-root \
26             --no-signature'
27         @find ${root}/patches -name '*.patch' -exec sed -i -e '1d' {} \;
28
29 # apply patches from patches/* to respective submodules
30 patches-import:
31         @git submodule -q foreach 'mkdir -p ${root}/patches/$$name'
32         @git submodule -q foreach 'git tag armband-workbench-root'
33         @git submodule -q foreach 'git checkout -q -b armband-workbench'
34         @git submodule -q foreach \
35                 'if [ ! -z "$$(ls ${root}/patches/$$name/)" ]; then \
36                         git am ${root}/patches/$$name/*.patch; \
37                 fi'
38 clean-docker:
39         docker stop FUEL_CENTOS_8.0 || true
40         docker rm $(docker ps -a -q) || true
41         docker rmi -f $(docker images -q) || true
42
43 clean-build:
44         sudo rm -rf /tmp/fuel-main
45         git -C ${root}/upstream/fuel reset --hard HEAD
46         git -C ${root}/upstream/fuel clean -xdff
47
48 release: export LC_ALL=en_US.UTF-8
49 release: submodules-clean clean-docker clean-build submodules-init patches-import build
50
51 build:
52         cd ${root}/upstream/fuel/build && \
53                 time make \
54                         BUILD_FUEL_PLUGINS=f_odlpluginbuild \
55                         FUEL_MAIN_REPO=${root}/upstream/fuel-main \
56                         FUEL_MAIN_TAG= \
57                         UBUNTU_ARCH="amd64 arm64" \
58                         FUELLIB_REPO=${root}/upstream/fuel-library \
59                         NAILGUN_REPO=${root}/upstream/fuel-web \
60                         FUEL_AGENT_REPO=${root}/upstream/fuel-agent \
61                         FUEL_MIRROR_REPO=${root}/upstream/fuel-mirror \
62                         QEMU_REPO=${root}/upstream/fuel-plugin-qemu \
63                         OVSNFV_DPDK_REPO=${root}/upstream/fuel-plugin-ovsnfv \
64                         ODL_REPO=${root}/upstream/fuel-plugin-opendaylight \
65                         ODL_CHANGE= \
66                         FUELLIB_COMMIT=HEAD \
67                         NAILGUN_COMMIT=HEAD \
68                         FUEL_AGENT_COMMIT=HEAD \
69                         FUEL_MIRROR_COMMIT=HEAD \
70                         QEMU_BRANCH=HEAD \
71                         OVSNFV_DPDK_BRANCH=armband-workbench \
72                         ODL_BRANCH=armband-workbench \
73                         PRODUCT_VERSION=8.0 \
74                         PRODUCT_NAME=mos \
75                         CENTOS_MAJOR=7 \
76                         MIRROR_FUEL=http://linux.enea.com/mos-repos/centos/mos8.0-centos7-fuel/os/x86_64/ \
77                         MIRROR_UBUNTU_URL=http://archive.ubuntu.com/ubuntu/ \
78                         LATEST_MIRROR_ID_URL=http://linux.enea.com/ \
79                         JAVA8_URL=https://launchpad.net/~openjdk-r/+archive/ubuntu/ppa/+files/openjdk-8-jre-headless_8u72-b15-1~trusty1_arm64.deb \
80                         iso 2>&1 | tee ${root}/build.log
81