vswitchd: Modularize LACP.
[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/backtrace.c \
14         lib/backtrace.h \
15         lib/bitmap.c \
16         lib/bitmap.h \
17         lib/byte-order.h \
18         lib/byteq.c \
19         lib/byteq.h \
20         lib/cfm.c \
21         lib/cfm.h \
22         lib/classifier.c \
23         lib/classifier.h \
24         lib/command-line.c \
25         lib/command-line.h \
26         lib/compiler.h \
27         lib/coverage.c \
28         lib/coverage.h \
29         lib/csum.c \
30         lib/csum.h \
31         lib/daemon.c \
32         lib/daemon.h \
33         lib/dhcp.h \
34         lib/dummy.c \
35         lib/dummy.h \
36         lib/dhparams.h \
37         lib/dirs.h \
38         lib/dpif-netdev.c \
39         lib/dpif-provider.h \
40         lib/dpif.c \
41         lib/dpif.h \
42         lib/dynamic-string.c \
43         lib/dynamic-string.h \
44         lib/entropy.c \
45         lib/entropy.h \
46         lib/fatal-signal.c \
47         lib/fatal-signal.h \
48         lib/flow.c \
49         lib/flow.h \
50         lib/hash.c \
51         lib/hash.h \
52         lib/hmap.c \
53         lib/hmap.h \
54         lib/json.c \
55         lib/json.h \
56         lib/jsonrpc.c \
57         lib/jsonrpc.h \
58         lib/lacp.c \
59         lib/lacp.h \
60         lib/leak-checker.c \
61         lib/leak-checker.h \
62         lib/learning-switch.c \
63         lib/learning-switch.h \
64         lib/list.c \
65         lib/list.h \
66         lib/lockfile.c \
67         lib/lockfile.h \
68         lib/mac-learning.c \
69         lib/mac-learning.h \
70         lib/multipath.c \
71         lib/multipath.h \
72         lib/netdev-dummy.c \
73         lib/netdev-provider.h \
74         lib/netdev.c \
75         lib/netdev.h \
76         lib/netlink.c \
77         lib/netlink.h \
78         lib/nx-match.c \
79         lib/nx-match.def \
80         lib/nx-match.h \
81         lib/odp-util.c \
82         lib/odp-util.h \
83         lib/ofp-errors.c \
84         lib/ofp-errors.h \
85         lib/ofp-parse.c \
86         lib/ofp-parse.h \
87         lib/ofp-print.c \
88         lib/ofp-print.h \
89         lib/ofp-util.c \
90         lib/ofp-util.h \
91         lib/ofpbuf.c \
92         lib/ofpbuf.h \
93         lib/ovsdb-data.c \
94         lib/ovsdb-data.h \
95         lib/ovsdb-error.c \
96         lib/ovsdb-error.h \
97         lib/ovsdb-idl-provider.h \
98         lib/ovsdb-idl.c \
99         lib/ovsdb-idl.h \
100         lib/ovsdb-parser.c \
101         lib/ovsdb-parser.h \
102         lib/ovsdb-types.c \
103         lib/ovsdb-types.h \
104         lib/packets.c \
105         lib/packets.h \
106         lib/pcap.c \
107         lib/pcap.h \
108         lib/poll-loop.c \
109         lib/poll-loop.h \
110         lib/process.c \
111         lib/process.h \
112         lib/random.c \
113         lib/random.h \
114         lib/rconn.c \
115         lib/rconn.h \
116         lib/reconnect.c \
117         lib/reconnect.h \
118         lib/sat-math.h \
119         lib/sha1.c \
120         lib/sha1.h \
121         lib/shash.c \
122         lib/shash.h \
123         lib/signals.c \
124         lib/signals.h \
125         lib/socket-util.c \
126         lib/socket-util.h \
127         lib/sort.c \
128         lib/sort.h \
129         lib/stream-fd.c \
130         lib/stream-fd.h \
131         lib/stream-provider.h \
132         lib/stream-ssl.h \
133         lib/stream-tcp.c \
134         lib/stream-unix.c \
135         lib/stream.c \
136         lib/stream.h \
137         lib/stress.c \
138         lib/stress.h \
139         lib/string.c \
140         lib/string.h \
141         lib/svec.c \
142         lib/svec.h \
143         lib/table.c \
144         lib/table.h \
145         lib/tag.c \
146         lib/tag.h \
147         lib/timeval.c \
148         lib/timeval.h \
149         lib/type-props.h \
150         lib/unaligned.h \
151         lib/unicode.c \
152         lib/unicode.h \
153         lib/unixctl.c \
154         lib/unixctl.h \
155         lib/util.c \
156         lib/util.h \
157         lib/uuid.c \
158         lib/uuid.h \
159         lib/valgrind.h \
160         lib/vconn-provider.h \
161         lib/vconn-stream.c \
162         lib/vconn.c \
163         lib/vconn.h \
164         lib/vlog.c \
165         lib/vlog.h
166 nodist_lib_libopenvswitch_a_SOURCES = \
167         lib/dirs.c
168 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
169
170 noinst_LIBRARIES += lib/libsflow.a
171 lib_libsflow_a_SOURCES = \
172         lib/sflow_api.h \
173         lib/sflow.h \
174         lib/sflow_agent.c \
175         lib/sflow_sampler.c \
176         lib/sflow_poller.c \
177         lib/sflow_receiver.c
178 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
179 if HAVE_WNO_UNUSED
180 lib_libsflow_a_CFLAGS += -Wno-unused
181 endif
182 if HAVE_WNO_UNUSED_PARAMETER
183 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
184 endif
185
186 if HAVE_NETLINK
187 lib_libopenvswitch_a_SOURCES += \
188         lib/dpif-linux.c \
189         lib/dpif-linux.h \
190         lib/netdev-linux.c \
191         lib/netdev-vport.c \
192         lib/netdev-vport.h \
193         lib/netlink-protocol.h \
194         lib/netlink-socket.c \
195         lib/netlink-socket.h \
196         lib/rtnetlink.c \
197         lib/rtnetlink.h \
198         lib/rtnetlink-link.c \
199         lib/rtnetlink-link.h \
200         lib/route-table.c \
201         lib/route-table.h
202 endif
203
204 if HAVE_OPENSSL
205 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
206 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
207 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
208         (echo '#include "lib/dhparams.h"' &&                            \
209          openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
210          openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
211          openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
212         | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
213         mv lib/dhparams.c.tmp lib/dhparams.c
214 endif
215
216 EXTRA_DIST += \
217         lib/dh1024.pem \
218         lib/dh2048.pem \
219         lib/dh4096.pem \
220         lib/dirs.c.in
221
222 EXTRA_DIST += \
223         lib/common.man \
224         lib/common-syn.man \
225         lib/daemon.man \
226         lib/daemon-syn.man \
227         lib/leak-checker.man \
228         lib/ssl-bootstrap.man \
229         lib/ssl-bootstrap-syn.man \
230         lib/ssl-peer-ca-cert.man \
231         lib/ssl.man \
232         lib/ssl-syn.man \
233         lib/stress-unixctl.man \
234         lib/table.man \
235         lib/unixctl.man \
236         lib/unixctl-syn.man \
237         lib/vconn-active.man \
238         lib/vconn-passive.man \
239         lib/vlog-unixctl.man \
240         lib/vlog-syn.man \
241         lib/vlog.man
242
243 lib/dirs.c: lib/dirs.c.in Makefile
244         ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
245                 -e 's,[@]srcdir[@],$(srcdir),g' \
246                 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
247                 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
248                 -e 's,[@]bindir[@],"$(bindir)",g' \
249                 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
250              > lib/dirs.c.tmp
251         mv lib/dirs.c.tmp lib/dirs.c
252
253 $(srcdir)/lib/ofp-errors.c: \
254         include/openflow/openflow.h include/openflow/nicira-ext.h \
255         build-aux/extract-ofp-errors
256         cd $(srcdir)/include && \
257         $(PYTHON) ../build-aux/extract-ofp-errors \
258                 openflow/openflow.h openflow/nicira-ext.h > ../lib/ofp-errors.c
259 EXTRA_DIST += build-aux/extract-ofp-errors
260
261 install-data-local: lib-install-data-local
262 lib-install-data-local:
263         $(MKDIR_P) $(DESTDIR)$(RUNDIR)
264         $(MKDIR_P) $(DESTDIR)$(PKIDIR)
265         $(MKDIR_P) $(DESTDIR)$(LOGDIR)
266
267 if !USE_LINKER_SECTIONS
268 # All distributed sources, with names adjust properly for referencing
269 # from $(builddir).
270 all_sources = \
271         `for file in $(DIST_SOURCES); do \
272                 if test -f $$file; then \
273                         echo $$file; \
274                 else \
275                         echo $(VPATH)/$$file; \
276                 fi; \
277          done`
278
279 lib/coverage.$(OBJEXT): lib/coverage.def
280 lib/coverage.def: $(DIST_SOURCES)
281         sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
282 CLEANFILES += lib/coverage.def
283
284 lib/stress.$(OBJEXT): lib/stress.def
285 lib/stress.def: $(DIST_SOURCES)
286         sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
287 CLEANFILES += lib/stress.def
288
289 lib/vlog.$(OBJEXT): lib/vlog-modules.def
290 lib/vlog-modules.def: $(DIST_SOURCES)
291         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 > $@
292 CLEANFILES += lib/vlog-modules.def
293 endif