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