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