From 380e975b1b93e83705c8ed30197b1c23f8193814 Mon Sep 17 00:00:00 2001 From: Miruna Paun Date: Mon, 25 Sep 2017 13:57:48 +0200 Subject: Create new version of NFV Core 1.0 Installation Guide USERDOCAP-240 Signed-off-by: Miruna Paun --- init.mk | 49 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 6 deletions(-) (limited to 'init.mk') diff --git a/init.mk b/init.mk index 1c3035c..0950c27 100644 --- a/init.mk +++ b/init.mk @@ -1,5 +1,10 @@ -# ver R1.00/2017-03-16 Creation of this file -# ver R2.00/2017-04-05 Updated the docbuild.git clone command. +# Makefile including this should first set nondefault BRANCH_DOCENEACOMMON before including it +# and should have targets init: s_docbuild and optional initcommon: s_doceneacommon +# Typically let doc: depend on init and initcommon inside Makefile +# Manually optionally set GLOBALTMPCLONEROOT to yes or to a parent dir for tmpcommon +# This init.mk file ver +# R1.00/2016-04-29 +# R2.00/2017-03-30 changed linux/documentation.git and it's old branch to linux/el_releases-common.git and it's new branch ifeq ($(VERBOSE),yes) VERB := @@ -10,6 +15,15 @@ endif #Git repositories to be cloned REPO_DOCBUILD := build/docbuild.git NAME_DOCBUILD := docbuild +REPO_DOCENEACOMMON := linux/el_releases-common.git +NAME_DOCENEACOMMON := doceneacommon + +# Set nondefault BRANCH_DOCENEACOMMON in Makefile +BRANCH_DOCENEACOMMON ?= master +# Separate clones of el_releases-common.git with different branches, needed if cloned globally with risk that different distros can be at same place +ifneq ($(BRANCH_DOCENEACOMMON),master) +NAME_DOCENEACOMMON := doceneacommon_$(BRANCH_DOCENEACOMMON) +endif GLOBALTMPCLONEROOT = ../../tmpcommon ifeq ($(BOOK_GLOBALCLONEROOT),) @@ -26,26 +40,38 @@ ifeq ($(wildcard $(DIR_TMPCLONEROOT)),) $(error Parent of selected clone root does not exist ($(DIR_TMPCLONEROOT))) endif -.PHONY: initbuild usageinit cleaninit +.PHONY: initbuild initcommon usageinit cleaninit # Keep usageinit as default target here to avoid init by mistake usageinit: docusage - @echo 'make initbuild Create s_docbuild and if it does not exist, clone docbuild.git' + @echo 'make initbuild Create s_docbuild and if not exists, clone docbuild.git' + @echo 'make initcommon Create s_doceneacommon and if not exists, clone el_releases-common.git' @echo ' Default clone in tmpcommon' @echo ' BOOK_GLOBALCLONEROOT=yes Clone in $(GLOBALTMPCLONEROOT)' @echo ' BOOK_GLOBALCLONEROOT=parentdir Clone in parentdir/tmpcommon' - + @echo ' Default branch for el_releases-common.git is master' + @echo ' BRANCH_DOCENEACOMMON=... If another branch, Makefile should set this' @echo 'make pullbuild git pull in s_docbuild' + @echo 'make pullcommon git pull in s_doceneacommon' @echo 'make cleaninit Delete all s_* symlinks and local tmpcommon/' +# MOVE these to Makefile and set also non-default BRANCH_DOCENEACOMMON in Makefile initbuild: s_docbuild +initcommon: s_doceneacommon pullbuild: $(VERB)if [ ! -d s_docbuild ]; then echo "ERROR: No s_docbuild exists?" ; exit 10 ; fi $(VERB)cd s_docbuild ; git pull +pullcommon: + $(VERB)if [ ! -d s_doceneacommon ]; then echo "ERROR: No s_doceneacommon exists?" ; exit 10 ; fi + $(VERB)cd s_doceneacommon ; git pull + s_docbuild: $(TMPCLONEROOT)/$(NAME_DOCBUILD) $(VERB)rm s_docbuild 2>/dev/null; ln -s $(TMPCLONEROOT)/$(NAME_DOCBUILD) s_docbuild +s_doceneacommon: $(TMPCLONEROOT)/$(NAME_DOCENEACOMMON) + $(VERB)rm s_doceneacommon 2>/dev/null; ln -s $(TMPCLONEROOT)/$(NAME_DOCENEACOMMON) s_doceneacommon + $(TMPCLONEROOT)/$(NAME_DOCBUILD): $(VERB)if [ ! -d "$(TMPCLONEROOT)" ] ; then mkdir -p "$(TMPCLONEROOT)" ; fi $(VERB)if [ -d "$(TMPCLONEROOT)/$(NAME_DOCBUILD)" ] ; then \ @@ -57,7 +83,18 @@ $(TMPCLONEROOT)/$(NAME_DOCBUILD): git clone -b master git@git.enea.se:$(REPO_DOCBUILD) $(NAME_DOCBUILD) ; \ fi +$(TMPCLONEROOT)/$(NAME_DOCENEACOMMON): + $(VERB)if [ ! -d "$(TMPCLONEROOT)" ] ; then mkdir -p "$(TMPCLONEROOT)" ; fi + $(VERB)if [ -d "$(TMPCLONEROOT)/$(NAME_DOCENEACOMMON)" ] ; then \ + echo "Already exists $(TMPCLONEROOT)/$(NAME_DOCENEACOMMON)" ; \ + echo "Doing git pull instead"; cd $(TMPCLONEROOT)/$(NAME_DOCENEACOMMON) ; git pull ; \ + else \ + echo "Cloning $(REPO_DOCENEACOMMON) in $(TMPCLONEROOT) as $(NAME_DOCENEACOMMON)" ; \ + cd "$(TMPCLONEROOT)"; \ + git clone -b $(BRANCH_DOCENEACOMMON) git@git.enea.com:$(REPO_DOCENEACOMMON) $(NAME_DOCENEACOMMON) ; \ + fi + cleaninit: - @echo "Clean only local tmpcommon/ and all local temporary symlinks s_docbuild etc." + @echo "Clean only local tmpcommon/ and all local temporary symlinks s_docbuild s_targets etc." $(VERB)rm -rf tmpcommon 2>/dev/null ; true $(VERB)rm s_* 2>/dev/null ; true -- cgit v1.2.3-54-g00ecf