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