latch: New module for a thread-safe, signal-safe, pollable doorbell.
[sliver-openvswitch.git] / lib / automake.mk
1 # Copyright (C) 2009, 2010, 2011, 2012, 2013 Nicira, 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/bfd.c \
16         lib/bfd.h \
17         lib/bitmap.c \
18         lib/bitmap.h \
19         lib/bond.c \
20         lib/bond.h \
21         lib/bundle.c \
22         lib/bundle.h \
23         lib/byte-order.h \
24         lib/byteq.c \
25         lib/byteq.h \
26         lib/cfm.c \
27         lib/cfm.h \
28         lib/classifier.c \
29         lib/classifier.h \
30         lib/command-line.c \
31         lib/command-line.h \
32         lib/compiler.h \
33         lib/coverage.c \
34         lib/coverage.h \
35         lib/csum.c \
36         lib/csum.h \
37         lib/daemon.c \
38         lib/daemon.h \
39         lib/dhcp.h \
40         lib/dummy.c \
41         lib/dummy.h \
42         lib/dhparams.h \
43         lib/dirs.h \
44         lib/dpif-netdev.c \
45         lib/dpif-provider.h \
46         lib/dpif.c \
47         lib/dpif.h \
48         lib/heap.c \
49         lib/heap.h \
50         lib/dynamic-string.c \
51         lib/dynamic-string.h \
52         lib/entropy.c \
53         lib/entropy.h \
54         lib/fatal-signal.c \
55         lib/fatal-signal.h \
56         lib/flow.c \
57         lib/flow.h \
58         lib/hash.c \
59         lib/hash.h \
60         lib/hindex.c \
61         lib/hindex.h \
62         lib/hmap.c \
63         lib/hmap.h \
64         lib/hmapx.c \
65         lib/hmapx.h \
66         lib/jhash.c \
67         lib/jhash.h \
68         lib/json.c \
69         lib/json.h \
70         lib/jsonrpc.c \
71         lib/jsonrpc.h \
72         lib/lacp.c \
73         lib/lacp.h \
74         lib/latch.c \
75         lib/latch.h \
76         lib/learn.c \
77         lib/learn.h \
78         lib/learning-switch.c \
79         lib/learning-switch.h \
80         lib/list.c \
81         lib/list.h \
82         lib/lockfile.c \
83         lib/lockfile.h \
84         lib/mac-learning.c \
85         lib/mac-learning.h \
86         lib/match.c \
87         lib/match.h \
88         lib/memory.c \
89         lib/memory.h \
90         lib/meta-flow.c \
91         lib/meta-flow.h \
92         lib/multipath.c \
93         lib/multipath.h \
94         lib/netdev-dummy.c \
95         lib/netdev-provider.h \
96         lib/netdev-vport.c \
97         lib/netdev-vport.h \
98         lib/netdev.c \
99         lib/netdev.h \
100         lib/netflow.h \
101         lib/netlink.c \
102         lib/netlink.h \
103         lib/nx-match.c \
104         lib/nx-match.h \
105         lib/odp-execute.c \
106         lib/odp-execute.h \
107         lib/odp-util.c \
108         lib/odp-util.h \
109         lib/ofp-actions.c \
110         lib/ofp-actions.h \
111         lib/ofp-errors.c \
112         lib/ofp-errors.h \
113         lib/ofp-msgs.c \
114         lib/ofp-msgs.h \
115         lib/ofp-parse.c \
116         lib/ofp-parse.h \
117         lib/ofp-print.c \
118         lib/ofp-print.h \
119         lib/ofp-util.c \
120         lib/ofp-util.def \
121         lib/ofp-util.h \
122         lib/ofp-version-opt.h \
123         lib/ofp-version-opt.c \
124         lib/ofpbuf.c \
125         lib/ofpbuf.h \
126         lib/ovs-atomic-c11.h \
127         lib/ovs-atomic-gcc4+.c \
128         lib/ovs-atomic-gcc4+.h \
129         lib/ovs-atomic-gcc4.7+.h \
130         lib/ovs-atomic-pthreads.c \
131         lib/ovs-atomic-pthreads.h \
132         lib/ovs-atomic.h \
133         lib/ovs-thread.c \
134         lib/ovs-thread.h \
135         lib/ovsdb-data.c \
136         lib/ovsdb-data.h \
137         lib/ovsdb-error.c \
138         lib/ovsdb-error.h \
139         lib/ovsdb-idl-provider.h \
140         lib/ovsdb-idl.c \
141         lib/ovsdb-idl.h \
142         lib/ovsdb-parser.c \
143         lib/ovsdb-parser.h \
144         lib/ovsdb-types.c \
145         lib/ovsdb-types.h \
146         lib/packets.c \
147         lib/packets.h \
148         lib/pcap-file.c \
149         lib/pcap-file.h \
150         lib/poll-loop.c \
151         lib/poll-loop.h \
152         lib/process.c \
153         lib/process.h \
154         lib/random.c \
155         lib/random.h \
156         lib/rconn.c \
157         lib/rconn.h \
158         lib/reconnect.c \
159         lib/reconnect.h \
160         lib/sat-math.h \
161         lib/sha1.c \
162         lib/sha1.h \
163         lib/shash.c \
164         lib/shash.h \
165         lib/simap.c \
166         lib/simap.h \
167         lib/signals.c \
168         lib/signals.h \
169         lib/smap.c \
170         lib/smap.h \
171         lib/socket-util.c \
172         lib/socket-util.h \
173         lib/sort.c \
174         lib/sort.h \
175         lib/sset.c \
176         lib/sset.h \
177         lib/stp.c \
178         lib/stp.h \
179         lib/stream-fd.c \
180         lib/stream-fd.h \
181         lib/stream-provider.h \
182         lib/stream-ssl.h \
183         lib/stream-tcp.c \
184         lib/stream-unix.c \
185         lib/stream.c \
186         lib/stream.h \
187         lib/string.c \
188         lib/string.h \
189         lib/svec.c \
190         lib/svec.h \
191         lib/table.c \
192         lib/table.h \
193         lib/tag.c \
194         lib/tag.h \
195         lib/timer.c \
196         lib/timer.h \
197         lib/timeval.c \
198         lib/timeval.h \
199         lib/token-bucket.c \
200         lib/token-bucket.h \
201         lib/type-props.h \
202         lib/unaligned.h \
203         lib/unicode.c \
204         lib/unicode.h \
205         lib/unixctl.c \
206         lib/unixctl.h \
207         lib/util.c \
208         lib/util.h \
209         lib/uuid.c \
210         lib/uuid.h \
211         lib/valgrind.h \
212         lib/vconn-provider.h \
213         lib/vconn-stream.c \
214         lib/vconn.c \
215         lib/vconn.h \
216         lib/vlan-bitmap.c \
217         lib/vlan-bitmap.h \
218         lib/vlandev.c \
219         lib/vlandev.h \
220         lib/vlog.c \
221         lib/vlog.h \
222         lib/vswitch-idl.c \
223         lib/vswitch-idl.h
224
225 nodist_lib_libopenvswitch_a_SOURCES = \
226         lib/dirs.c
227 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
228
229 noinst_LIBRARIES += lib/libsflow.a
230 lib_libsflow_a_SOURCES = \
231         lib/sflow_api.h \
232         lib/sflow.h \
233         lib/sflow_agent.c \
234         lib/sflow_sampler.c \
235         lib/sflow_poller.c \
236         lib/sflow_receiver.c
237 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
238 if HAVE_WNO_UNUSED
239 lib_libsflow_a_CFLAGS += -Wno-unused
240 endif
241 if HAVE_WNO_UNUSED_PARAMETER
242 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
243 endif
244
245 if LINUX_DATAPATH
246 lib_libopenvswitch_a_SOURCES += \
247         lib/dpif-linux.c \
248         lib/dpif-linux.h \
249         lib/netdev-linux.c \
250         lib/netdev-linux.h \
251         lib/netlink-notifier.c \
252         lib/netlink-notifier.h \
253         lib/netlink-protocol.h \
254         lib/netlink-socket.c \
255         lib/netlink-socket.h \
256         lib/rtnetlink-link.c \
257         lib/rtnetlink-link.h \
258         lib/route-table.c \
259         lib/route-table.h
260 endif
261
262 if ESX
263 lib_libopenvswitch_a_SOURCES += \
264         lib/route-table-stub.c
265 endif
266
267 if HAVE_IF_DL
268 lib_libopenvswitch_a_SOURCES += \
269         lib/netdev-bsd.c \
270         lib/rtbsd.c \
271         lib/rtbsd.h \
272         lib/route-table-bsd.c
273 endif
274
275 if HAVE_OPENSSL
276 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
277 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
278 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
279         (echo '#include "lib/dhparams.h"' &&                            \
280          openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
281          openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
282          openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
283         | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
284         mv lib/dhparams.c.tmp lib/dhparams.c
285 else
286 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
287 endif
288
289 EXTRA_DIST += \
290         lib/dh1024.pem \
291         lib/dh2048.pem \
292         lib/dh4096.pem \
293         lib/dirs.c.in
294
295 MAN_FRAGMENTS += \
296         lib/common.man \
297         lib/common-syn.man \
298         lib/coverage-unixctl.man \
299         lib/daemon.man \
300         lib/daemon-syn.man \
301         lib/memory-unixctl.man \
302         lib/ofp-version.man \
303         lib/ovs.tmac \
304         lib/ssl-bootstrap.man \
305         lib/ssl-bootstrap-syn.man \
306         lib/ssl-peer-ca-cert.man \
307         lib/ssl.man \
308         lib/ssl-syn.man \
309         lib/table.man \
310         lib/unixctl.man \
311         lib/unixctl-syn.man \
312         lib/vconn-active.man \
313         lib/vconn-passive.man \
314         lib/vlog-unixctl.man \
315         lib/vlog-syn.man \
316         lib/vlog.man
317
318 # vswitch IDL
319 OVSIDL_BUILT += \
320         $(srcdir)/lib/vswitch-idl.c \
321         $(srcdir)/lib/vswitch-idl.h \
322         $(srcdir)/lib/vswitch-idl.ovsidl
323
324 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
325 VSWITCH_IDL_FILES = \
326         $(srcdir)/vswitchd/vswitch.ovsschema \
327         $(srcdir)/lib/vswitch-idl.ann
328 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
329         $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
330         mv $@.tmp $@
331
332 lib/dirs.c: lib/dirs.c.in Makefile
333         ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
334                 -e 's,[@]srcdir[@],$(srcdir),g' \
335                 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
336                 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
337                 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
338                 -e 's,[@]bindir[@],"$(bindir)",g' \
339                 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
340                 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
341              > lib/dirs.c.tmp
342         mv lib/dirs.c.tmp lib/dirs.c
343
344 $(srcdir)/lib/ofp-errors.inc: \
345         lib/ofp-errors.h include/openflow/openflow-common.h \
346         $(srcdir)/build-aux/extract-ofp-errors
347         $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
348                 $(srcdir)/lib/ofp-errors.h \
349                 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
350         mv $@.tmp $@
351 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
352 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
353
354 $(srcdir)/lib/ofp-msgs.inc: \
355         lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
356         $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
357                 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
358 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
359 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
360
361 INSTALL_DATA_LOCAL += lib-install-data-local
362 lib-install-data-local:
363         $(MKDIR_P) $(DESTDIR)$(RUNDIR)
364         $(MKDIR_P) $(DESTDIR)$(PKIDIR)
365         $(MKDIR_P) $(DESTDIR)$(LOGDIR)
366         $(MKDIR_P) $(DESTDIR)$(DBDIR)
367
368 if !USE_LINKER_SECTIONS
369 # All distributed sources, with names adjust properly for referencing
370 # from $(builddir).
371 all_sources = \
372         `for file in $(DIST_SOURCES); do \
373                 if test -f $$file; then \
374                         echo $$file; \
375                 else \
376                         echo $(VPATH)/$$file; \
377                 fi; \
378          done`
379
380 lib/coverage.$(OBJEXT): lib/coverage.def
381 lib/coverage.def: $(DIST_SOURCES)
382         sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
383 CLEANFILES += lib/coverage.def
384
385 lib/vlog.$(OBJEXT): lib/vlog-modules.def
386 lib/vlog-modules.def: $(DIST_SOURCES)
387         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 > $@
388 CLEANFILES += lib/vlog-modules.def
389 endif