bridge: Remove unwanted ports at time of ofproto creation.
[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 += vswitchd/INTERNALS
25 MAN_ROOTS += vswitchd/ovs-vswitchd.8.in
26
27 if HAVE_NETLINK
28 sbin_PROGRAMS += vswitchd/ovs-brcompatd
29 vswitchd_ovs_brcompatd_SOURCES = \
30         vswitchd/ovs-brcompatd.c \
31         vswitchd/vswitch-idl.c \
32         vswitchd/vswitch-idl.h
33 vswitchd_ovs_brcompatd_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
34 endif
35 MAN_ROOTS += vswitchd/ovs-brcompatd.8.in
36
37 # vswitch schema and IDL
38 OVSIDL_BUILT += \
39         vswitchd/vswitch-idl.c \
40         vswitchd/vswitch-idl.h \
41         vswitchd/vswitch-idl.ovsidl
42 VSWITCH_IDL_FILES = vswitchd/vswitch.ovsschema vswitchd/vswitch-idl.ann
43 EXTRA_DIST += $(VSWITCH_IDL_FILES)
44 pkgdata_DATA += vswitchd/vswitch.ovsschema
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 $(srcdir)/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