Commit 8c736f82 authored by Ladislav Lhotka's avatar Ladislav Lhotka

Add Makefile.

parent 509c6a71
hello.xml
model.tree
MODULES ?= $(wildcard *.yang)
.PHONY: all clean
all: model.tree
model.tree: hello.xml
pyang -f tree -o $@ -L $<
hello.xml: $(MODULES)
@echo '<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">' > $@
@echo '<capabilities>' >> $@
@echo '<capability>urn:ietf:params:netconf:base:1.1</capability>' >> $@
@for m in $(MODULES); do \
capa=$$(pyang -f capability --capability-entity $$m); \
if [ "$$capa" != "" ]; then \
echo "<capability>$$capa</capability>" >> $@; \
fi \
done
@echo '</capabilities>' >> $@
@echo '</hello>' >> $@
clean:
@rm hello.xml model.tree
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment