]> git.proxmox.com Git - mirror_ovs.git/blob - lib/automake.mk
dhparams: Add pregenerated .c file to the repository.
[mirror_ovs.git] / lib / automake.mk
1 # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 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 $(OVS_LTINFO) \
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/dpdk.h \
81 lib/dpif-netdev.c \
82 lib/dpif-netdev.h \
83 lib/dpif-netdev-perf.c \
84 lib/dpif-netdev-perf.h \
85 lib/dpif-provider.h \
86 lib/dpif.c \
87 lib/dpif.h \
88 lib/heap.c \
89 lib/heap.h \
90 lib/dynamic-string.c \
91 lib/entropy.c \
92 lib/entropy.h \
93 lib/fat-rwlock.c \
94 lib/fat-rwlock.h \
95 lib/fatal-signal.c \
96 lib/fatal-signal.h \
97 lib/flow.c \
98 lib/flow.h \
99 lib/guarded-list.c \
100 lib/guarded-list.h \
101 lib/hash.c \
102 lib/hash.h \
103 lib/hindex.c \
104 lib/hindex.h \
105 lib/hmap.c \
106 lib/hmapx.c \
107 lib/hmapx.h \
108 lib/id-pool.c \
109 lib/id-pool.h \
110 lib/jhash.c \
111 lib/jhash.h \
112 lib/json.c \
113 lib/jsonrpc.c \
114 lib/jsonrpc.h \
115 lib/lacp.c \
116 lib/lacp.h \
117 lib/latch.h \
118 lib/learn.c \
119 lib/learn.h \
120 lib/learning-switch.c \
121 lib/learning-switch.h \
122 lib/lockfile.c \
123 lib/lockfile.h \
124 lib/mac-learning.c \
125 lib/mac-learning.h \
126 lib/match.c \
127 lib/mcast-snooping.c \
128 lib/mcast-snooping.h \
129 lib/memory.c \
130 lib/memory.h \
131 lib/meta-flow.c \
132 lib/multipath.c \
133 lib/multipath.h \
134 lib/namemap.c \
135 lib/netdev-dpdk.h \
136 lib/netdev-dummy.c \
137 lib/netdev-provider.h \
138 lib/netdev-vport.c \
139 lib/netdev-vport.h \
140 lib/netdev-vport-private.h \
141 lib/netdev.c \
142 lib/netdev.h \
143 lib/netflow.h \
144 lib/netlink.c \
145 lib/netlink.h \
146 lib/netnsid.h \
147 lib/nx-match.c \
148 lib/nx-match.h \
149 lib/object-collection.c \
150 lib/object-collection.h \
151 lib/odp-execute.c \
152 lib/odp-execute.h \
153 lib/odp-util.c \
154 lib/odp-util.h \
155 lib/ofp-actions.c \
156 lib/ofp-bundle.c \
157 lib/ofp-connection.c \
158 lib/ofp-ed-props.c \
159 lib/ofp-errors.c \
160 lib/ofp-flow.c \
161 lib/ofp-group.c \
162 lib/ofp-ipfix.c \
163 lib/ofp-match.c \
164 lib/ofp-meter.c \
165 lib/ofp-monitor.c \
166 lib/ofp-msgs.c \
167 lib/ofp-packet.c \
168 lib/ofp-parse.c \
169 lib/ofp-port.c \
170 lib/ofp-print.c \
171 lib/ofp-prop.c \
172 lib/ofp-protocol.c \
173 lib/ofp-queue.c \
174 lib/ofp-switch.c \
175 lib/ofp-table.c \
176 lib/ofp-util.c \
177 lib/ofp-version-opt.h \
178 lib/ofp-version-opt.c \
179 lib/ofpbuf.c \
180 lib/ovs-atomic-c++.h \
181 lib/ovs-atomic-c11.h \
182 lib/ovs-atomic-clang.h \
183 lib/ovs-atomic-flag-gcc4.7+.h \
184 lib/ovs-atomic-gcc4+.h \
185 lib/ovs-atomic-gcc4.7+.h \
186 lib/ovs-atomic-i586.h \
187 lib/ovs-atomic-locked.c \
188 lib/ovs-atomic-locked.h \
189 lib/ovs-atomic-msvc.h \
190 lib/ovs-atomic-pthreads.h \
191 lib/ovs-atomic-x86_64.h \
192 lib/ovs-atomic.h \
193 lib/ovs-lldp.c \
194 lib/ovs-lldp.h \
195 lib/ovs-numa.c \
196 lib/ovs-numa.h \
197 lib/ovs-rcu.c \
198 lib/ovs-rcu.h \
199 lib/ovs-router.h \
200 lib/ovs-router.c \
201 lib/ovs-thread.c \
202 lib/ovs-thread.h \
203 lib/ovsdb-data.c \
204 lib/ovsdb-data.h \
205 lib/ovsdb-error.c \
206 lib/ovsdb-error.h \
207 lib/ovsdb-idl-provider.h \
208 lib/ovsdb-idl.c \
209 lib/ovsdb-idl.h \
210 lib/ovsdb-map-op.c \
211 lib/ovsdb-map-op.h \
212 lib/ovsdb-set-op.c \
213 lib/ovsdb-set-op.h \
214 lib/ovsdb-condition.h \
215 lib/ovsdb-condition.c \
216 lib/ovsdb-parser.c \
217 lib/ovsdb-parser.h \
218 lib/ovsdb-session.c \
219 lib/ovsdb-session.h \
220 lib/ovsdb-types.c \
221 lib/ovsdb-types.h \
222 lib/ox-stat.c \
223 lib/ox-stat.h \
224 lib/packets.c \
225 lib/packets.h \
226 lib/pcap-file.c \
227 lib/pcap-file.h \
228 lib/perf-counter.h \
229 lib/perf-counter.c \
230 lib/stopwatch.h \
231 lib/stopwatch.c \
232 lib/poll-loop.c \
233 lib/process.c \
234 lib/process.h \
235 lib/pvector.c \
236 lib/pvector.h \
237 lib/random.c \
238 lib/random.h \
239 lib/rconn.c \
240 lib/rculist.h \
241 lib/reconnect.c \
242 lib/reconnect.h \
243 lib/rstp.c \
244 lib/rstp.h \
245 lib/rstp-common.h \
246 lib/rstp-state-machines.c \
247 lib/rstp-state-machines.h \
248 lib/sat-math.h \
249 lib/seq.c \
250 lib/seq.h \
251 lib/sha1.c \
252 lib/sha1.h \
253 lib/shash.c \
254 lib/simap.c \
255 lib/simap.h \
256 lib/skiplist.c \
257 lib/skiplist.h \
258 lib/smap.c \
259 lib/smap.h \
260 lib/socket-util.c \
261 lib/socket-util.h \
262 lib/sort.c \
263 lib/sort.h \
264 lib/sset.c \
265 lib/sset.h \
266 lib/stp.c \
267 lib/stp.h \
268 lib/stream-fd.c \
269 lib/stream-fd.h \
270 lib/stream-provider.h \
271 lib/stream-ssl.h \
272 lib/stream-tcp.c \
273 lib/stream.c \
274 lib/stream.h \
275 lib/stdio.c \
276 lib/string.c \
277 lib/svec.c \
278 lib/svec.h \
279 lib/syslog-direct.c \
280 lib/syslog-direct.h \
281 lib/syslog-libc.c \
282 lib/syslog-libc.h \
283 lib/syslog-provider.h \
284 lib/table.c \
285 lib/table.h \
286 lib/timer.c \
287 lib/timer.h \
288 lib/timeval.c \
289 lib/timeval.h \
290 lib/tnl-neigh-cache.c \
291 lib/tnl-neigh-cache.h \
292 lib/tnl-ports.c \
293 lib/tnl-ports.h \
294 lib/netdev-native-tnl.c \
295 lib/netdev-native-tnl.h \
296 lib/token-bucket.c \
297 lib/tun-metadata.c \
298 lib/tun-metadata.h \
299 lib/unaligned.h \
300 lib/unicode.c \
301 lib/unicode.h \
302 lib/unixctl.c \
303 lib/unixctl.h \
304 lib/util.c \
305 lib/util.h \
306 lib/uuid.c \
307 lib/uuid.h \
308 lib/valgrind.h \
309 lib/vconn-provider.h \
310 lib/vconn-stream.c \
311 lib/vconn.c \
312 lib/versions.h \
313 lib/vl-mff-map.h \
314 lib/vlan-bitmap.c \
315 lib/vlan-bitmap.h \
316 lib/vlog.c \
317 lib/lldp/aa-structs.h \
318 lib/lldp/lldp.c \
319 lib/lldp/lldp-const.h \
320 lib/lldp/lldp-tlv.h \
321 lib/lldp/lldpd.c \
322 lib/lldp/lldpd.h \
323 lib/lldp/lldpd-structs.c \
324 lib/lldp/lldpd-structs.h
325
326 if WIN32
327 lib_libopenvswitch_la_SOURCES += \
328 lib/daemon-windows.c \
329 lib/getopt_long.c \
330 lib/getrusage-windows.c \
331 lib/latch-windows.c \
332 lib/route-table-stub.c \
333 lib/if-notifier-stub.c \
334 lib/stream-windows.c \
335 lib/strsep.c
336 else
337 lib_libopenvswitch_la_SOURCES += \
338 lib/daemon-unix.c \
339 lib/latch-unix.c \
340 lib/signals.c \
341 lib/signals.h \
342 lib/socket-util-unix.c \
343 lib/stream-unix.c
344 endif
345
346 EXTRA_DIST += \
347 lib/stdio.h.in \
348 lib/string.h.in
349
350 nodist_lib_libopenvswitch_la_SOURCES = \
351 lib/dirs.c \
352 lib/ovsdb-server-idl.c \
353 lib/ovsdb-server-idl.h \
354 lib/vswitch-idl.c \
355 lib/vswitch-idl.h
356 CLEANFILES += $(nodist_lib_libopenvswitch_la_SOURCES)
357
358 lib_LTLIBRARIES += lib/libsflow.la
359 lib_libsflow_la_LDFLAGS = \
360 $(OVS_LTINFO) \
361 -Wl,--version-script=$(top_builddir)/lib/libsflow.sym \
362 $(AM_LDFLAGS)
363 lib_libsflow_la_SOURCES = \
364 lib/sflow_api.h \
365 lib/sflow.h \
366 lib/sflow_agent.c \
367 lib/sflow_sampler.c \
368 lib/sflow_poller.c \
369 lib/sflow_receiver.c
370 lib_libsflow_la_CPPFLAGS = $(AM_CPPFLAGS)
371 lib_libsflow_la_CFLAGS = $(AM_CFLAGS)
372 if HAVE_WNO_UNUSED
373 lib_libsflow_la_CFLAGS += -Wno-unused
374 endif
375 if HAVE_WNO_UNUSED_PARAMETER
376 lib_libsflow_la_CFLAGS += -Wno-unused-parameter
377 endif
378
379 if LINUX
380 lib_libopenvswitch_la_SOURCES += \
381 lib/dpif-netlink.c \
382 lib/dpif-netlink.h \
383 lib/dpif-netlink-rtnl.c \
384 lib/dpif-netlink-rtnl.h \
385 lib/if-notifier.c \
386 lib/if-notifier.h \
387 lib/netdev-linux.c \
388 lib/netdev-linux.h \
389 lib/netdev-tc-offloads.c \
390 lib/netdev-tc-offloads.h \
391 lib/netlink-conntrack.c \
392 lib/netlink-conntrack.h \
393 lib/netlink-notifier.c \
394 lib/netlink-notifier.h \
395 lib/netlink-protocol.h \
396 lib/netlink-socket.c \
397 lib/netlink-socket.h \
398 lib/rtnetlink.c \
399 lib/rtnetlink.h \
400 lib/route-table.c \
401 lib/route-table.h \
402 lib/tc.c \
403 lib/tc.h
404 endif
405
406 if DPDK_NETDEV
407 lib_libopenvswitch_la_SOURCES += \
408 lib/dpdk.c \
409 lib/netdev-dpdk.c
410 else
411 lib_libopenvswitch_la_SOURCES += \
412 lib/dpdk-stub.c
413 endif
414
415 if WIN32
416 lib_libopenvswitch_la_SOURCES += \
417 lib/dpif-netlink.c \
418 lib/dpif-netlink.h \
419 lib/dpif-netlink-rtnl.h \
420 lib/netdev-windows.c \
421 lib/netlink-conntrack.c \
422 lib/netlink-conntrack.h \
423 lib/netlink-notifier.c \
424 lib/netlink-notifier.h \
425 lib/netlink-protocol.h \
426 lib/netlink-socket.c \
427 lib/netlink-socket.h \
428 lib/wmi.c \
429 lib/wmi.h
430 endif
431
432 if HAVE_POSIX_AIO
433 lib_libopenvswitch_la_SOURCES += lib/async-append-aio.c
434 else
435 lib_libopenvswitch_la_SOURCES += lib/async-append-null.c
436 endif
437
438 if ESX
439 lib_libopenvswitch_la_SOURCES += \
440 lib/route-table-stub.c \
441 lib/if-notifier-stub.c
442 endif
443
444 if HAVE_IF_DL
445 lib_libopenvswitch_la_SOURCES += \
446 lib/if-notifier-bsd.c \
447 lib/netdev-bsd.c \
448 lib/rtbsd.c \
449 lib/rtbsd.h \
450 lib/route-table-bsd.c
451 endif
452
453 .PHONY: generate-dhparams-c
454 if HAVE_OPENSSL
455 lib_libopenvswitch_la_SOURCES += lib/stream-ssl.c lib/dhparams.c
456
457 # Manually regenerates lib/dhparams.c. Not normally necessary since
458 # lib/dhparams.c is part of the repository and doesn't normally need
459 # updates.
460 generate-dhparams-c:
461 $(AM_V_GEN)cd $(srcdir) && \
462 build-aux/generate-dhparams-c > lib/dhparams.c.tmp && \
463 mv lib/dhparams.c.tmp lib/dhparams.c
464 else
465 lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c
466 endif
467
468 pkgconfig_DATA += \
469 lib/libopenvswitch.pc \
470 lib/libsflow.pc
471
472 EXTRA_DIST += \
473 lib/dh1024.pem \
474 lib/dh2048.pem \
475 lib/dh4096.pem \
476 lib/common.xml \
477 lib/daemon.xml \
478 lib/dirs.c.in \
479 lib/db-ctl-base.xml \
480 lib/ssl.xml \
481 lib/ssl-bootstrap.xml \
482 lib/ssl-peer-ca-cert.xml \
483 lib/table.xml \
484 lib/vlog.xml \
485 lib/unixctl.xml
486
487 MAN_FRAGMENTS += \
488 lib/colors.man \
489 lib/common.man \
490 lib/common-syn.man \
491 lib/coverage-unixctl.man \
492 lib/daemon.man \
493 lib/daemon-syn.man \
494 lib/db-ctl-base.man \
495 lib/dpctl.man \
496 lib/memory-unixctl.man \
497 lib/netdev-dpdk-unixctl.man \
498 lib/dpif-netdev-unixctl.man \
499 lib/ofp-version.man \
500 lib/ovs.tmac \
501 lib/service.man \
502 lib/service-syn.man \
503 lib/ssl-bootstrap.man \
504 lib/ssl-bootstrap-syn.man \
505 lib/ssl-peer-ca-cert.man \
506 lib/ssl-peer-ca-cert-syn.man \
507 lib/ssl.man \
508 lib/ssl-syn.man \
509 lib/ssl-connect.man \
510 lib/ssl-connect-syn.man \
511 lib/table.man \
512 lib/unixctl.man \
513 lib/unixctl-syn.man \
514 lib/vconn-active.man \
515 lib/vconn-passive.man \
516 lib/vlog-unixctl.man \
517 lib/vlog-syn.man \
518 lib/vlog.man
519
520 # vswitch IDL
521 OVSIDL_BUILT += lib/vswitch-idl.c lib/vswitch-idl.h lib/vswitch-idl.ovsidl
522
523 EXTRA_DIST += lib/vswitch-idl.ann
524 lib/vswitch-idl.ovsidl: vswitchd/vswitch.ovsschema lib/vswitch-idl.ann
525 $(AM_V_GEN)$(OVSDB_IDLC) annotate $(srcdir)/vswitchd/vswitch.ovsschema $(srcdir)/lib/vswitch-idl.ann > $@.tmp && mv $@.tmp $@
526
527 lib/dirs.c: lib/dirs.c.in Makefile
528 $(AM_V_GEN)($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
529 -e 's,[@]srcdir[@],$(srcdir),g' \
530 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
531 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
532 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
533 -e 's,[@]bindir[@],"$(bindir)",g' \
534 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
535 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
536 > lib/dirs.c.tmp && \
537 mv lib/dirs.c.tmp lib/dirs.c
538
539 lib/meta-flow.inc: $(srcdir)/build-aux/extract-ofp-fields include/openvswitch/meta-flow.h
540 $(AM_V_GEN)$(run_python) $< meta-flow $(srcdir)/include/openvswitch/meta-flow.h > $@.tmp
541 $(AM_V_at)mv $@.tmp $@
542 lib/meta-flow.lo: lib/meta-flow.inc
543 lib/nx-match.inc: $(srcdir)/build-aux/extract-ofp-fields include/openvswitch/meta-flow.h
544 $(AM_V_GEN)$(run_python) $< nx-match $(srcdir)/include/openvswitch/meta-flow.h > $@.tmp
545 $(AM_V_at)mv $@.tmp $@
546 lib/nx-match.lo: lib/nx-match.inc
547 CLEANFILES += lib/meta-flow.inc lib/nx-match.inc
548 EXTRA_DIST += build-aux/extract-ofp-fields
549
550 lib/ofp-actions.inc1: $(srcdir)/build-aux/extract-ofp-actions lib/ofp-actions.c
551 $(AM_V_GEN)$(run_python) $^ --prototypes > $@.tmp && mv $@.tmp $@
552 lib/ofp-actions.inc2: $(srcdir)/build-aux/extract-ofp-actions lib/ofp-actions.c
553 $(AM_V_GEN)$(run_python) $^ --definitions > $@.tmp && mv $@.tmp $@
554 lib/ofp-actions.lo: lib/ofp-actions.inc1 lib/ofp-actions.inc2
555 CLEANFILES += lib/ofp-actions.inc1 lib/ofp-actions.inc2
556 EXTRA_DIST += build-aux/extract-ofp-actions
557
558 lib/ofp-errors.inc: include/openvswitch/ofp-errors.h include/openflow/openflow-common.h \
559 $(srcdir)/build-aux/extract-ofp-errors
560 $(AM_V_GEN)$(run_python) $(srcdir)/build-aux/extract-ofp-errors \
561 $(srcdir)/include/openvswitch/ofp-errors.h \
562 $(srcdir)/include/openflow/openflow-common.h > $@.tmp && \
563 mv $@.tmp $@
564 lib/ofp-errors.lo: lib/ofp-errors.inc
565 CLEANFILES += lib/ofp-errors.inc
566 EXTRA_DIST += build-aux/extract-ofp-errors
567
568 lib/ofp-msgs.inc: include/openvswitch/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
569 $(AM_V_GEN)$(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
570 $(srcdir)/include/openvswitch/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
571 lib/ofp-msgs.lo: lib/ofp-msgs.inc
572 CLEANFILES += lib/ofp-msgs.inc
573 EXTRA_DIST += build-aux/extract-ofp-msgs
574
575 # _server IDL
576 OVSIDL_BUILT += lib/ovsdb-server-idl.c lib/ovsdb-server-idl.h lib/ovsdb-server-idl.ovsidl
577 EXTRA_DIST += lib/ovsdb-server-idl.ann
578 lib/ovsdb-server-idl.ovsidl: ovsdb/_server.ovsschema lib/ovsdb-server-idl.ann
579 $(AM_V_GEN)$(OVSDB_IDLC) annotate $(srcdir)/ovsdb/_server.ovsschema $(srcdir)/lib/ovsdb-server-idl.ann > $@.tmp && mv $@.tmp $@
580
581 INSTALL_DATA_LOCAL += lib-install-data-local
582 lib-install-data-local:
583 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
584 $(MKDIR_P) $(DESTDIR)$(sysconfdir)/openvswitch
585
586 man_MANS += lib/ovs-fields.7
587 CLEANFILES += lib/ovs-fields.7
588 lib/ovs-fields.7: $(srcdir)/build-aux/extract-ofp-fields include/openvswitch/meta-flow.h lib/meta-flow.xml
589 $(AM_V_GEN)PYTHONIOENCODING=utf8 $(run_python) $< \
590 --ovs-version=$(VERSION) ovs-fields \
591 $(srcdir)/include/openvswitch/meta-flow.h \
592 $(srcdir)/lib/meta-flow.xml > $@.tmp
593 $(AM_V_at)mv $@.tmp $@
594 EXTRA_DIST += lib/meta-flow.xml