diff options
author | Ansis Atteka <aatteka@nicira.com> | 2013-10-11 13:17:07 -0700 |
---|---|---|
committer | Ansis Atteka <aatteka@nicira.com> | 2013-10-17 14:33:14 -0700 |
commit | a5ae88ff8a276e86c842ac102145432662bf711a (patch) | |
tree | c43b644a5560278e81772ecb9eff8ac57dcf1879 /vswitchd/automake.mk | |
parent | e45e72f1de0e50c4f11e9a2351f5135c002dcce3 (diff) | |
download | openvswitch-a5ae88ff8a276e86c842ac102145432662bf711a.tar.gz |
ovsdb-doc: generate vswitch.[pic|gv] files only if dot tool is available
These are auto-generated files, so it would be better not to keep them
inside Open vSwitch repository.
Behaviour before this patch was that if dot tool was not present on
the system, then ovs-vswitchd.conf.db.5 would have used pre-generated
vswitch.pic file that was already checked in the git repository. After
this patch ovs-vswitchd.conf.db.5 will simply not have a dot diagram,
if dot was not present at the time when Open vSwitch was built.
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Diffstat (limited to 'vswitchd/automake.mk')
-rw-r--r-- | vswitchd/automake.mk | 44 |
1 files changed, 14 insertions, 30 deletions
diff --git a/vswitchd/automake.mk b/vswitchd/automake.mk index 6260a72d8..7d1ff5de9 100644 --- a/vswitchd/automake.mk +++ b/vswitchd/automake.mk @@ -25,46 +25,30 @@ pkgdata_DATA += vswitchd/vswitch.ovsschema # vswitch E-R diagram # -# There are two complications here. First, if "python" or "dot" is not -# available, then we have to just use the existing diagram. Second, different -# "dot" versions produce slightly different output for the same input, but we -# don't want to gratuitously change vswitch.pic if someone tweaks the schema in -# some minor way that doesn't affect the table structure. To avoid that we -# store a checksum of vswitch.gv in vswitch.pic and only regenerate vswitch.pic -# if vswitch.gv actually changes. -$(srcdir)/vswitchd/vswitch.gv: ovsdb/ovsdb-dot.in vswitchd/vswitch.ovsschema +# If "python" or "dot" is not available, then we do not add graphical diagram +# to the documentation. if HAVE_PYTHON +if HAVE_DOT +vswitchd/vswitch.gv: ovsdb/ovsdb-dot.in vswitchd/vswitch.ovsschema $(OVSDB_DOT) $(srcdir)/vswitchd/vswitch.ovsschema > $@ -else - touch $@ +vswitchd/vswitch.pic: vswitchd/vswitch.gv ovsdb/dot2pic + (dot -T plain < vswitchd/vswitch.gv | $(srcdir)/ovsdb/dot2pic -f 3) > $@; +VSWITCH_PIC = vswitchd/vswitch.pic +OVSDB_DOT_DIAGRAM_ARG = --er-diagram=$(VSWITCH_PIC) +DISTCLEANFILES += vswitchd/vswitch.gv vswitchd/vswitch.pic endif -$(srcdir)/vswitchd/vswitch.pic: $(srcdir)/vswitchd/vswitch.gv ovsdb/dot2pic -if HAVE_DOT - sum=`cksum < $(srcdir)/vswitchd/vswitch.gv`; \ - if grep "$$sum" $@ >/dev/null 2>&1; then \ - echo "vswitch.gv unchanged, not regenerating vswitch.pic"; \ - touch $@; \ - else \ - echo "regenerating vswitch.pic"; \ - (echo ".\\\" Generated from vswitch.gv with cksum \"$$sum\""; \ - dot -T plain < $(srcdir)/vswitchd/vswitch.gv \ - | $(srcdir)/ovsdb/dot2pic -f 3) > $@; \ - fi -else - touch $@ endif -EXTRA_DIST += vswitchd/vswitch.gv vswitchd/vswitch.pic # vswitch schema documentation EXTRA_DIST += vswitchd/vswitch.xml -DISTCLEANFILES += $(srcdir)/vswitchd/ovs-vswitchd.conf.db.5 -dist_man_MANS += vswitchd/ovs-vswitchd.conf.db.5 -$(srcdir)/vswitchd/ovs-vswitchd.conf.db.5: \ +DISTCLEANFILES += vswitchd/ovs-vswitchd.conf.db.5 +man_MANS += vswitchd/ovs-vswitchd.conf.db.5 +vswitchd/ovs-vswitchd.conf.db.5: \ ovsdb/ovsdb-doc vswitchd/vswitch.xml vswitchd/vswitch.ovsschema \ - $(srcdir)/vswitchd/vswitch.pic + $(VSWITCH_PIC) $(OVSDB_DOC) \ --title="ovs-vswitchd.conf.db" \ - --er-diagram=$(srcdir)/vswitchd/vswitch.pic \ + $(OVSDB_DOT_DIAGRAM_ARG) \ --version=$(VERSION) \ $(srcdir)/vswitchd/vswitch.ovsschema \ $(srcdir)/vswitchd/vswitch.xml > $@.tmp |