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