]> git.proxmox.com Git - mirror_ovs.git/blob - vswitchd/automake.mk
vswitchd: Install vswitch.ovsschema to $(pkgdatadir).
[mirror_ovs.git] / vswitchd / automake.mk
1 sbin_PROGRAMS += vswitchd/ovs-vswitchd
2 man_MANS += \
3 vswitchd/ovs-vswitchd.8 \
4 vswitchd/ovs-brcompatd.8
5 DISTCLEANFILES += \
6 vswitchd/ovs-vswitchd.8 \
7 vswitchd/ovs-brcompatd.8
8
9 vswitchd_ovs_vswitchd_SOURCES = \
10 vswitchd/bridge.c \
11 vswitchd/bridge.h \
12 vswitchd/ovs-vswitchd.c \
13 vswitchd/system-stats.c \
14 vswitchd/system-stats.h \
15 vswitchd/vswitch-idl.c \
16 vswitchd/vswitch-idl.h \
17 vswitchd/xenserver.c \
18 vswitchd/xenserver.h
19 vswitchd_ovs_vswitchd_LDADD = \
20 ofproto/libofproto.a \
21 lib/libsflow.a \
22 lib/libopenvswitch.a \
23 $(SSL_LIBS)
24 EXTRA_DIST += \
25 vswitchd/ovs-vswitchd.8.in \
26 vswitchd/INTERNALS
27
28 if HAVE_NETLINK
29 sbin_PROGRAMS += vswitchd/ovs-brcompatd
30 vswitchd_ovs_brcompatd_SOURCES = \
31 vswitchd/ovs-brcompatd.c \
32 vswitchd/vswitch-idl.c \
33 vswitchd/vswitch-idl.h
34 vswitchd_ovs_brcompatd_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
35 endif
36 EXTRA_DIST += vswitchd/ovs-brcompatd.8.in
37
38 # vswitch schema and IDL
39 OVSIDL_BUILT += \
40 vswitchd/vswitch-idl.c \
41 vswitchd/vswitch-idl.h \
42 vswitchd/vswitch-idl.ovsidl
43 VSWITCH_IDL_FILES = vswitchd/vswitch.ovsschema vswitchd/vswitch-idl.ann
44 EXTRA_DIST += $(VSWITCH_IDL_FILES)
45 pkgdata_DATA += vswitchd/vswitch.ovsschema
46 vswitchd/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
47 $(OVSDB_IDLC) -C $(srcdir) annotate $(VSWITCH_IDL_FILES) > $@.tmp
48 mv $@.tmp $@
49
50 # vswitch E-R diagram
51 #
52 # There are two complications here. First, if "python" or "dot" is not
53 # available, then we have to just use the existing diagram. Second, different
54 # "dot" versions produce slightly different output for the same input, but we
55 # don't want to gratuitously change vswitch.pic if someone tweaks the schema in
56 # some minor way that doesn't affect the table structure. To avoid that we
57 # store a checksum of vswitch.gv in vswitch.pic and only regenerate vswitch.pic
58 # if vswitch.gv actually changes.
59 $(srcdir)/vswitchd/vswitch.gv: ovsdb/ovsdb-dot.in vswitchd/vswitch.ovsschema
60 if HAVE_PYTHON
61 $(OVSDB_DOT) $(srcdir)/vswitchd/vswitch.ovsschema > $@
62 else
63 touch $@
64 endif
65 $(srcdir)/vswitchd/vswitch.pic: $(srcdir)/vswitchd/vswitch.gv ovsdb/dot2pic
66 if HAVE_DOT
67 sum=`cksum < $(srcdir)/vswitchd/vswitch.gv`; \
68 if grep "$$sum" $@ >/dev/null 2>&1; then \
69 echo "vswitch.gv unchanged, not regenerating vswitch.pic"; \
70 touch $@; \
71 else \
72 echo "regenerating vswitch.pic"; \
73 (echo ".\\\" Generated from vswitch.gv with cksum \"$$sum\""; \
74 dot -T plain < $(srcdir)/vswitchd/vswitch.gv \
75 | $(srcdir)/ovsdb/dot2pic) > $@; \
76 fi
77 else
78 touch $@
79 endif
80 EXTRA_DIST += vswitchd/vswitch.gv vswitchd/vswitch.pic
81
82 # vswitch schema documentation
83 EXTRA_DIST += vswitchd/vswitch.xml
84 dist_man_MANS += vswitchd/ovs-vswitchd.conf.db.5
85 vswitchd/ovs-vswitchd.conf.db.5: \
86 ovsdb/ovsdb-doc.in vswitchd/vswitch.xml vswitchd/vswitch.ovsschema \
87 $(srcdir)/vswitchd/vswitch.pic
88 $(OVSDB_DOC) \
89 --title="ovs-vswitchd.conf.db" \
90 --er-diagram=$(srcdir)/vswitchd/vswitch.pic \
91 $(srcdir)/vswitchd/vswitch.ovsschema \
92 $(srcdir)/vswitchd/vswitch.xml > $@.tmp
93 mv $@.tmp $@
94
95 # Version checking for vswitch.ovsschema.
96 ALL_LOCAL += vswitchd/vswitch.ovsschema.stamp
97 vswitchd/vswitch.ovsschema.stamp: vswitchd/vswitch.ovsschema
98 @sum=`sed '/cksum/d' $? | cksum`; \
99 expected=`sed -n 's/.*"cksum": "\(.*\)".*/\1/p' $?`; \
100 if test "X$$sum" = "X$$expected"; then \
101 touch $@; \
102 else \
103 ln=`sed -n '/"cksum":/=' $?`; \
104 echo >&2 "$?:$$ln: checksum \"$$sum\" does not match (you should probably update the version number and fix the checksum)"; \
105 exit 1; \
106 fi
107 CLEANFILES += vswitchd/vswitch.ovsschema.stamp