]> git.proxmox.com Git - ovs.git/blob - lib/automake.mk
Better abstract OpenFlow error codes.
[ovs.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.inc: \
282 lib/ofp-errors.h $(srcdir)/build-aux/extract-ofp-errors
283 $(PYTHON) $(srcdir)/build-aux/extract-ofp-errors \
284 $(srcdir)/lib/ofp-errors.h > $@.tmp && mv $@.tmp $@
285 lib/ofp-errors.c: lib/ofp-errors.inc
286 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
287
288 INSTALL_DATA_LOCAL += lib-install-data-local
289 lib-install-data-local:
290 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
291 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
292 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
293
294 if !USE_LINKER_SECTIONS
295 # All distributed sources, with names adjust properly for referencing
296 # from $(builddir).
297 all_sources = \
298 `for file in $(DIST_SOURCES); do \
299 if test -f $$file; then \
300 echo $$file; \
301 else \
302 echo $(VPATH)/$$file; \
303 fi; \
304 done`
305
306 lib/coverage.$(OBJEXT): lib/coverage.def
307 lib/coverage.def: $(DIST_SOURCES)
308 sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
309 CLEANFILES += lib/coverage.def
310
311 lib/stress.$(OBJEXT): lib/stress.def
312 lib/stress.def: $(DIST_SOURCES)
313 sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
314 CLEANFILES += lib/stress.def
315
316 lib/vlog.$(OBJEXT): lib/vlog-modules.def
317 lib/vlog-modules.def: $(DIST_SOURCES)
318 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 > $@
319 CLEANFILES += lib/vlog-modules.def
320 endif