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