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