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