bond: Choose slaves randomly.
[openvswitch] / lib / automake.mk
1 # Copyright (C) 2009, 2010, 2011 Nicira Networks, Inc.
2 #
3 # Copying and distribution of this file, with or without modification,
4 # are permitted in any medium without royalty provided the copyright
5 # notice and this notice are preserved.  This file is offered as-is,
6 # without warranty of any kind.
7
8 noinst_LIBRARIES += lib/libopenvswitch.a
9
10 lib_libopenvswitch_a_SOURCES = \
11         lib/aes128.c \
12         lib/aes128.h \
13         lib/backtrace.c \
14         lib/backtrace.h \
15         lib/bitmap.c \
16         lib/bitmap.h \
17         lib/bond.c \
18         lib/bond.h \
19         lib/byte-order.h \
20         lib/byteq.c \
21         lib/byteq.h \
22         lib/cfm.c \
23         lib/cfm.h \
24         lib/classifier.c \
25         lib/classifier.h \
26         lib/command-line.c \
27         lib/command-line.h \
28         lib/compiler.h \
29         lib/coverage.c \
30         lib/coverage.h \
31         lib/csum.c \
32         lib/csum.h \
33         lib/daemon.c \
34         lib/daemon.h \
35         lib/dhcp.h \
36         lib/dummy.c \
37         lib/dummy.h \
38         lib/dhparams.h \
39         lib/dirs.h \
40         lib/dpif-netdev.c \
41         lib/dpif-provider.h \
42         lib/dpif.c \
43         lib/dpif.h \
44         lib/dynamic-string.c \
45         lib/dynamic-string.h \
46         lib/entropy.c \
47         lib/entropy.h \
48         lib/fatal-signal.c \
49         lib/fatal-signal.h \
50         lib/flow.c \
51         lib/flow.h \
52         lib/hash.c \
53         lib/hash.h \
54         lib/hmap.c \
55         lib/hmap.h \
56         lib/json.c \
57         lib/json.h \
58         lib/jsonrpc.c \
59         lib/jsonrpc.h \
60         lib/lacp.c \
61         lib/lacp.h \
62         lib/leak-checker.c \
63         lib/leak-checker.h \
64         lib/learning-switch.c \
65         lib/learning-switch.h \
66         lib/list.c \
67         lib/list.h \
68         lib/lockfile.c \
69         lib/lockfile.h \
70         lib/mac-learning.c \
71         lib/mac-learning.h \
72         lib/multipath.c \
73         lib/multipath.h \
74         lib/netdev-dummy.c \
75         lib/netdev-provider.h \
76         lib/netdev.c \
77         lib/netdev.h \
78         lib/netlink.c \
79         lib/netlink.h \
80         lib/nx-match.c \
81         lib/nx-match.def \
82         lib/nx-match.h \
83         lib/odp-util.c \
84         lib/odp-util.h \
85         lib/ofp-errors.c \
86         lib/ofp-errors.h \
87         lib/ofp-parse.c \
88         lib/ofp-parse.h \
89         lib/ofp-print.c \
90         lib/ofp-print.h \
91         lib/ofp-util.c \
92         lib/ofp-util.h \
93         lib/ofpbuf.c \
94         lib/ofpbuf.h \
95         lib/ovsdb-data.c \
96         lib/ovsdb-data.h \
97         lib/ovsdb-error.c \
98         lib/ovsdb-error.h \
99         lib/ovsdb-idl-provider.h \
100         lib/ovsdb-idl.c \
101         lib/ovsdb-idl.h \
102         lib/ovsdb-parser.c \
103         lib/ovsdb-parser.h \
104         lib/ovsdb-types.c \
105         lib/ovsdb-types.h \
106         lib/packets.c \
107         lib/packets.h \
108         lib/pcap.c \
109         lib/pcap.h \
110         lib/poll-loop.c \
111         lib/poll-loop.h \
112         lib/process.c \
113         lib/process.h \
114         lib/random.c \
115         lib/random.h \
116         lib/rconn.c \
117         lib/rconn.h \
118         lib/reconnect.c \
119         lib/reconnect.h \
120         lib/sat-math.h \
121         lib/sha1.c \
122         lib/sha1.h \
123         lib/shash.c \
124         lib/shash.h \
125         lib/signals.c \
126         lib/signals.h \
127         lib/socket-util.c \
128         lib/socket-util.h \
129         lib/sort.c \
130         lib/sort.h \
131         lib/sset.c \
132         lib/sset.h \
133         lib/stream-fd.c \
134         lib/stream-fd.h \
135         lib/stream-provider.h \
136         lib/stream-ssl.h \
137         lib/stream-tcp.c \
138         lib/stream-unix.c \
139         lib/stream.c \
140         lib/stream.h \
141         lib/stress.c \
142         lib/stress.h \
143         lib/string.c \
144         lib/string.h \
145         lib/svec.c \
146         lib/svec.h \
147         lib/table.c \
148         lib/table.h \
149         lib/tag.c \
150         lib/tag.h \
151         lib/timer.c \
152         lib/timer.h \
153         lib/timeval.c \
154         lib/timeval.h \
155         lib/type-props.h \
156         lib/unaligned.h \
157         lib/unicode.c \
158         lib/unicode.h \
159         lib/unixctl.c \
160         lib/unixctl.h \
161         lib/util.c \
162         lib/util.h \
163         lib/uuid.c \
164         lib/uuid.h \
165         lib/valgrind.h \
166         lib/vconn-provider.h \
167         lib/vconn-stream.c \
168         lib/vconn.c \
169         lib/vconn.h \
170         lib/vlog.c \
171         lib/vlog.h
172 nodist_lib_libopenvswitch_a_SOURCES = \
173         lib/dirs.c
174 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
175
176 noinst_LIBRARIES += lib/libsflow.a
177 lib_libsflow_a_SOURCES = \
178         lib/sflow_api.h \
179         lib/sflow.h \
180         lib/sflow_agent.c \
181         lib/sflow_sampler.c \
182         lib/sflow_poller.c \
183         lib/sflow_receiver.c
184 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
185 if HAVE_WNO_UNUSED
186 lib_libsflow_a_CFLAGS += -Wno-unused
187 endif
188 if HAVE_WNO_UNUSED_PARAMETER
189 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
190 endif
191
192 if HAVE_NETLINK
193 lib_libopenvswitch_a_SOURCES += \
194         lib/dpif-linux.c \
195         lib/dpif-linux.h \
196         lib/netdev-linux.c \
197         lib/netdev-vport.c \
198         lib/netdev-vport.h \
199         lib/netlink-protocol.h \
200         lib/netlink-socket.c \
201         lib/netlink-socket.h \
202         lib/rtnetlink.c \
203         lib/rtnetlink.h \
204         lib/rtnetlink-link.c \
205         lib/rtnetlink-link.h \
206         lib/route-table.c \
207         lib/route-table.h
208 endif
209
210 if HAVE_OPENSSL
211 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
212 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
213 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
214         (echo '#include "lib/dhparams.h"' &&                            \
215          openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
216          openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
217          openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
218         | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
219         mv lib/dhparams.c.tmp lib/dhparams.c
220 endif
221
222 EXTRA_DIST += \
223         lib/dh1024.pem \
224         lib/dh2048.pem \
225         lib/dh4096.pem \
226         lib/dirs.c.in
227
228 EXTRA_DIST += \
229         lib/common.man \
230         lib/common-syn.man \
231         lib/daemon.man \
232         lib/daemon-syn.man \
233         lib/leak-checker.man \
234         lib/ssl-bootstrap.man \
235         lib/ssl-bootstrap-syn.man \
236         lib/ssl-peer-ca-cert.man \
237         lib/ssl.man \
238         lib/ssl-syn.man \
239         lib/stress-unixctl.man \
240         lib/table.man \
241         lib/unixctl.man \
242         lib/unixctl-syn.man \
243         lib/vconn-active.man \
244         lib/vconn-passive.man \
245         lib/vlog-unixctl.man \
246         lib/vlog-syn.man \
247         lib/vlog.man
248
249 lib/dirs.c: lib/dirs.c.in Makefile
250         ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
251                 -e 's,[@]srcdir[@],$(srcdir),g' \
252                 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
253                 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
254                 -e 's,[@]bindir[@],"$(bindir)",g' \
255                 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
256              > lib/dirs.c.tmp
257         mv lib/dirs.c.tmp lib/dirs.c
258
259 $(srcdir)/lib/ofp-errors.c: \
260         include/openflow/openflow.h include/openflow/nicira-ext.h \
261         build-aux/extract-ofp-errors
262         cd $(srcdir)/include && \
263         $(PYTHON) ../build-aux/extract-ofp-errors \
264                 openflow/openflow.h openflow/nicira-ext.h > ../lib/ofp-errors.c
265 EXTRA_DIST += build-aux/extract-ofp-errors
266
267 install-data-local: lib-install-data-local
268 lib-install-data-local:
269         $(MKDIR_P) $(DESTDIR)$(RUNDIR)
270         $(MKDIR_P) $(DESTDIR)$(PKIDIR)
271         $(MKDIR_P) $(DESTDIR)$(LOGDIR)
272
273 if !USE_LINKER_SECTIONS
274 # All distributed sources, with names adjust properly for referencing
275 # from $(builddir).
276 all_sources = \
277         `for file in $(DIST_SOURCES); do \
278                 if test -f $$file; then \
279                         echo $$file; \
280                 else \
281                         echo $(VPATH)/$$file; \
282                 fi; \
283          done`
284
285 lib/coverage.$(OBJEXT): lib/coverage.def
286 lib/coverage.def: $(DIST_SOURCES)
287         sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
288 CLEANFILES += lib/coverage.def
289
290 lib/stress.$(OBJEXT): lib/stress.def
291 lib/stress.def: $(DIST_SOURCES)
292         sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
293 CLEANFILES += lib/stress.def
294
295 lib/vlog.$(OBJEXT): lib/vlog-modules.def
296 lib/vlog-modules.def: $(DIST_SOURCES)
297         sed -n 's|^VLOG_DEFINE_\(THIS_\)\{0,1\}MODULE(\([_a-zA-Z0-9]\{1,\}\)).*$$|VLOG_MODULE(\2)|p' $(all_sources) | LC_ALL=C sort -u > $@
298 CLEANFILES += lib/vlog-modules.def
299 endif