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