This description expects the NED to be built with the structure
as defined by the ncs-make-package
.
If this doesn't hold then the adaptations has to be done
otherwise with an outcome that resembles the one described below.
For simple netconf NEDS use the ncs-make-package
to generate a new package:
ncs-make-package --no-java --no-python --dest /tmp/new \ --netconf-ned src/yang XXXX-YYYY
Use the generated package in /tmp/new
as is or use it as
a guide how a package is structured and the Makefile
is written.
If the simple case is not applicable then for the general case follow the below steps:
-
package-meta-data.xml
In the top directory of the NED:
mv package-meta-data.xml src/package-meta-data.xml.in
-
Makefile
In
src/Makefile
add the following make variable at the top after the other make variables:NED_ID_ARG = $(shell [ -x ${NCS_DIR}/support/ned-ncs-ned-id-arg ] && \ ${NCS_DIR}/support/ned-ncs-ned-id-arg package-meta-data.xml.in)
In
src/Makefile
add the following dependencies first among dependencies to theall:
target:../package-meta-data.xml ned-id-file
and to the
clean:
target add:rm -f ../package-meta-data.xml
Add the new targets:
../package-meta-data.xml: package-meta-data.xml.in rm -rf $@ if [ -x ${NCS_DIR}/support/ned-make-package-meta-data ]; then \ ${NCS_DIR}/support/ned-make-package-meta-data $<; \ else \ cp $< $@; \ fi chmod +w $@ ned-id-file: if [ -x ${NCS_DIR}/support/ned-make-package-meta-data ]; then \ echo -n "$(NED_ID_FILE) is built by: "; \ echo "support/ned-make-package-meta-data"; \ fi
Add the make variable
$(NED_ID_ARG)
as an argument to all targets which arencsc
compiled. Look for everything which uses the option '--ncs-device-type' -
Verify changes
Compile code for both versions < 5.0 and versions >= 5.0:
make -C src make -C src
twice without any errors, then do:
make -C src clean make -C src clean
twice without any errors.
Everything now should have been cleaned, if this is not the case update the
clean:
of the relevantMakefile