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