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