forked from sonic-net/sonic-mgmt-framework
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from project-arlo/cvl_changes_sonic_yang
CVL changes for SONiC YANG
- Loading branch information
Showing
41 changed files
with
2,330 additions
and
1,159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
TOPDIR := ../../../ | ||
SONIC_YANGAPI_DIR := $(TOPDIR)/build/yaml | ||
SONIC_YANGDIR := $(TOPDIR)/models/yang/sonic | ||
SONIC_YANGDIR_DEVIATION := $(TOPDIR)/models/yang/sonic/deviation | ||
SONIC_YANGDIR_COMMON := $(TOPDIR)/models/yang/sonic/common | ||
SONIC_YANGDIR_COMMON_IETF := $(TOPDIR)/models/yang/sonic/common/ietf | ||
SONIC_YANG_MOD_FILES := $(shell find $(SONIC_YANGDIR) -maxdepth 1 -name '*.yang' | sort) | ||
SONIC_YANG_COMMON_FILES := $(shell find $(SONIC_YANGDIR_COMMON) -name '*.yang' | sort) | ||
SONIC_YANG_COMMON_FILES += $(shell find $(SONIC_YANGDIR_COMMON_IETF) -name '*.yang' | sort) | ||
|
||
SONIC_TOOLS_DIR := $(TOPDIR)/tools | ||
SONIC_PYANG_DIR := $(SONIC_TOOLS_DIR)/pyang | ||
SONIC_PYANG_PLUGIN_DIR := $(SONIC_PYANG_DIR)/pyang_plugins | ||
SONIC_PYANG_BIN := pyang | ||
|
||
all: yamlGen allyangs.tree allyangs_tree.html | ||
|
||
#yamlGen: $(SONIC_YANGAPI_DIR)/.done | ||
|
||
allyangs.tree: $(SONIC_YANG_MOD_FILES) $(SONIC_YANG_COMMON_FILES) | ||
$(SONIC_PYANG_BIN) \ | ||
-f tree \ | ||
-o $(SONIC_YANGDIR)/$@ \ | ||
-p $(SONIC_YANGDIR_COMMON):$(SONIC_YANGDIR) \ | ||
$(SONIC_YANG_MOD_FILES) | ||
@echo "+++++ Generation of YANG tree for Sonic Yang modules completed +++++" | ||
|
||
allyangs_tree.html: $(SONIC_YANG_MOD_FILES) $(SONIC_YANG_COMMON_FILES) | ||
$(SONIC_PYANG_BIN) \ | ||
-f jstree \ | ||
-o $(SONIC_YANGDIR)/$@ \ | ||
-p $(SONIC_YANGDIR_COMMON):$(SONIC_YANGDIR) \ | ||
$(SONIC_YANG_MOD_FILES) | ||
@echo "+++++ Generation of HTML tree for Sonic Yang modules completed +++++" | ||
|
||
#====================================================================== | ||
# Generate YAML files for SONiC YANG modules | ||
#====================================================================== | ||
yamlGen: | ||
@echo "+++++ Generating YAML files for Sonic Yang modules +++++" | ||
mkdir -p $(SONIC_YANGAPI_DIR) | ||
$(SONIC_PYANG_BIN) \ | ||
-f swaggerapi \ | ||
--outdir $(SONIC_YANGAPI_DIR) \ | ||
--plugindir $(SONIC_PYANG_PLUGIN_DIR) \ | ||
-p $(SONIC_YANGDIR_COMMON):$(SONIC_YANGDIR) \ | ||
$(SONIC_YANG_MOD_FILES) | ||
@echo "+++++ Generation of YAML files for Sonic Yang modules completed +++++" | ||
|
||
clean: | ||
@echo "Removing files ..." | ||
rm -rf $(SONIC_YANGAPI_DIR) | ||
rm -rf allyangs.tree allyangs_tree.html |
Oops, something went wrong.