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