blob: 8d9e6152e61873196ed1c0b753e382b393ba828c [file] [log] [blame]
Zsolt Harasztib49dda92016-11-11 09:42:48 -08001#
2# Copyright 2016 the original author or authors.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17ifeq ($(VOLTHA_BASE)_set,_set)
18$(error To get started, please source the env.sh file)
19endif
20
21default: build
22
23GENERATED_SVG_FILES := \
24 pon-requirements/reference-inband.svg \
25 pon-requirements/reference-internal.svg \
26 pon-requirements/olt-states.svg
27
28build: checkdiag $(GENERATED_SVG_FILES)
29 @echo "Building drawings"
30
31%.svg: %.block
32 blockdiag -T svg -o $@ $<
33
34%.svg: %.seq
35 seqdiag -T svg -o $@ $<
36
37clean:
38 rm -f $(GENERATED_SVG_FILES)
39
40checkdiag:
41 @if ! blockdiag --version > /dev/null; then \
42 echo "Installing blockdiag..."; \
43 pip install blockdiag; \
44 fi
45 @if ! seqdiag --version > /dev/null; then \
46 echo "Installing seqdiag..."; \
47 pip install seqdiag; \
48 fi
49 @echo "Tools ready"
50