]> git.proxmox.com Git - mirror_ovs.git/blame - lib/automake.mk
vlog: Introduce VLOG_DEFINE_THIS_MODULE for declaring vlog module in use.
[mirror_ovs.git] / lib / automake.mk
CommitLineData
59462465 1# Copyright (C) 2009, 2010 Nicira Networks, Inc.
a14bc59f
BP
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
064af421
BP
8noinst_LIBRARIES += lib/libopenvswitch.a
9
10lib_libopenvswitch_a_SOURCES = \
d918d9d1
BP
11 lib/aes128.c \
12 lib/aes128.h \
064af421
BP
13 lib/backtrace.c \
14 lib/backtrace.h \
15 lib/bitmap.c \
16 lib/bitmap.h \
1c617a49
BP
17 lib/byteq.c \
18 lib/byteq.h \
064af421
BP
19 lib/classifier.c \
20 lib/classifier.h \
21 lib/command-line.c \
22 lib/command-line.h \
23 lib/compiler.h \
24 lib/coverage.c \
25 lib/coverage.h \
064af421
BP
26 lib/coverage-counters.h \
27 lib/csum.c \
28 lib/csum.h \
29 lib/daemon.c \
30 lib/daemon.h \
31 lib/dhcp-client.c \
32 lib/dhcp-client.h \
33 lib/dhcp.c \
34 lib/dhcp.h \
35 lib/dhparams.h \
064af421 36 lib/dirs.h \
72865317 37 lib/dpif-netdev.c \
96fba48f
BP
38 lib/dpif-provider.h \
39 lib/dpif.c \
40 lib/dpif.h \
064af421
BP
41 lib/dynamic-string.c \
42 lib/dynamic-string.h \
43 lib/fatal-signal.c \
44 lib/fatal-signal.h \
064af421
BP
45 lib/flow.c \
46 lib/flow.h \
47 lib/hash.c \
48 lib/hash.h \
49 lib/hmap.c \
50 lib/hmap.h \
f38b84ea
BP
51 lib/json.c \
52 lib/json.h \
f2129093
BP
53 lib/jsonrpc.c \
54 lib/jsonrpc.h \
064af421
BP
55 lib/leak-checker.c \
56 lib/leak-checker.h \
57 lib/learning-switch.c \
58 lib/learning-switch.h \
59 lib/list.c \
60 lib/list.h \
ac718c9d
BP
61 lib/lockfile.c \
62 lib/lockfile.h \
064af421
BP
63 lib/mac-learning.c \
64 lib/mac-learning.h \
5146acb1 65 lib/netdev-provider.h \
064af421
BP
66 lib/netdev.c \
67 lib/netdev.h \
68 lib/odp-util.c \
69 lib/odp-util.h \
70 lib/ofp-print.c \
71 lib/ofp-print.h \
fa37b408
BP
72 lib/ofp-util.c \
73 lib/ofp-util.h \
064af421
BP
74 lib/ofpbuf.c \
75 lib/ofpbuf.h \
f85f8ebb
BP
76 lib/ovsdb-data.c \
77 lib/ovsdb-data.h \
78 lib/ovsdb-error.c \
79 lib/ovsdb-error.h \
c3bb4bd7
BP
80 lib/ovsdb-idl-provider.h \
81 lib/ovsdb-idl.c \
82 lib/ovsdb-idl.h \
f85f8ebb
BP
83 lib/ovsdb-parser.c \
84 lib/ovsdb-parser.h \
85 lib/ovsdb-types.c \
86 lib/ovsdb-types.h \
b9e8b45a 87 lib/packets.c \
064af421
BP
88 lib/packets.h \
89 lib/pcap.c \
90 lib/pcap.h \
91 lib/poll-loop.c \
92 lib/poll-loop.h \
93 lib/port-array.c \
94 lib/port-array.h \
95 lib/process.c \
96 lib/process.h \
97 lib/queue.c \
98 lib/queue.h \
99 lib/random.c \
100 lib/random.h \
101 lib/rconn.c \
102 lib/rconn.h \
3ed497fc
BP
103 lib/reconnect.c \
104 lib/reconnect.h \
064af421
BP
105 lib/sat-math.h \
106 lib/sha1.c \
107 lib/sha1.h \
108 lib/shash.c \
109 lib/shash.h \
110 lib/signals.c \
111 lib/signals.h \
112 lib/socket-util.c \
113 lib/socket-util.h \
f85f8ebb
BP
114 lib/sort.c \
115 lib/sort.h \
064af421
BP
116 lib/stp.c \
117 lib/stp.h \
c34b65c7
BP
118 lib/stream-fd.c \
119 lib/stream-fd.h \
120 lib/stream-provider.h \
9467fe62 121 lib/stream-ssl.h \
c34b65c7
BP
122 lib/stream-tcp.c \
123 lib/stream-unix.c \
124 lib/stream.c \
125 lib/stream.h \
59462465 126 lib/string.h \
064af421
BP
127 lib/svec.c \
128 lib/svec.h \
129 lib/tag.c \
130 lib/tag.h \
131 lib/timeval.c \
132 lib/timeval.h \
133 lib/type-props.h \
afa3a931 134 lib/unaligned.h \
f38b84ea
BP
135 lib/unicode.c \
136 lib/unicode.h \
fa0361b7
GG
137 lib/unixctl.c \
138 lib/unixctl.h \
064af421
BP
139 lib/util.c \
140 lib/util.h \
fa0361b7
GG
141 lib/uuid.c \
142 lib/uuid.h \
064af421
BP
143 lib/valgrind.h \
144 lib/vconn-provider.h \
064af421 145 lib/vconn-stream.c \
064af421
BP
146 lib/vconn.c \
147 lib/vconn.h \
148 lib/vlog-modules.def \
149 lib/vlog.c \
150 lib/vlog.h \
151 lib/xtoxll.h
424d1282 152nodist_lib_libopenvswitch_a_SOURCES = \
d06fd603 153 lib/coverage-counters.c \
424d1282
BP
154 lib/dirs.c
155CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
064af421 156
c72e245a
BP
157noinst_LIBRARIES += lib/libsflow.a
158lib_libsflow_a_SOURCES = \
159 lib/sflow_api.h \
160 lib/sflow.h \
161 lib/sflow_agent.c \
162 lib/sflow_sampler.c \
163 lib/sflow_poller.c \
164 lib/sflow_receiver.c
165lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
166if HAVE_WNO_UNUSED
167lib_libsflow_a_CFLAGS += -Wno-unused
168endif
169
064af421
BP
170if HAVE_NETLINK
171lib_libopenvswitch_a_SOURCES += \
c83cdd30
BP
172 lib/dpif-linux.c \
173 lib/netdev-gre.c \
174 lib/netdev-linux.c \
175 lib/netdev-patch.c \
176 lib/netdev-vport.c \
177 lib/netdev-vport.h \
064af421
BP
178 lib/netlink-protocol.h \
179 lib/netlink.c \
c83cdd30
BP
180 lib/netlink.h \
181 lib/rtnetlink.c \
182 lib/rtnetlink.h
064af421
BP
183endif
184
185if HAVE_OPENSSL
fe55ad15 186lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
424d1282 187nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
064af421
BP
188lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
189 (echo '#include "lib/dhparams.h"' && \
190 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
191 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
192 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
193 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
194 mv lib/dhparams.c.tmp lib/dhparams.c
195endif
196
197EXTRA_DIST += \
198 lib/dh1024.pem \
199 lib/dh2048.pem \
200 lib/dh4096.pem \
201 lib/dhparams.h
202
203EXTRA_DIST += \
204 lib/common.man \
f7f62235 205 lib/common-syn.man \
064af421 206 lib/daemon.man \
f7f62235 207 lib/daemon-syn.man \
064af421
BP
208 lib/dpif.man \
209 lib/leak-checker.man \
84ee7bcf 210 lib/ssl-bootstrap.man \
9467fe62 211 lib/ssl-bootstrap-syn.man \
84ee7bcf
BP
212 lib/ssl-peer-ca-cert.man \
213 lib/ssl.man \
9467fe62 214 lib/ssl-syn.man \
7b38bdc8
BP
215 lib/unixctl.man \
216 lib/unixctl-syn.man \
84ee7bcf
BP
217 lib/vconn-active.man \
218 lib/vconn-passive.man \
b16fdafe 219 lib/vlog-unixctl.man \
f7f62235 220 lib/vlog-syn.man \
064af421
BP
221 lib/vlog.man
222
223
064af421
BP
224lib/dirs.c: Makefile
225 ($(ro_c) && \
226 echo 'const char ovs_pkgdatadir[] = "$(pkgdatadir)";' && \
227 echo 'const char ovs_rundir[] = "@RUNDIR@";' && \
228 echo 'const char ovs_logdir[] = "@LOGDIR@";' && \
229 echo 'const char ovs_bindir[] = "$(bindir)";') > lib/dirs.c.tmp
230 mv lib/dirs.c.tmp lib/dirs.c
231
232install-data-local:
233 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
234 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
235 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
236
237# All the source files that have coverage counters.
238COVERAGE_FILES = \
064af421
BP
239 lib/dpif.c \
240 lib/flow.c \
ac718c9d 241 lib/lockfile.c \
064af421
BP
242 lib/hmap.c \
243 lib/mac-learning.c \
244 lib/netdev.c \
e9e28be3 245 lib/netdev-linux.c \
064af421
BP
246 lib/netlink.c \
247 lib/odp-util.c \
248 lib/poll-loop.c \
249 lib/process.c \
250 lib/rconn.c \
559843ed 251 lib/rtnetlink.c \
c34b65c7 252 lib/stream.c \
064af421
BP
253 lib/timeval.c \
254 lib/unixctl.c \
255 lib/util.c \
256 lib/vconn.c \
8cd4882f
BP
257 ofproto/ofproto.c \
258 ofproto/pktbuf.c \
064af421 259 vswitchd/bridge.c \
064af421
BP
260 vswitchd/ovs-brcompatd.c
261lib/coverage-counters.c: $(COVERAGE_FILES) lib/coverage-scan.pl
262 (cd $(srcdir) && $(PERL) lib/coverage-scan.pl $(COVERAGE_FILES)) > $@.tmp
263 mv $@.tmp $@
264EXTRA_DIST += lib/coverage-scan.pl
22c79496
BP
265
266
267# Make sure that every vlog module listed in vlog-modules.def is
268# actually used somewhere.
269ALL_LOCAL += check-for-unused-vlog-modules
270check-for-unused-vlog-modules:
271 if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \
272 cd $(srcdir); \
273 decl_vlog=`sed -n 's/^VLOG_MODULE(\([_a-z0-9]\{1,\}\)).*$$/\1/p' \
274 lib/vlog-modules.def | \
275 LC_ALL=C sort -u | \
276 xargs echo`; \
5136ce49
BP
277 used_vlog=`git grep VLOG_DEFINE_THIS_MODULE | \
278 sed -n 's/.*VLOG_DEFINE_THIS_MODULE(\([a-z_0-9]\{1,\}\)).*/\1/p' | \
22c79496
BP
279 LC_ALL=C sort -u | \
280 xargs echo`; \
281 rc=0; \
282 for decl in $$decl_vlog; do \
283 case " $$used_vlog " in \
284 *" $$decl "*) ;; \
285 *) echo "vlog module $$decl is declared in lib/vlog-modules.def \
286but not used by any source file"; \
287 rc=1 ;; \
288 esac \
289 done; \
290 exit $$rc; \
291 fi
292.PHONY: check-for-unused-vlog-modules