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