]> git.proxmox.com Git - mirror_ovs.git/blob - lib/automake.mk
auto-attach: Initial support for Auto-Attach standard
[mirror_ovs.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
12 if WIN32
13 lib_libopenvswitch_la_LIBADD += ${PTHREAD_LIBS}
14 endif
15
16 lib_libopenvswitch_la_LDFLAGS = \
17 -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
18 -Wl,--version-script=$(top_builddir)/lib/libopenvswitch.sym \
19 $(AM_LDFLAGS)
20
21 lib_libopenvswitch_la_SOURCES = \
22 lib/aes128.c \
23 lib/aes128.h \
24 lib/async-append.h \
25 lib/backtrace.c \
26 lib/backtrace.h \
27 lib/bfd.c \
28 lib/bfd.h \
29 lib/bitmap.h \
30 lib/bundle.c \
31 lib/bundle.h \
32 lib/byte-order.h \
33 lib/byteq.c \
34 lib/byteq.h \
35 lib/cfm.c \
36 lib/cfm.h \
37 lib/classifier.c \
38 lib/classifier.h \
39 lib/classifier-private.h \
40 lib/cmap.c \
41 lib/cmap.h \
42 lib/command-line.c \
43 lib/command-line.h \
44 lib/compiler.h \
45 lib/connectivity.c \
46 lib/connectivity.h \
47 lib/coverage.c \
48 lib/coverage.h \
49 lib/crc32c.c \
50 lib/crc32c.h \
51 lib/csum.c \
52 lib/csum.h \
53 lib/daemon.c \
54 lib/daemon.h \
55 lib/daemon-private.h \
56 lib/dhcp.h \
57 lib/dummy.c \
58 lib/dummy.h \
59 lib/dhparams.h \
60 lib/dirs.h \
61 lib/dpctl.c \
62 lib/dpctl.h \
63 lib/dp-packet.h \
64 lib/dp-packet.c \
65 lib/dpif-netdev.c \
66 lib/dpif-netdev.h \
67 lib/dpif-provider.h \
68 lib/dpif.c \
69 lib/dpif.h \
70 lib/heap.c \
71 lib/heap.h \
72 lib/dynamic-string.c \
73 lib/dynamic-string.h \
74 lib/entropy.c \
75 lib/entropy.h \
76 lib/fat-rwlock.c \
77 lib/fat-rwlock.h \
78 lib/fatal-signal.c \
79 lib/fatal-signal.h \
80 lib/flow.c \
81 lib/flow.h \
82 lib/guarded-list.c \
83 lib/guarded-list.h \
84 lib/hash.c \
85 lib/hash.h \
86 lib/hindex.c \
87 lib/hindex.h \
88 lib/hmap.c \
89 lib/hmap.h \
90 lib/hmapx.c \
91 lib/hmapx.h \
92 lib/id-pool.c \
93 lib/id-pool.h \
94 lib/jhash.c \
95 lib/jhash.h \
96 lib/json.c \
97 lib/json.h \
98 lib/jsonrpc.c \
99 lib/jsonrpc.h \
100 lib/lacp.c \
101 lib/lacp.h \
102 lib/latch.h \
103 lib/learn.c \
104 lib/learn.h \
105 lib/learning-switch.c \
106 lib/learning-switch.h \
107 lib/list.h \
108 lib/lockfile.c \
109 lib/lockfile.h \
110 lib/mac-learning.c \
111 lib/mac-learning.h \
112 lib/match.c \
113 lib/match.h \
114 lib/mcast-snooping.c \
115 lib/mcast-snooping.h \
116 lib/memory.c \
117 lib/memory.h \
118 lib/meta-flow.c \
119 lib/meta-flow.h \
120 lib/multipath.c \
121 lib/multipath.h \
122 lib/netdev-dummy.c \
123 lib/netdev-provider.h \
124 lib/netdev-vport.c \
125 lib/netdev-vport.h \
126 lib/netdev.c \
127 lib/netdev.h \
128 lib/netflow.h \
129 lib/netlink.c \
130 lib/netlink.h \
131 lib/nx-match.c \
132 lib/nx-match.h \
133 lib/odp-execute.c \
134 lib/odp-execute.h \
135 lib/odp-util.c \
136 lib/odp-util.h \
137 lib/ofp-actions.c \
138 lib/ofp-actions.h \
139 lib/ofp-errors.c \
140 lib/ofp-errors.h \
141 lib/ofp-msgs.c \
142 lib/ofp-msgs.h \
143 lib/ofp-parse.c \
144 lib/ofp-parse.h \
145 lib/ofp-print.c \
146 lib/ofp-print.h \
147 lib/ofp-util.c \
148 lib/ofp-util.h \
149 lib/ofp-version-opt.h \
150 lib/ofp-version-opt.c \
151 lib/ofpbuf.c \
152 lib/ofpbuf.h \
153 lib/ovs-atomic-c11.h \
154 lib/ovs-atomic-clang.h \
155 lib/ovs-atomic-flag-gcc4.7+.h \
156 lib/ovs-atomic-gcc4+.h \
157 lib/ovs-atomic-gcc4.7+.h \
158 lib/ovs-atomic-i586.h \
159 lib/ovs-atomic-locked.c \
160 lib/ovs-atomic-locked.h \
161 lib/ovs-atomic-msvc.h \
162 lib/ovs-atomic-pthreads.h \
163 lib/ovs-atomic-x86_64.h \
164 lib/ovs-atomic.h \
165 lib/ovs-lldp.c \
166 lib/ovs-lldp.h \
167 lib/ovs-rcu.c \
168 lib/ovs-rcu.h \
169 lib/ovs-router.h \
170 lib/ovs-router.c \
171 lib/ovs-thread.c \
172 lib/ovs-thread.h \
173 lib/ovsdb-data.c \
174 lib/ovsdb-data.h \
175 lib/ovsdb-error.c \
176 lib/ovsdb-error.h \
177 lib/ovsdb-idl-provider.h \
178 lib/ovsdb-idl.c \
179 lib/ovsdb-idl.h \
180 lib/ovsdb-parser.c \
181 lib/ovsdb-parser.h \
182 lib/ovsdb-types.c \
183 lib/ovsdb-types.h \
184 lib/packets.c \
185 lib/packets.h \
186 lib/pcap-file.c \
187 lib/pcap-file.h \
188 lib/poll-loop.c \
189 lib/poll-loop.h \
190 lib/process.c \
191 lib/process.h \
192 lib/pvector.c \
193 lib/pvector.h \
194 lib/random.c \
195 lib/random.h \
196 lib/rconn.c \
197 lib/rconn.h \
198 lib/rculist.c \
199 lib/rculist.h \
200 lib/reconnect.c \
201 lib/reconnect.h \
202 lib/rstp.c \
203 lib/rstp.h \
204 lib/rstp-common.h \
205 lib/rstp-state-machines.c \
206 lib/rstp-state-machines.h \
207 lib/sat-math.h \
208 lib/seq.c \
209 lib/seq.h \
210 lib/sha1.c \
211 lib/sha1.h \
212 lib/shash.c \
213 lib/shash.h \
214 lib/simap.c \
215 lib/simap.h \
216 lib/smap.c \
217 lib/smap.h \
218 lib/socket-util.c \
219 lib/socket-util.h \
220 lib/sort.c \
221 lib/sort.h \
222 lib/sset.c \
223 lib/sset.h \
224 lib/stp.c \
225 lib/stp.h \
226 lib/stream-fd.c \
227 lib/stream-fd.h \
228 lib/stream-provider.h \
229 lib/stream-ssl.h \
230 lib/stream-tcp.c \
231 lib/stream.c \
232 lib/stream.h \
233 lib/stdio.c \
234 lib/string.c \
235 lib/svec.c \
236 lib/svec.h \
237 lib/table.c \
238 lib/table.h \
239 lib/tag.c \
240 lib/tag.h \
241 lib/timer.c \
242 lib/timer.h \
243 lib/timeval.c \
244 lib/timeval.h \
245 lib/tnl-arp-cache.c \
246 lib/tnl-arp-cache.h \
247 lib/tnl-ports.c \
248 lib/tnl-ports.h \
249 lib/token-bucket.c \
250 lib/type-props.h \
251 lib/unaligned.h \
252 lib/unicode.c \
253 lib/unicode.h \
254 lib/unixctl.c \
255 lib/unixctl.h \
256 lib/util.c \
257 lib/util.h \
258 lib/uuid.c \
259 lib/uuid.h \
260 lib/valgrind.h \
261 lib/vconn-provider.h \
262 lib/vconn-stream.c \
263 lib/vconn.c \
264 lib/vlan-bitmap.c \
265 lib/vlan-bitmap.h \
266 lib/vlandev.c \
267 lib/vlandev.h \
268 lib/vlog.c \
269 lib/vswitch-idl.c \
270 lib/vswitch-idl.h \
271 lib/vtep-idl.c \
272 lib/vtep-idl.h \
273 lib/lldp/aa-structs.h \
274 lib/lldp/lldp.c \
275 lib/lldp/lldp-const.h \
276 lib/lldp/lldp-tlv.h \
277 lib/lldp/lldpd.c \
278 lib/lldp/lldpd.h \
279 lib/lldp/lldpd-structs.c \
280 lib/lldp/lldpd-structs.h
281
282 if WIN32
283 lib_libopenvswitch_la_SOURCES += \
284 lib/daemon-windows.c \
285 lib/getopt_long.c \
286 lib/getrusage-windows.c \
287 lib/latch-windows.c \
288 lib/route-table-stub.c \
289 lib/strsep.c
290 else
291 lib_libopenvswitch_la_SOURCES += \
292 lib/daemon-unix.c \
293 lib/latch-unix.c \
294 lib/signals.c \
295 lib/signals.h \
296 lib/socket-util-unix.c \
297 lib/stream-unix.c
298 endif
299
300 EXTRA_DIST += \
301 lib/stdio.h.in \
302 lib/string.h.in
303
304 nodist_lib_libopenvswitch_la_SOURCES = \
305 lib/dirs.c
306 CLEANFILES += $(nodist_lib_libopenvswitch_la_SOURCES)
307
308 lib_LTLIBRARIES += lib/libsflow.la
309 lib_libsflow_la_LDFLAGS = \
310 -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
311 -Wl,--version-script=$(top_builddir)/lib/libsflow.sym \
312 $(AM_LDFLAGS)
313 lib_libsflow_la_SOURCES = \
314 lib/sflow_api.h \
315 lib/sflow.h \
316 lib/sflow_agent.c \
317 lib/sflow_sampler.c \
318 lib/sflow_poller.c \
319 lib/sflow_receiver.c
320 lib_libsflow_la_CPPFLAGS = $(AM_CPPFLAGS)
321 lib_libsflow_la_CFLAGS = $(AM_CFLAGS)
322 if HAVE_WNO_UNUSED
323 lib_libsflow_la_CFLAGS += -Wno-unused
324 endif
325 if HAVE_WNO_UNUSED_PARAMETER
326 lib_libsflow_la_CFLAGS += -Wno-unused-parameter
327 endif
328
329 if LINUX
330 lib_libopenvswitch_la_SOURCES += \
331 lib/dpif-netlink.c \
332 lib/dpif-netlink.h \
333 lib/netdev-linux.c \
334 lib/netdev-linux.h \
335 lib/netlink-notifier.c \
336 lib/netlink-notifier.h \
337 lib/netlink-protocol.h \
338 lib/netlink-socket.c \
339 lib/netlink-socket.h \
340 lib/ovs-numa.c \
341 lib/ovs-numa.h \
342 lib/rtnetlink-link.c \
343 lib/rtnetlink-link.h \
344 lib/route-table.c \
345 lib/route-table.h
346 endif
347
348 if DPDK_NETDEV
349 lib_libopenvswitch_la_SOURCES += \
350 lib/netdev-dpdk.c \
351 lib/netdev-dpdk.h
352 endif
353
354 if WIN32
355 lib_libopenvswitch_la_SOURCES += \
356 lib/dpif-netlink.c \
357 lib/dpif-netlink.h \
358 lib/netdev-windows.c \
359 lib/netlink-notifier.c \
360 lib/netlink-notifier.h \
361 lib/netlink-protocol.h \
362 lib/netlink-socket.c \
363 lib/netlink-socket.h
364 endif
365
366 if HAVE_POSIX_AIO
367 lib_libopenvswitch_la_SOURCES += lib/async-append-aio.c
368 else
369 lib_libopenvswitch_la_SOURCES += lib/async-append-null.c
370 endif
371
372 if ESX
373 lib_libopenvswitch_la_SOURCES += \
374 lib/route-table-stub.c
375 endif
376
377 if HAVE_IF_DL
378 lib_libopenvswitch_la_SOURCES += \
379 lib/netdev-bsd.c \
380 lib/rtbsd.c \
381 lib/rtbsd.h \
382 lib/route-table-bsd.c
383 endif
384
385 if HAVE_OPENSSL
386 lib_libopenvswitch_la_SOURCES += lib/stream-ssl.c
387 nodist_lib_libopenvswitch_la_SOURCES += lib/dhparams.c
388 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
389 $(AM_V_GEN)(echo '#include "lib/dhparams.h"' && \
390 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
391 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
392 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
393 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp && \
394 mv lib/dhparams.c.tmp lib/dhparams.c
395 else
396 lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c
397 endif
398
399 pkgconfig_DATA += \
400 $(srcdir)/lib/libopenvswitch.pc \
401 $(srcdir)/lib/libsflow.pc
402
403 EXTRA_DIST += \
404 lib/dh1024.pem \
405 lib/dh2048.pem \
406 lib/dh4096.pem \
407 lib/dirs.c.in
408
409 MAN_FRAGMENTS += \
410 lib/common.man \
411 lib/common-syn.man \
412 lib/coverage-unixctl.man \
413 lib/daemon.man \
414 lib/daemon-syn.man \
415 lib/dpctl.man \
416 lib/memory-unixctl.man \
417 lib/ofp-version.man \
418 lib/ovs.tmac \
419 lib/service.man \
420 lib/service-syn.man \
421 lib/ssl-bootstrap.man \
422 lib/ssl-bootstrap-syn.man \
423 lib/ssl-peer-ca-cert.man \
424 lib/ssl.man \
425 lib/ssl-syn.man \
426 lib/table.man \
427 lib/unixctl.man \
428 lib/unixctl-syn.man \
429 lib/vconn-active.man \
430 lib/vconn-passive.man \
431 lib/vlog-unixctl.man \
432 lib/vlog-syn.man \
433 lib/vlog.man
434
435 # vswitch IDL
436 OVSIDL_BUILT += \
437 $(srcdir)/lib/vswitch-idl.c \
438 $(srcdir)/lib/vswitch-idl.h \
439 $(srcdir)/lib/vswitch-idl.ovsidl \
440 $(srcdir)/lib/vtep-idl.c \
441 $(srcdir)/lib/vtep-idl.h \
442 $(srcdir)/lib/vtep-idl.ovsidl
443
444 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
445 VSWITCH_IDL_FILES = \
446 $(srcdir)/vswitchd/vswitch.ovsschema \
447 $(srcdir)/lib/vswitch-idl.ann
448 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
449 $(AM_V_GEN)$(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp && \
450 mv $@.tmp $@
451
452 EXTRA_DIST += $(srcdir)/lib/vtep-idl.ann
453 VTEP_IDL_FILES = \
454 $(srcdir)/vtep/vtep.ovsschema \
455 $(srcdir)/lib/vtep-idl.ann
456 $(srcdir)/lib/vtep-idl.ovsidl: $(VTEP_IDL_FILES)
457 $(AM_V_GEN)$(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp && \
458 mv $@.tmp $@
459
460 lib/dirs.c: lib/dirs.c.in Makefile
461 $(AM_V_GEN)($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
462 -e 's,[@]srcdir[@],$(srcdir),g' \
463 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
464 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
465 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
466 -e 's,[@]bindir[@],"$(bindir)",g' \
467 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
468 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
469 > lib/dirs.c.tmp && \
470 mv lib/dirs.c.tmp lib/dirs.c
471
472 lib/meta-flow.inc: $(srcdir)/build-aux/extract-ofp-fields lib/meta-flow.h
473 $(AM_V_GEN)$(run_python) $^ --meta-flow > $@.tmp && mv $@.tmp $@
474 lib/meta-flow.lo: lib/meta-flow.inc
475 lib/nx-match.inc: $(srcdir)/build-aux/extract-ofp-fields lib/meta-flow.h
476 $(AM_V_GEN)$(run_python) $^ --nx-match > $@.tmp && mv $@.tmp $@
477 lib/nx-match.lo: lib/nx-match.inc
478 CLEANFILES += lib/meta-flow.inc lib/nx-match.inc
479 EXTRA_DIST += build-aux/extract-ofp-fields
480
481 lib/ofp-actions.inc1: $(srcdir)/build-aux/extract-ofp-actions lib/ofp-actions.c
482 $(AM_V_GEN)$(run_python) $^ --prototypes > $@.tmp && mv $@.tmp $@
483 lib/ofp-actions.inc2: $(srcdir)/build-aux/extract-ofp-actions lib/ofp-actions.c
484 $(AM_V_GEN)$(run_python) $^ --definitions > $@.tmp && mv $@.tmp $@
485 lib/ofp-actions.lo: lib/ofp-actions.inc1 lib/ofp-actions.inc2
486 CLEANFILES += lib/ofp-actions.inc1 lib/ofp-actions.inc2
487 EXTRA_DIST += build-aux/extract-ofp-actions
488
489 $(srcdir)/lib/ofp-errors.inc: \
490 lib/ofp-errors.h include/openflow/openflow-common.h \
491 $(srcdir)/build-aux/extract-ofp-errors
492 $(AM_V_GEN)$(run_python) $(srcdir)/build-aux/extract-ofp-errors \
493 $(srcdir)/lib/ofp-errors.h \
494 $(srcdir)/include/openflow/openflow-common.h > $@.tmp && \
495 mv $@.tmp $@
496 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
497 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
498
499 $(srcdir)/lib/ofp-msgs.inc: \
500 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
501 $(AM_V_GEN)$(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
502 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
503 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
504 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
505
506 INSTALL_DATA_LOCAL += lib-install-data-local
507 lib-install-data-local:
508 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
509 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
510 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
511 $(MKDIR_P) $(DESTDIR)$(DBDIR)
512