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