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