Initial code commit
[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 checkout -q armband-workbench-root; \
15                 git branch -q -D armband-workbench; \
16                 git tag -d armband-workbench-root; \
17                 git reset -q --hard HEAD; git clean -xdff'
18
19 .PHONY: patches-export patches-import
20 # Generate patches from submodules
21 patches-export:
22         @git submodule -q foreach 'mkdir -p ${root}/patches/$$name'
23         @git submodule -q foreach 'git format-patch \
24                 -o ${root}/patches/$$name -N armband-workbench-root'
25         @find ${root}/patches -name '*.patch' -exec sed -i -e '1d' {} \;
26
27 # apply patches from patches/* to respective submodules
28 patches-import:
29         @git submodule -q foreach 'mkdir -p ${root}/patches/$$name'
30         @git submodule -q foreach 'git tag armband-workbench-root'
31         @git submodule -q foreach 'git checkout -q -b armband-workbench'
32         @git submodule -q foreach \
33                 'for p in $$(ls ${root}/patches/$$name/); do \
34                         git am ${root}/patches/$$name/$$p; \
35                 done'
36
37 build:
38         cd ${root}/upstream/fuel/build && \
39                 time make \
40                         BUILD_FUEL_PLUGINS=f_odlpluginbuild \
41                         FUEL_MAIN_REPO=${root}/upstream/fuel-main \
42                         FUEL_MAIN_TAG= \
43                         UBUNTU_ARCH="amd64 arm64" \
44                         SEPARATE_IMAGES="/boot,ext2 /,ext4 /boot/efi,vfat" \
45                         FUELLIB_REPO=${root}/upstream/fuel-library \
46                         NAILGUN_REPO=${root}/upstream/fuel-web \
47                         FUEL_AGENT_REPO=${root}/upstream/fuel-agent \
48                         FUEL_MIRROR_REPO=${root}/upstream/fuel-mirror \
49                         QEMU_REPO=${root}/upstream/fuel-plugin-qemu \
50                         OVSNFV_DPDK_REPO=${root}/upstream/fuel-plugin-ovsnfv \
51                         FUELLIB_COMMIT=HEAD \
52                         NAILGUN_COMMIT=HEAD \
53                         FUEL_AGENT_COMMIT=HEAD \
54                         FUEL_MIRROR_COMMIT=HEAD \
55                         QEMU_BRANCH=HEAD \
56                         OVSNFV_DPDK_BRANCH=armband-workbench \
57                         PRODUCT_VERSION=8.0 \
58                         PRODUCT_NAME=mos \
59                         CENTOS_MAJOR=7 \
60                         MIRROR_FUEL=http://linux.enea.com/mos-repos/centos/mos8.0-centos7-fuel/os/x86_64/ \
61                         MIRROR_UBUNTU_URL=http://archive.ubuntu.com/ubuntu/ \
62                         LATEST_MIRROR_ID_URL=http://linux.enea.com/ \
63                         JAVA8_URL=https://launchpad.net/~openjdk-r/+archive/ubuntu/ppa/+files/openjdk-8-jre-headless_8u72-b15-1~trusty1_arm64.deb \
64                         iso 2>&1 | tee ${root}/build.log
65