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