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