ofproto: Report time connected or disconnected, not time in rconn state.
[openvswitch] / 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 vswitchd/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
46         $(OVSDB_IDLC) -C $(srcdir) annotate $(VSWITCH_IDL_FILES) > $@.tmp
47         mv $@.tmp $@
48
49 # vswitch E-R diagram
50 #
51 # There are two complications here.  First, if "python" or "dot" is not
52 # available, then we have to just use the existing diagram.  Second, different
53 # "dot" versions produce slightly different output for the same input, but we
54 # don't want to gratuitously change vswitch.pic if someone tweaks the schema in
55 # some minor way that doesn't affect the table structure.  To avoid that we
56 # store a checksum of vswitch.gv in vswitch.pic and only regenerate vswitch.pic
57 # if vswitch.gv actually changes.
58 $(srcdir)/vswitchd/vswitch.gv: ovsdb/ovsdb-dot.in vswitchd/vswitch.ovsschema
59 if HAVE_PYTHON
60         $(OVSDB_DOT) $(srcdir)/vswitchd/vswitch.ovsschema > $@
61 else
62         touch $@
63 endif
64 $(srcdir)/vswitchd/vswitch.pic: $(srcdir)/vswitchd/vswitch.gv ovsdb/dot2pic
65 if HAVE_DOT
66         sum=`cksum < $(srcdir)/vswitchd/vswitch.gv`;                    \
67         if grep "$$sum" $@ >/dev/null 2>&1; then                        \
68           echo "vswitch.gv unchanged, not regenerating vswitch.pic";    \
69           touch $@;                                                     \
70         else                                                            \
71           echo "regenerating vswitch.pic";                              \
72           (echo ".\\\" Generated from vswitch.gv with cksum \"$$sum\""; \
73            dot -T plain < $(srcdir)/vswitchd/vswitch.gv                 \
74             | $(srcdir)/ovsdb/dot2pic) > $@;                            \
75         fi
76 else
77         touch $@
78 endif
79 EXTRA_DIST += vswitchd/vswitch.gv vswitchd/vswitch.pic
80
81 # vswitch schema documentation
82 EXTRA_DIST += vswitchd/vswitch.xml
83 dist_man_MANS += vswitchd/ovs-vswitchd.conf.db.5
84 vswitchd/ovs-vswitchd.conf.db.5: \
85         ovsdb/ovsdb-doc.in vswitchd/vswitch.xml vswitchd/vswitch.ovsschema \
86         $(srcdir)/vswitchd/vswitch.pic
87         $(OVSDB_DOC) \
88                 --title="ovs-vswitchd.conf.db" \
89                 --er-diagram=$(srcdir)/vswitchd/vswitch.pic \
90                 $(srcdir)/vswitchd/vswitch.ovsschema \
91                 $(srcdir)/vswitchd/vswitch.xml > $@.tmp
92         mv $@.tmp $@
93
94 # Version checking for vswitch.ovsschema.
95 ALL_LOCAL += vswitchd/vswitch.ovsschema.stamp
96 vswitchd/vswitch.ovsschema.stamp: vswitchd/vswitch.ovsschema
97         @sum=`sed '/cksum/d' $? | cksum`; \
98         expected=`sed -n 's/.*"cksum": "\(.*\)".*/\1/p' $?`; \
99         if test "X$$sum" = "X$$expected"; then \
100           touch $@; \
101         else \
102           ln=`sed -n '/"cksum":/=' $?`; \
103           echo >&2 "$?:$$ln: checksum \"$$sum\" does not match (you should probably update the version number and fix the checksum)"; \
104           exit 1; \
105         fi
106 CLEANFILES += vswitchd/vswitch.ovsschema.stamp