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