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