blob: 86f4a7302f6b95f31e71841a7814d850509c3742 [file] [log] [blame]
Joey Armstronga3d896a2023-02-17 08:33:46 -05001# -*- makefile -*-
2## -----------------------------------------------------------------------
3## Intent: Generate an RST formatted table with URLs given a list of
4## voltha resource names.
5## -----------------------------------------------------------------------
6## .. list-table:: VOLTHA Docker Images
7## :widths: 20, 5, 40
8## :header-rows: 1
9##
10## * - Image
11## - Date
12## - Description
13# * - `voltha/voltha-envoy <https://hub.docker.com/r/voltha/voltha-envoy>`_
14## -----------------------------------------------------------------------
15
16##-------------------##
17##---] GLOBALS [---##
18##-------------------##
19HIDE ?= @
20
21## ------------------------------------------------------------------------
22## Intent: Generate a stream of tokens:
23## o slurp file
24## o remove comments and blank lines
25## ------------------------------------------------------------------------
26format-list = cat "$1" \
27 | cut -d'\#' -f1 \
28 | grep '[[:alnum:]]'
29
30##-------------------##
31##---] TARGETS [---##
32##-------------------##
33all:
34
35## -----------------------------------------------------------------------
36## Intent: Invoke all named generate table targets
37## -----------------------------------------------------------------------
38gen-all += docker-gen
39gen-all += gerrit-gen
40gen-all += github-gen
41gen-all : $(gen-all)
42
43## -----------------------------------------------------------------------
44## Intent: Generate an rst table for VOLTHA docker images.
45## -----------------------------------------------------------------------
46docker-src := sources/voltha.docker
47docker-url := https://hub.docker.com/r/voltha/{}
48docker-gen:
49 $(HIDE)$(call format-list,$(docker-src)) \
50 | xargs -I'{}' echo -e ' * - `{} <$(docker-url)>\n -`_' \
51 | tee $@.log
52
53## -----------------------------------------------------------------------
54## Intent: Generate an rst table for VOLTHA gerrit repositories
55## -----------------------------------------------------------------------
56gerrit-src := sources/voltha.gerrit
57gerrit-url := https://gerrit.opencord.org/plugins/gitiles/{}
58gerrit-gen:
59 $(HIDE)$(call format-list,$(gerrit-src)) \
60 | xargs -I'{}' echo -e ' * - `{} <$(gerrit-url)>`_\n -' \
61 | tee $@.log
62
63## -----------------------------------------------------------------------
64## Intent: Generate an rst table for VOLTHA github repositories
65## -----------------------------------------------------------------------
66github-src := sources/voltha.github
67github-url := /dev/null
68github-gen:
69
70## -----------------------------------------------------------------------
71## Intent: Remove generated targets
72## -----------------------------------------------------------------------
73clean:
74 $(RM) *.log
75
76## -----------------------------------------------------------------------
77## Intent: Display help text
78## -----------------------------------------------------------------------
79help ::
80 @echo "Usage: $(MAKE) [options] [target] ..."
81 @echo "Targets:"
82 @echo " clean Remove generated targets"
83
84 @echo
85 @echo "[RST GEN] - Generate an rst table containing"
86 @echo " gen-all Generate all VOLTHA rst tables"
87 @echo " gen-docker VOLTHA Docker images"
88 @echo " gen-gerrit VOLTHA Gerrit Repositories"
89 @echo " gen-github VOLTHA Github Repositories"
90
91# [EOF]