Implement new "learn" action.
[sliver-openvswitch.git] / lib / automake.mk
1 # Copyright (C) 2009, 2010, 2011 Nicira Networks, 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/dynamic-string.c \
49         lib/dynamic-string.h \
50         lib/entropy.c \
51         lib/entropy.h \
52         lib/fatal-signal.c \
53         lib/fatal-signal.h \
54         lib/flow.c \
55         lib/flow.h \
56         lib/hash.c \
57         lib/hash.h \
58         lib/hmap.c \
59         lib/hmap.h \
60         lib/hmapx.c \
61         lib/hmapx.h \
62         lib/json.c \
63         lib/json.h \
64         lib/jsonrpc.c \
65         lib/jsonrpc.h \
66         lib/lacp.c \
67         lib/lacp.h \
68         lib/leak-checker.c \
69         lib/leak-checker.h \
70         lib/learn.c \
71         lib/learn.h \
72         lib/learning-switch.c \
73         lib/learning-switch.h \
74         lib/list.c \
75         lib/list.h \
76         lib/lockfile.c \
77         lib/lockfile.h \
78         lib/mac-learning.c \
79         lib/mac-learning.h \
80         lib/meta-flow.c \
81         lib/meta-flow.h \
82         lib/multipath.c \
83         lib/multipath.h \
84         lib/netdev-dummy.c \
85         lib/netdev-provider.h \
86         lib/netdev.c \
87         lib/netdev.h \
88         lib/netlink.c \
89         lib/netlink.h \
90         lib/nx-match.c \
91         lib/nx-match.def \
92         lib/nx-match.h \
93         lib/odp-util.c \
94         lib/odp-util.h \
95         lib/ofp-errors.c \
96         lib/ofp-errors.h \
97         lib/ofp-parse.c \
98         lib/ofp-parse.h \
99         lib/ofp-print.c \
100         lib/ofp-print.h \
101         lib/ofp-util.c \
102         lib/ofp-util.def \
103         lib/ofp-util.h \
104         lib/ofpbuf.c \
105         lib/ofpbuf.h \
106         lib/ovsdb-data.c \
107         lib/ovsdb-data.h \
108         lib/ovsdb-error.c \
109         lib/ovsdb-error.h \
110         lib/ovsdb-idl-provider.h \
111         lib/ovsdb-idl.c \
112         lib/ovsdb-idl.h \
113         lib/ovsdb-parser.c \
114         lib/ovsdb-parser.h \
115         lib/ovsdb-types.c \
116         lib/ovsdb-types.h \
117         lib/packets.c \
118         lib/packets.h \
119         lib/pcap.c \
120         lib/pcap.h \
121         lib/poll-loop.c \
122         lib/poll-loop.h \
123         lib/process.c \
124         lib/process.h \
125         lib/random.c \
126         lib/random.h \
127         lib/rconn.c \
128         lib/rconn.h \
129         lib/reconnect.c \
130         lib/reconnect.h \
131         lib/sat-math.h \
132         lib/sha1.c \
133         lib/sha1.h \
134         lib/shash.c \
135         lib/shash.h \
136         lib/signals.c \
137         lib/signals.h \
138         lib/socket-util.c \
139         lib/socket-util.h \
140         lib/sort.c \
141         lib/sort.h \
142         lib/sset.c \
143         lib/sset.h \
144         lib/stream-fd.c \
145         lib/stream-fd.h \
146         lib/stream-provider.h \
147         lib/stream-ssl.h \
148         lib/stream-tcp.c \
149         lib/stream-unix.c \
150         lib/stream.c \
151         lib/stream.h \
152         lib/stress.c \
153         lib/stress.h \
154         lib/string.c \
155         lib/string.h \
156         lib/svec.c \
157         lib/svec.h \
158         lib/table.c \
159         lib/table.h \
160         lib/tag.c \
161         lib/tag.h \
162         lib/timer.c \
163         lib/timer.h \
164         lib/timeval.c \
165         lib/timeval.h \
166         lib/type-props.h \
167         lib/unaligned.h \
168         lib/unicode.c \
169         lib/unicode.h \
170         lib/unixctl.c \
171         lib/unixctl.h \
172         lib/util.c \
173         lib/util.h \
174         lib/uuid.c \
175         lib/uuid.h \
176         lib/valgrind.h \
177         lib/vconn-provider.h \
178         lib/vconn-stream.c \
179         lib/vconn.c \
180         lib/vconn.h \
181         lib/vlan-bitmap.c \
182         lib/vlan-bitmap.h \
183         lib/vlog.c \
184         lib/vlog.h
185 nodist_lib_libopenvswitch_a_SOURCES = \
186         lib/dirs.c
187 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
188
189 noinst_LIBRARIES += lib/libsflow.a
190 lib_libsflow_a_SOURCES = \
191         lib/sflow_api.h \
192         lib/sflow.h \
193         lib/sflow_agent.c \
194         lib/sflow_sampler.c \
195         lib/sflow_poller.c \
196         lib/sflow_receiver.c
197 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
198 if HAVE_WNO_UNUSED
199 lib_libsflow_a_CFLAGS += -Wno-unused
200 endif
201 if HAVE_WNO_UNUSED_PARAMETER
202 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
203 endif
204
205 if HAVE_NETLINK
206 lib_libopenvswitch_a_SOURCES += \
207         lib/dpif-linux.c \
208         lib/dpif-linux.h \
209         lib/netdev-linux.c \
210         lib/netdev-linux.h \
211         lib/netdev-vport.c \
212         lib/netdev-vport.h \
213         lib/netlink-notifier.c \
214         lib/netlink-notifier.h \
215         lib/netlink-protocol.h \
216         lib/netlink-socket.c \
217         lib/netlink-socket.h \
218         lib/rtnetlink-link.c \
219         lib/rtnetlink-link.h \
220         lib/route-table.c \
221         lib/route-table.h
222 endif
223
224 if HAVE_OPENSSL
225 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
226 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
227 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
228         (echo '#include "lib/dhparams.h"' &&                            \
229          openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
230          openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
231          openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
232         | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
233         mv lib/dhparams.c.tmp lib/dhparams.c
234 else
235 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
236 endif
237
238 EXTRA_DIST += \
239         lib/dh1024.pem \
240         lib/dh2048.pem \
241         lib/dh4096.pem \
242         lib/dirs.c.in
243
244 MAN_FRAGMENTS += \
245         lib/common.man \
246         lib/common-syn.man \
247         lib/daemon.man \
248         lib/daemon-syn.man \
249         lib/leak-checker.man \
250         lib/ssl-bootstrap.man \
251         lib/ssl-bootstrap-syn.man \
252         lib/ssl-peer-ca-cert.man \
253         lib/ssl.man \
254         lib/ssl-syn.man \
255         lib/stress-unixctl.man \
256         lib/table.man \
257         lib/unixctl.man \
258         lib/unixctl-syn.man \
259         lib/vconn-active.man \
260         lib/vconn-passive.man \
261         lib/vlog-unixctl.man \
262         lib/vlog-syn.man \
263         lib/vlog.man
264
265 lib/dirs.c: lib/dirs.c.in Makefile
266         ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
267                 -e 's,[@]srcdir[@],$(srcdir),g' \
268                 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
269                 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
270                 -e 's,[@]bindir[@],"$(bindir)",g' \
271                 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
272                 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
273              > lib/dirs.c.tmp
274         mv lib/dirs.c.tmp lib/dirs.c
275
276 $(srcdir)/lib/ofp-errors.c: \
277         include/openflow/openflow.h include/openflow/nicira-ext.h \
278         build-aux/extract-ofp-errors
279         cd $(srcdir)/include && \
280         $(PYTHON) ../build-aux/extract-ofp-errors \
281                 openflow/openflow.h openflow/nicira-ext.h > ../lib/ofp-errors.c
282 EXTRA_DIST += build-aux/extract-ofp-errors
283
284 INSTALL_DATA_LOCAL += lib-install-data-local
285 lib-install-data-local:
286         $(MKDIR_P) $(DESTDIR)$(RUNDIR)
287         $(MKDIR_P) $(DESTDIR)$(PKIDIR)
288         $(MKDIR_P) $(DESTDIR)$(LOGDIR)
289
290 if !USE_LINKER_SECTIONS
291 # All distributed sources, with names adjust properly for referencing
292 # from $(builddir).
293 all_sources = \
294         `for file in $(DIST_SOURCES); do \
295                 if test -f $$file; then \
296                         echo $$file; \
297                 else \
298                         echo $(VPATH)/$$file; \
299                 fi; \
300          done`
301
302 lib/coverage.$(OBJEXT): lib/coverage.def
303 lib/coverage.def: $(DIST_SOURCES)
304         sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
305 CLEANFILES += lib/coverage.def
306
307 lib/stress.$(OBJEXT): lib/stress.def
308 lib/stress.def: $(DIST_SOURCES)
309         sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
310 CLEANFILES += lib/stress.def
311
312 lib/vlog.$(OBJEXT): lib/vlog-modules.def
313 lib/vlog-modules.def: $(DIST_SOURCES)
314         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 > $@
315 CLEANFILES += lib/vlog-modules.def
316 endif