03-13-2018 04:50 AM - edited 03-01-2019 04:06 AM
The default MakeFile seems not compiling submodule yang file well, could anyone show me how to work with submodule yang in MakeFile?
Solved! Go to Solution.
03-13-2018 10:43 PM
well, I think I figured out a way to work with submodule yang.
need to update Makefile to
1. change FXS that it only includes main module yang file names. (submodule yang file out not to be included here).
2. uncomment YANGPATH and set the value as
$(NCS_DIR)/src/ncs/yang/:./yang/
03-13-2018 09:26 AM
Could you provide some more details on what you are trying to achieve, and what you mean byt the "default Makefile"? An example would help.
03-13-2018 08:50 PM
Hi Carl,
I was working with NSO 4.6, and use "
ncs-make-package --service-skeleton java-and-template mpl3-vpn" to generate a package, there is a default Makefile generated by the command under mpls-l3vpn/src/ to make java and yang files, I tried to use the Makefile to compile yang files which are list below
KUILIU-M-31C5:yang kuiliu$ ls
bharti-common-types.yang
mpls-l3vpn-vpn.yang
mpls-l3vpn-link.yang
mpls-l3vpn.yang
the mpls-l3vpn.yang is a main module file
mpls-l3vpn-vpn.yang and mpls-l3vpn-link.yang are submodule files
By running command "make clean all" and the error is
/Users/kuiliu/ncs-bin/./ncs-4.6/bin/ncsc `ls bharti-common-types-ann.yang > /dev/null 2>&1 && echo "-a bharti-common-types-ann.yang"` \
-c -o ../load-dir/bharti-common-types.fxs yang/bharti-common-types.yang
/Users/kuiliu/ncs-bin/./ncs-4.6/bin/ncsc --java-disable-prefix --exclude-enums --fail-on-warnings --java-package com.tot.mplsl3vpn.namespaces --emit-java java/src/com/tot/mplsl3vpn/namespaces/bharti-common-types.java ../load-dir/bharti-common-types.fxs
/Users/kuiliu/ncs-bin/./ncs-4.6/bin/ncsc `ls mpls-l3vpn-link-ann.yang > /dev/null 2>&1 && echo "-a mpls-l3vpn-link-ann.yang"` \
-c -o ../load-dir/mpls-l3vpn-link.fxs yang/mpls-l3vpn-link.yang
yang/mpls-l3vpn-link.yang:5: error: module 'mpls-l3vpn-vpn', revision '2017-07-19' not found
yang/mpls-l3vpn-link.yang:8: error: module 'bharti-common-types' not found
make: *** [../load-dir/mpls-l3vpn-link.fxs] Error 1
03-13-2018 10:43 PM
well, I think I figured out a way to work with submodule yang.
need to update Makefile to
1. change FXS that it only includes main module yang file names. (submodule yang file out not to be included here).
2. uncomment YANGPATH and set the value as
$(NCS_DIR)/src/ncs/yang/:./yang/
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide