Merge branch 'mainstream'
[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 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.c \
44         lib/daemon.h \
45         lib/dhcp.h \
46         lib/dummy.c \
47         lib/dummy.h \
48         lib/dhparams.h \
49         lib/dirs.h \
50         lib/dpif-netdev.c \
51         lib/dpif-provider.h \
52         lib/dpif.c \
53         lib/dpif.h \
54         lib/heap.c \
55         lib/heap.h \
56         lib/dynamic-string.c \
57         lib/dynamic-string.h \
58         lib/entropy.c \
59         lib/entropy.h \
60         lib/fatal-signal.c \
61         lib/fatal-signal.h \
62         lib/flow.c \
63         lib/flow.h \
64         lib/guarded-list.c \
65         lib/guarded-list.h \
66         lib/hash.c \
67         lib/hash.h \
68         lib/hindex.c \
69         lib/hindex.h \
70         lib/hmap.c \
71         lib/hmap.h \
72         lib/hmapx.c \
73         lib/hmapx.h \
74         lib/jhash.c \
75         lib/jhash.h \
76         lib/json.c \
77         lib/json.h \
78         lib/jsonrpc.c \
79         lib/jsonrpc.h \
80         lib/lacp.c \
81         lib/lacp.h \
82         lib/latch.c \
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-unix.c \
199         lib/stream.c \
200         lib/stream.h \
201         lib/stdio.c \
202         lib/string.c \
203         lib/svec.c \
204         lib/svec.h \
205         lib/table.c \
206         lib/table.h \
207         lib/tag.c \
208         lib/tag.h \
209         lib/timer.c \
210         lib/timer.h \
211         lib/timeval.c \
212         lib/timeval.h \
213         lib/token-bucket.c \
214         lib/token-bucket.h \
215         lib/tunalloc.c \
216         lib/tunalloc.h \
217         lib/type-props.h \
218         lib/unaligned.h \
219         lib/unicode.c \
220         lib/unicode.h \
221         lib/unixctl.c \
222         lib/unixctl.h \
223         lib/util.c \
224         lib/util.h \
225         lib/uuid.c \
226         lib/uuid.h \
227         lib/valgrind.h \
228         lib/vconn-provider.h \
229         lib/vconn-stream.c \
230         lib/vconn.c \
231         lib/vconn.h \
232         lib/vlan-bitmap.c \
233         lib/vlan-bitmap.h \
234         lib/vlandev.c \
235         lib/vlandev.h \
236         lib/vlog.c \
237         lib/vlog.h \
238         lib/vswitch-idl.c \
239         lib/vswitch-idl.h \
240         lib/vtep-idl.c \
241         lib/vtep-idl.h
242 EXTRA_DIST += \
243         lib/stdio.h.in \
244         lib/string.h.in
245
246 nodist_lib_libopenvswitch_la_SOURCES = \
247         lib/dirs.c
248 CLEANFILES += $(nodist_lib_libopenvswitch_la_SOURCES)
249
250 lib_LTLIBRARIES += lib/libsflow.la
251 lib_libsflow_la_LDFLAGS = -release $(VERSION)
252 lib_libsflow_la_SOURCES = \
253         lib/sflow_api.h \
254         lib/sflow.h \
255         lib/sflow_agent.c \
256         lib/sflow_sampler.c \
257         lib/sflow_poller.c \
258         lib/sflow_receiver.c
259 lib_libsflow_la_CPPFLAGS = $(AM_CPPFLAGS)
260 lib_libsflow_la_CFLAGS = $(AM_CFLAGS)
261 if HAVE_WNO_UNUSED
262 lib_libsflow_la_CFLAGS += -Wno-unused
263 endif
264 if HAVE_WNO_UNUSED_PARAMETER
265 lib_libsflow_la_CFLAGS += -Wno-unused-parameter
266 endif
267
268 if LINUX_DATAPATH
269 lib_libopenvswitch_la_SOURCES += \
270         lib/dpif-linux.c \
271         lib/dpif-linux.h \
272         lib/netdev-linux.c \
273         lib/netdev-linux.h \
274         lib/netlink-notifier.c \
275         lib/netlink-notifier.h \
276         lib/netlink-protocol.h \
277         lib/netlink-socket.c \
278         lib/netlink-socket.h \
279         lib/rtnetlink-link.c \
280         lib/rtnetlink-link.h \
281         lib/route-table.c \
282         lib/route-table.h
283 endif
284
285 if HAVE_POSIX_AIO
286 lib_libopenvswitch_la_SOURCES += lib/async-append-aio.c
287 else
288 lib_libopenvswitch_la_SOURCES += lib/async-append-null.c
289 endif
290
291 if ESX
292 lib_libopenvswitch_la_SOURCES += \
293         lib/route-table-stub.c
294 endif
295
296 if HAVE_IF_DL
297 lib_libopenvswitch_la_SOURCES += \
298         lib/netdev-bsd.c \
299         lib/rtbsd.c \
300         lib/rtbsd.h \
301         lib/route-table-bsd.c
302 endif
303
304 if HAVE_OPENSSL
305 lib_libopenvswitch_la_SOURCES += lib/stream-ssl.c
306 nodist_lib_libopenvswitch_la_SOURCES += lib/dhparams.c
307 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
308         (echo '#include "lib/dhparams.h"' &&                            \
309          openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
310          openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
311          openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
312         | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
313         mv lib/dhparams.c.tmp lib/dhparams.c
314 else
315 lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c
316 endif
317
318 EXTRA_DIST += \
319         lib/dh1024.pem \
320         lib/dh2048.pem \
321         lib/dh4096.pem \
322         lib/dirs.c.in
323
324 MAN_FRAGMENTS += \
325         lib/common.man \
326         lib/common-syn.man \
327         lib/coverage-unixctl.man \
328         lib/daemon.man \
329         lib/daemon-syn.man \
330         lib/memory-unixctl.man \
331         lib/ofp-version.man \
332         lib/ovs.tmac \
333         lib/ssl-bootstrap.man \
334         lib/ssl-bootstrap-syn.man \
335         lib/ssl-peer-ca-cert.man \
336         lib/ssl.man \
337         lib/ssl-syn.man \
338         lib/table.man \
339         lib/unixctl.man \
340         lib/unixctl-syn.man \
341         lib/vconn-active.man \
342         lib/vconn-passive.man \
343         lib/vlog-unixctl.man \
344         lib/vlog-syn.man \
345         lib/vlog.man
346
347 # vswitch IDL
348 OVSIDL_BUILT += \
349         $(srcdir)/lib/vswitch-idl.c \
350         $(srcdir)/lib/vswitch-idl.h \
351         $(srcdir)/lib/vswitch-idl.ovsidl \
352         $(srcdir)/lib/vtep-idl.c \
353         $(srcdir)/lib/vtep-idl.h \
354         $(srcdir)/lib/vtep-idl.ovsidl
355
356 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
357 VSWITCH_IDL_FILES = \
358         $(srcdir)/vswitchd/vswitch.ovsschema \
359         $(srcdir)/lib/vswitch-idl.ann
360 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
361         $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
362         mv $@.tmp $@
363
364 EXTRA_DIST += $(srcdir)/lib/vtep-idl.ann
365 VTEP_IDL_FILES = \
366         $(srcdir)/vtep/vtep.ovsschema \
367         $(srcdir)/lib/vtep-idl.ann
368 $(srcdir)/lib/vtep-idl.ovsidl: $(VTEP_IDL_FILES)
369         $(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp
370         mv $@.tmp $@
371
372 lib/dirs.c: lib/dirs.c.in Makefile
373         ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
374                 -e 's,[@]srcdir[@],$(srcdir),g' \
375                 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
376                 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
377                 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
378                 -e 's,[@]bindir[@],"$(bindir)",g' \
379                 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
380                 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
381              > lib/dirs.c.tmp
382         mv lib/dirs.c.tmp lib/dirs.c
383
384 $(srcdir)/lib/ofp-errors.inc: \
385         lib/ofp-errors.h include/openflow/openflow-common.h \
386         $(srcdir)/build-aux/extract-ofp-errors
387         $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
388                 $(srcdir)/lib/ofp-errors.h \
389                 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
390         mv $@.tmp $@
391 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
392 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
393
394 $(srcdir)/lib/ofp-msgs.inc: \
395         lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
396         $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
397                 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
398 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
399 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
400
401 INSTALL_DATA_LOCAL += lib-install-data-local
402 lib-install-data-local:
403         $(MKDIR_P) $(DESTDIR)$(RUNDIR)
404         $(MKDIR_P) $(DESTDIR)$(PKIDIR)
405         $(MKDIR_P) $(DESTDIR)$(LOGDIR)
406         $(MKDIR_P) $(DESTDIR)$(DBDIR)
407