-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
139 lines (110 loc) · 4.22 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# -*- makefile -*-
## -----------------------------------------------------------------------
## Intent: Targets in this makefile will clone all voltha repositories
## and will invoke a list of makefile targets against each.
## -----------------------------------------------------------------------
null :=#
space :=$(null) $(null)
HIDE ?= @
tab := $(null) $(null)
\t := $(NULL) $(NULL)
define newln :=
endef
include config.mk
$(if $(NO_LINT_LICENSE),$(null),$(eval check += license))
$(if $(COPYRIGHTS),$(eval check += copyrights))
check += versions-chart
check += voltha-protos
check += voltha-lib-go
## -----------------------------------------------------------------------
## [DEBUG] Display hierarchy details
## -----------------------------------------------------------------------
todos = $(wildcard */makefile)
$(foreach todo_raw,$(todos),\
$(foreach todo,$(subst /makefile,$(null),$(todo_raw)),\
$(info ** foreach.todo = $(todo))\
$(if $(debug),\
$(info \
$$(eval \
$(todo)-%:$(newline)\
$(\t)$$(MAKE) --no-print-directory -C $(todo) $$@$(newline)\
)\
))\
$(eval \
$(todo)-%:$(newline)\
$(\t)$$(MAKE) --no-print-directory -C $(todo) $$@$(newline)\
)\
)\
)
check-subdir += voltha-protos-check
check-subdir : $(check-subdir)
.PHONY: $(check)
all += triage-build
## -----------------------------------------------------------------------
## -----------------------------------------------------------------------
all: $(all)
triage-build :
bin/triage-build.sh
## -----------------------------------------------------------------------
## -----------------------------------------------------------------------
edit:
./edit.sh
.PHONY: repositories
repositories:
@$(MAKE) --quiet -C $@ --no-print-directory
## -----------------------------------------------------------------------
## Intent: Iterate and perform validation checks
## -----------------------------------------------------------------------
check : $(check) $(check-subdir)
$(check) : sandbox
$(MAKE) -C $@ check
## -----------------------------------------------------------------------
## -----------------------------------------------------------------------
.PHONY: sandbox
sandbox:
./sandbox.sh --sandbox $(PWD)/sandbox
## -----------------------------------------------------------------------
## -----------------------------------------------------------------------
clean ::
$(RM) -r branches
$(RM) -r sandbox
## -----------------------------------------------------------------------
## -----------------------------------------------------------------------
sterile :: clean
## -----------------------------------------------------------------------
## -----------------------------------------------------------------------
help-verbose += voltha-protos-help
help-verbose : $(help-verbose)
help ::
@echo "USAGE: $(MAKE)"
@printf ' %-30.30s %s\n' 'sandbox'\
'Clone all voltha repos for validation'
@printf ' %-30.30s %s\n' 'edit'\
'Load files of interest into an editor'
@printf ' %-30.30s %s\n' 'check'\
'Iterate over subdirs and perform repository validation checks'
@printf ' %-30.30s %s\n' 'check-help'\
'Display extended help for check targets'
## -----------------------------------------------------------------------
## -----------------------------------------------------------------------
check-help:
@printf ' %-30.30s %s\n' 'versions-chart-check'\
'Validate chart file version string dependencies'
@printf ' %-30.30s %s\n' 'voltha-protos-check'\
'Validate voltha-protos content'
stem-suffix-targets += versions-chart-%
stem-suffix-targets += voltha-protos-%
check-targets : $(subst -%,-check,$(stem-suffix-targets))
# $@=versions-chart-check: $*=check
$(stem-suffix-targets) : sandbox
$(MAKE) --no-print-directory -C $(subst -$*,$(null),$@) $*
## ---------------------------------------------------------------------------
## ---------------------------------------------------------------------------
%-help:
# make -C voltha-protos voltha-protos-help
$(HIDE)$(MAKE) --no-print-directory -C $* $@
## ---------------------------------------------------------------------------
## ---------------------------------------------------------------------------
view ::
$(HIDE)$(MAKE) --no-print-directory -C artifacts $@
# [EOF]