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