diff options
author | Miruna Paun <Miruna.Paun@enea.com> | 2017-04-07 12:27:55 +0200 |
---|---|---|
committer | Miruna Paun <Miruna.Paun@enea.com> | 2017-04-07 12:27:55 +0200 |
commit | 74c97c90a9fa10ebad46ec00061da9e2578b33a7 (patch) | |
tree | 9a6169d87c2b9ff598e83ae218c54c8400cefb78 /init.mk | |
download | doc-enea-nfv-74c97c90a9fa10ebad46ec00061da9e2578b33a7.tar.gz |
Updated ENFV (COSNOS) Installation Guide
COSNOSCR-318 seeking to complete first time push
Diffstat (limited to 'init.mk')
-rw-r--r-- | init.mk | 63 |
1 files changed, 63 insertions, 0 deletions
@@ -0,0 +1,63 @@ | |||
1 | # ver R1.00/2017-03-16 Creation of this file | ||
2 | # ver R2.00/2017-04-05 Updated the docbuild.git clone command. | ||
3 | |||
4 | ifeq ($(VERBOSE),yes) | ||
5 | VERB := | ||
6 | else | ||
7 | VERB := @ | ||
8 | endif | ||
9 | |||
10 | #Git repositories to be cloned | ||
11 | REPO_DOCBUILD := build/docbuild.git | ||
12 | NAME_DOCBUILD := docbuild | ||
13 | |||
14 | GLOBALTMPCLONEROOT = ../../tmpcommon | ||
15 | ifeq ($(BOOK_GLOBALCLONEROOT),) | ||
16 | TMPCLONEROOT := tmpcommon | ||
17 | else | ||
18 | ifeq ($(BOOK_GLOBALCLONEROOT),yes) | ||
19 | TMPCLONEROOT := $(GLOBALTMPCLONEROOT) | ||
20 | else | ||
21 | TMPCLONEROOT := $(BOOK_GLOBALCLONEROOT)/tmpcommon | ||
22 | endif | ||
23 | endif | ||
24 | DIR_TMPCLONEROOT := $(dir $(TMPCLONEROOT)) | ||
25 | ifeq ($(wildcard $(DIR_TMPCLONEROOT)),) | ||
26 | $(error Parent of selected clone root does not exist ($(DIR_TMPCLONEROOT))) | ||
27 | endif | ||
28 | |||
29 | .PHONY: initbuild usageinit cleaninit | ||
30 | # Keep usageinit as default target here to avoid init by mistake | ||
31 | |||
32 | usageinit: docusage | ||
33 | @echo 'make initbuild Create s_docbuild and if it does not exist, clone docbuild.git' | ||
34 | @echo ' Default clone in tmpcommon' | ||
35 | @echo ' BOOK_GLOBALCLONEROOT=yes Clone in $(GLOBALTMPCLONEROOT)' | ||
36 | @echo ' BOOK_GLOBALCLONEROOT=parentdir Clone in parentdir/tmpcommon' | ||
37 | |||
38 | @echo 'make pullbuild git pull in s_docbuild' | ||
39 | @echo 'make cleaninit Delete all s_* symlinks and local tmpcommon/' | ||
40 | |||
41 | |||
42 | initbuild: s_docbuild | ||
43 | pullbuild: | ||
44 | $(VERB)if [ ! -d s_docbuild ]; then echo "ERROR: No s_docbuild exists?" ; exit 10 ; fi | ||
45 | $(VERB)cd s_docbuild ; git pull | ||
46 | s_docbuild: $(TMPCLONEROOT)/$(NAME_DOCBUILD) | ||
47 | $(VERB)rm s_docbuild 2>/dev/null; ln -s $(TMPCLONEROOT)/$(NAME_DOCBUILD) s_docbuild | ||
48 | |||
49 | $(TMPCLONEROOT)/$(NAME_DOCBUILD): | ||
50 | $(VERB)if [ ! -d "$(TMPCLONEROOT)" ] ; then mkdir -p "$(TMPCLONEROOT)" ; fi | ||
51 | $(VERB)if [ -d "$(TMPCLONEROOT)/$(NAME_DOCBUILD)" ] ; then \ | ||
52 | echo "Already exists $(TMPCLONEROOT)/$(NAME_DOCBUILD)" ; \ | ||
53 | echo "Doing git pull instead"; cd $(TMPCLONEROOT)/$(NAME_DOCBUILD) ; git pull ; \ | ||
54 | else \ | ||
55 | echo "Cloning $(REPO_DOCBUILD) in $(TMPCLONEROOT)" ; \ | ||
56 | cd "$(TMPCLONEROOT)" ; \ | ||
57 | git clone -b master git@git.enea.se:$(REPO_DOCBUILD) $(NAME_DOCBUILD) ; \ | ||
58 | fi | ||
59 | |||
60 | cleaninit: | ||
61 | @echo "Clean only local tmpcommon/ and all local temporary symlinks s_docbuild etc." | ||
62 | $(VERB)rm -rf tmpcommon 2>/dev/null ; true | ||
63 | $(VERB)rm s_* 2>/dev/null ; true | ||