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