diff options
author | Miruna Paun <Miruna.Paun@enea.com> | 2017-09-25 13:57:48 +0200 |
---|---|---|
committer | Miruna Paun <Miruna.Paun@enea.com> | 2017-09-25 13:57:48 +0200 |
commit | 380e975b1b93e83705c8ed30197b1c23f8193814 (patch) | |
tree | 72e98d39867886b77c6008109080b4edb5ee410c /init.mk | |
parent | 2df2d1adbab4c4fbfda61700945d85ca3ce53d74 (diff) | |
download | doc-enea-nfv-380e975b1b93e83705c8ed30197b1c23f8193814.tar.gz |
Create new version of NFV Core 1.0 Installation Guide
USERDOCAP-240
Signed-off-by: Miruna Paun <Miruna.Paun@enea.com>
Diffstat (limited to 'init.mk')
-rw-r--r-- | init.mk | 49 |
1 files changed, 43 insertions, 6 deletions
@@ -1,5 +1,10 @@ | |||
1 | # ver R1.00/2017-03-16 Creation of this file | 1 | # Makefile including this should first set nondefault BRANCH_DOCENEACOMMON before including it |
2 | # ver R2.00/2017-04-05 Updated the docbuild.git clone command. | 2 | # and should have targets init: s_docbuild and optional initcommon: s_doceneacommon |
3 | # Typically let doc: depend on init and initcommon inside Makefile | ||
4 | # Manually optionally set GLOBALTMPCLONEROOT to yes or to a parent dir for tmpcommon | ||
5 | # This init.mk file ver | ||
6 | # R1.00/2016-04-29 | ||
7 | # 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 | ||
3 | 8 | ||
4 | ifeq ($(VERBOSE),yes) | 9 | ifeq ($(VERBOSE),yes) |
5 | VERB := | 10 | VERB := |
@@ -10,6 +15,15 @@ endif | |||
10 | #Git repositories to be cloned | 15 | #Git repositories to be cloned |
11 | REPO_DOCBUILD := build/docbuild.git | 16 | REPO_DOCBUILD := build/docbuild.git |
12 | NAME_DOCBUILD := docbuild | 17 | NAME_DOCBUILD := docbuild |
18 | REPO_DOCENEACOMMON := linux/el_releases-common.git | ||
19 | NAME_DOCENEACOMMON := doceneacommon | ||
20 | |||
21 | # Set nondefault BRANCH_DOCENEACOMMON in Makefile | ||
22 | BRANCH_DOCENEACOMMON ?= master | ||
23 | # Separate clones of el_releases-common.git with different branches, needed if cloned globally with risk that different distros can be at same place | ||
24 | ifneq ($(BRANCH_DOCENEACOMMON),master) | ||
25 | NAME_DOCENEACOMMON := doceneacommon_$(BRANCH_DOCENEACOMMON) | ||
26 | endif | ||
13 | 27 | ||
14 | GLOBALTMPCLONEROOT = ../../tmpcommon | 28 | GLOBALTMPCLONEROOT = ../../tmpcommon |
15 | ifeq ($(BOOK_GLOBALCLONEROOT),) | 29 | ifeq ($(BOOK_GLOBALCLONEROOT),) |
@@ -26,26 +40,38 @@ ifeq ($(wildcard $(DIR_TMPCLONEROOT)),) | |||
26 | $(error Parent of selected clone root does not exist ($(DIR_TMPCLONEROOT))) | 40 | $(error Parent of selected clone root does not exist ($(DIR_TMPCLONEROOT))) |
27 | endif | 41 | endif |
28 | 42 | ||
29 | .PHONY: initbuild usageinit cleaninit | 43 | .PHONY: initbuild initcommon usageinit cleaninit |
30 | # Keep usageinit as default target here to avoid init by mistake | 44 | # Keep usageinit as default target here to avoid init by mistake |
31 | 45 | ||
32 | usageinit: docusage | 46 | usageinit: docusage |
33 | @echo 'make initbuild Create s_docbuild and if it does not exist, clone docbuild.git' | 47 | @echo 'make initbuild Create s_docbuild and if not exists, clone docbuild.git' |
48 | @echo 'make initcommon Create s_doceneacommon and if not exists, clone el_releases-common.git' | ||
34 | @echo ' Default clone in tmpcommon' | 49 | @echo ' Default clone in tmpcommon' |
35 | @echo ' BOOK_GLOBALCLONEROOT=yes Clone in $(GLOBALTMPCLONEROOT)' | 50 | @echo ' BOOK_GLOBALCLONEROOT=yes Clone in $(GLOBALTMPCLONEROOT)' |
36 | @echo ' BOOK_GLOBALCLONEROOT=parentdir Clone in parentdir/tmpcommon' | 51 | @echo ' BOOK_GLOBALCLONEROOT=parentdir Clone in parentdir/tmpcommon' |
37 | 52 | @echo ' Default branch for el_releases-common.git is master' | |
53 | @echo ' BRANCH_DOCENEACOMMON=... If another branch, Makefile should set this' | ||
38 | @echo 'make pullbuild git pull in s_docbuild' | 54 | @echo 'make pullbuild git pull in s_docbuild' |
55 | @echo 'make pullcommon git pull in s_doceneacommon' | ||
39 | @echo 'make cleaninit Delete all s_* symlinks and local tmpcommon/' | 56 | @echo 'make cleaninit Delete all s_* symlinks and local tmpcommon/' |
40 | 57 | ||
41 | 58 | ||
59 | # MOVE these to Makefile and set also non-default BRANCH_DOCENEACOMMON in Makefile | ||
42 | initbuild: s_docbuild | 60 | initbuild: s_docbuild |
61 | initcommon: s_doceneacommon | ||
43 | pullbuild: | 62 | pullbuild: |
44 | $(VERB)if [ ! -d s_docbuild ]; then echo "ERROR: No s_docbuild exists?" ; exit 10 ; fi | 63 | $(VERB)if [ ! -d s_docbuild ]; then echo "ERROR: No s_docbuild exists?" ; exit 10 ; fi |
45 | $(VERB)cd s_docbuild ; git pull | 64 | $(VERB)cd s_docbuild ; git pull |
65 | pullcommon: | ||
66 | $(VERB)if [ ! -d s_doceneacommon ]; then echo "ERROR: No s_doceneacommon exists?" ; exit 10 ; fi | ||
67 | $(VERB)cd s_doceneacommon ; git pull | ||
68 | |||
46 | s_docbuild: $(TMPCLONEROOT)/$(NAME_DOCBUILD) | 69 | s_docbuild: $(TMPCLONEROOT)/$(NAME_DOCBUILD) |
47 | $(VERB)rm s_docbuild 2>/dev/null; ln -s $(TMPCLONEROOT)/$(NAME_DOCBUILD) s_docbuild | 70 | $(VERB)rm s_docbuild 2>/dev/null; ln -s $(TMPCLONEROOT)/$(NAME_DOCBUILD) s_docbuild |
48 | 71 | ||
72 | s_doceneacommon: $(TMPCLONEROOT)/$(NAME_DOCENEACOMMON) | ||
73 | $(VERB)rm s_doceneacommon 2>/dev/null; ln -s $(TMPCLONEROOT)/$(NAME_DOCENEACOMMON) s_doceneacommon | ||
74 | |||
49 | $(TMPCLONEROOT)/$(NAME_DOCBUILD): | 75 | $(TMPCLONEROOT)/$(NAME_DOCBUILD): |
50 | $(VERB)if [ ! -d "$(TMPCLONEROOT)" ] ; then mkdir -p "$(TMPCLONEROOT)" ; fi | 76 | $(VERB)if [ ! -d "$(TMPCLONEROOT)" ] ; then mkdir -p "$(TMPCLONEROOT)" ; fi |
51 | $(VERB)if [ -d "$(TMPCLONEROOT)/$(NAME_DOCBUILD)" ] ; then \ | 77 | $(VERB)if [ -d "$(TMPCLONEROOT)/$(NAME_DOCBUILD)" ] ; then \ |
@@ -57,7 +83,18 @@ $(TMPCLONEROOT)/$(NAME_DOCBUILD): | |||
57 | git clone -b master git@git.enea.se:$(REPO_DOCBUILD) $(NAME_DOCBUILD) ; \ | 83 | git clone -b master git@git.enea.se:$(REPO_DOCBUILD) $(NAME_DOCBUILD) ; \ |
58 | fi | 84 | fi |
59 | 85 | ||
86 | $(TMPCLONEROOT)/$(NAME_DOCENEACOMMON): | ||
87 | $(VERB)if [ ! -d "$(TMPCLONEROOT)" ] ; then mkdir -p "$(TMPCLONEROOT)" ; fi | ||
88 | $(VERB)if [ -d "$(TMPCLONEROOT)/$(NAME_DOCENEACOMMON)" ] ; then \ | ||
89 | echo "Already exists $(TMPCLONEROOT)/$(NAME_DOCENEACOMMON)" ; \ | ||
90 | echo "Doing git pull instead"; cd $(TMPCLONEROOT)/$(NAME_DOCENEACOMMON) ; git pull ; \ | ||
91 | else \ | ||
92 | echo "Cloning $(REPO_DOCENEACOMMON) in $(TMPCLONEROOT) as $(NAME_DOCENEACOMMON)" ; \ | ||
93 | cd "$(TMPCLONEROOT)"; \ | ||
94 | git clone -b $(BRANCH_DOCENEACOMMON) git@git.enea.com:$(REPO_DOCENEACOMMON) $(NAME_DOCENEACOMMON) ; \ | ||
95 | fi | ||
96 | |||
60 | cleaninit: | 97 | cleaninit: |
61 | @echo "Clean only local tmpcommon/ and all local temporary symlinks s_docbuild etc." | 98 | @echo "Clean only local tmpcommon/ and all local temporary symlinks s_docbuild s_targets etc." |
62 | $(VERB)rm -rf tmpcommon 2>/dev/null ; true | 99 | $(VERB)rm -rf tmpcommon 2>/dev/null ; true |
63 | $(VERB)rm s_* 2>/dev/null ; true | 100 | $(VERB)rm s_* 2>/dev/null ; true |