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