From: garciadeblas Date: Sun, 28 Oct 2018 15:05:18 +0000 (+0100) Subject: Added dependencies on IETF YANG files at build time: ietf-yang-types.yang, ietf-inet... X-Git-Tag: v5.0.0~6 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=a17441907cd7fa97476d6f9d01989a56344bbb6e;p=osm%2FIM.git Added dependencies on IETF YANG files at build time: ietf-yang-types.yang, ietf-inet-types Change-Id: I039d44856ba19cbab2036d8a2b41419e8953a9fd Signed-off-by: garciadeblas --- diff --git a/.gitignore b/.gitignore index 434fd9c..b8b7d02 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ dists pool .idea debian/osm-imdocs.install +models/yang/ietf-yang-types.yang +models/yang/ietf-inet-types.yang diff --git a/Makefile b/Makefile index 0d12dc0..abab90e 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ # NOTE: pyang and pyangbind are required for build -.PHONY: all clean package trees deps +.PHONY: all clean package trees deps yang-ietf PYANG:= pyang PYBINDPLUGIN:=$(shell /usr/bin/env python3 -c \ 'import pyangbind; import os; print("{}/plugin".format(os.path.dirname(pyangbind.__file__)))') @@ -48,32 +48,36 @@ $(OUT_DIR): $(TREES_DIR): $(Q)mkdir -p $(TREES_DIR) -%.py: $(OUT_DIR) +%.py: $(OUT_DIR) yang-ietf $(Q)echo generating $@ from $*.yang $(Q)pyang $(PYANG_OPTIONS) --path $(MODEL_DIR) --plugindir $(PYBINDPLUGIN) -f pybind -o $(OUT_DIR)/$@ $(MODEL_DIR)/$*.yang -%.tree.txt: $(TREES_DIR) +%.tree.txt: $(TREES_DIR) yang-ietf $(Q)echo generating $@ from $*.yang $(Q)pyang $(PYANG_OPTIONS) --path $(MODEL_DIR) -f tree -o $(TREES_DIR)/$@ $(MODEL_DIR)/$*.yang -%.html: $(TREES_DIR) +%.html: $(TREES_DIR) yang-ietf $(Q)echo generating $@ from $*.yang $(Q)pyang $(PYANG_OPTIONS) --path $(MODEL_DIR) -f jstree -o $(TREES_DIR)/$@ $(MODEL_DIR)/$*.yang $(Q)sed -r -i 's|data\:image/gif\;base64,R0lGODlhS.*RCAA7|https://osm.etsi.org/images/OSM-logo.png\" width=\"175\" height=\"60|g' $(TREES_DIR)/$@ $(Q)sed -r -i 's|||g' $(TREES_DIR)/$@ -%.rec.tree.txt: $(TREES_DIR) +%.rec.tree.txt: $(TREES_DIR) yang-ietf $(Q)echo generating $@ from $*.yang $(Q)pyang $(PYANG_OPTIONS) --path $(MODEL_DIR) -f tree -o $(TREES_DIR)/$@ $(MODEL_DIR)/$*.yang $(Q)mv $(TREES_DIR)/$@ $(TREES_DIR)/$*.tree.txt -%.rec.html: $(TREES_DIR) +%.rec.html: $(TREES_DIR) yang-ietf $(Q)echo generating $@ from $*.yang $(Q)pyang $(PYANG_OPTIONS) --path $(MODEL_DIR) -f jstree -o $(TREES_DIR)/$@ $(MODEL_DIR)/rw-project.yang $(MODEL_DIR)/$*.yang $(Q)sed -r -i 's|data\:image/gif\;base64,R0lGODlhS.*RCAA7|https://osm.etsi.org/images/OSM-logo.png\" width=\"175\" height=\"60|g' $(TREES_DIR)/$@ $(Q)sed -r -i 's|||g' $(TREES_DIR)/$@ $(Q)mv $(TREES_DIR)/$@ $(TREES_DIR)/$*.html +yang-ietf: + $(Q)wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-yang-types%402013-07-15.yang -O models/yang/ietf-yang-types.yang + $(Q)wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-inet-types%402013-07-15.yang -O models/yang/ietf-inet-types.yang + package: tox -e build tox -e build3