From 284281fa320434ac10c3557ad68a858038e4e27f Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Mon, 25 Jul 2016 18:00:18 +0200 Subject: Makefile: submodules sync with Fuel@OPNFV Upstream change [1] pinned Fuel components to Fuel 9.0.1 specific commits. While armband used to track remote branch HEAD, we now need to sync with Fuel's config.mk before applying our patches. Unfortunately, the commit variables are not consistently named, so one could infer a relationship between the variable names and targeted git submodule (e.g. fuel-web commit var is named NAILGUN_COMMIT), so we have to hardcode the module list in our Makefile. [1] https://gerrit.opnfv.org/gerrit/#/c/17225 Closes: ARMBAND-58 Change-Id: Ifdce1c9a5afbd70db3b5703da21b30e8792b3e97 Signed-off-by: Alexandru Avadanii --- Makefile | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 922b72ea..df14ef68 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,18 @@ root:=$(shell pwd) +include config.mk all: build +config.mk: submodules-init + @ln -s -f ${root}/upstream/fuel/build/config.mk ${root}/config.mk + .PHONY: submodules-init submodules-clean submodules-init: - @git submodule -q init - @git submodule -q sync - @git submodule update --remote + @if [ ! -d ${root}/upstream/fuel/build ]; then \ + git submodule -q init; \ + git submodule -q sync; \ + git submodule update --remote; \ + fi # Cleans any changes made to submodules submodules-clean: @@ -28,6 +34,18 @@ patches-export: # apply patches from patches/* to respective submodules patches-import: + @cd ${root}/upstream/fuel-agent && \ + git checkout -q ${FUEL_AGENT_COMMIT} + @cd ${root}/upstream/fuel-astute && \ + git checkout -q ${ASTUTE_COMMIT} + @cd ${root}/upstream/fuel-library && \ + git checkout -q ${FUELLIB_COMMIT} + @cd ${root}/upstream/fuel-mirror && \ + git checkout -q ${FUEL_MIRROR_COMMIT} + @cd ${root}/upstream/fuel-nailgun-agent && \ + git checkout -q ${FUEL_NAILGUN_AGENT_COMMIT} + @cd ${root}/upstream/fuel-web && \ + git checkout -q ${NAILGUN_COMMIT} @git submodule -q foreach 'mkdir -p ${root}/patches/$$name' @git submodule -q foreach 'git tag armband-workbench-root' @git submodule -q foreach 'git checkout -q -b armband-workbench' -- cgit 1.2.3-korg