4ebbb19af21aba1c07b68d01ffd6ab36b08c584f
[sliver-openvswitch.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/classifier.c \
21         lib/classifier.h \
22         lib/command-line.c \
23         lib/command-line.h \
24         lib/compiler.h \
25         lib/coverage.c \
26         lib/coverage.h \
27         lib/coverage-counters.h \
28         lib/csum.c \
29         lib/csum.h \
30         lib/daemon.c \
31         lib/daemon.h \
32         lib/dhcp-client.c \
33         lib/dhcp-client.h \
34         lib/dhcp.c \
35         lib/dhcp.h \
36         lib/dhparams.h \
37         lib/dirs.h \
38         lib/dpif-netdev.c \
39         lib/dpif-provider.h \
40         lib/dpif.c \
41         lib/dpif.h \
42         lib/dynamic-string.c \
43         lib/dynamic-string.h \
44         lib/entropy.c \
45         lib/entropy.h \
46         lib/fatal-signal.c \
47         lib/fatal-signal.h \
48         lib/flow.c \
49         lib/flow.h \
50         lib/hash.c \
51         lib/hash.h \
52         lib/hmap.c \
53         lib/hmap.h \
54         lib/json.c \
55         lib/json.h \
56         lib/jsonrpc.c \
57         lib/jsonrpc.h \
58         lib/leak-checker.c \
59         lib/leak-checker.h \
60         lib/learning-switch.c \
61         lib/learning-switch.h \
62         lib/list.c \
63         lib/list.h \
64         lib/lockfile.c \
65         lib/lockfile.h \
66         lib/mac-learning.c \
67         lib/mac-learning.h \
68         lib/netdev-provider.h \
69         lib/netdev.c \
70         lib/netdev.h \
71         lib/nx-match.c \
72         lib/nx-match.def \
73         lib/nx-match.h \
74         lib/odp-util.c \
75         lib/odp-util.h \
76         lib/ofp-parse.c \
77         lib/ofp-parse.h \
78         lib/ofp-print.c \
79         lib/ofp-print.h \
80         lib/ofp-util.c \
81         lib/ofp-util.h \
82         lib/ofpbuf.c \
83         lib/ofpbuf.h \
84         lib/ovsdb-data.c \
85         lib/ovsdb-data.h \
86         lib/ovsdb-error.c \
87         lib/ovsdb-error.h \
88         lib/ovsdb-idl-provider.h \
89         lib/ovsdb-idl.c \
90         lib/ovsdb-idl.h \
91         lib/ovsdb-parser.c \
92         lib/ovsdb-parser.h \
93         lib/ovsdb-types.c \
94         lib/ovsdb-types.h \
95         lib/packets.c \
96         lib/packets.h \
97         lib/pcap.c \
98         lib/pcap.h \
99         lib/poll-loop.c \
100         lib/poll-loop.h \
101         lib/port-array.c \
102         lib/port-array.h \
103         lib/process.c \
104         lib/process.h \
105         lib/queue.c \
106         lib/queue.h \
107         lib/random.c \
108         lib/random.h \
109         lib/rconn.c \
110         lib/rconn.h \
111         lib/reconnect.c \
112         lib/reconnect.h \
113         lib/sat-math.h \
114         lib/sha1.c \
115         lib/sha1.h \
116         lib/shash.c \
117         lib/shash.h \
118         lib/signals.c \
119         lib/signals.h \
120         lib/socket-util.c \
121         lib/socket-util.h \
122         lib/sort.c \
123         lib/sort.h \
124         lib/stream-fd.c \
125         lib/stream-fd.h \
126         lib/stream-provider.h \
127         lib/stream-ssl.h \
128         lib/stream-tcp.c \
129         lib/stream-unix.c \
130         lib/stream.c \
131         lib/stream.h \
132         lib/string.h \
133         lib/svec.c \
134         lib/svec.h \
135         lib/tag.c \
136         lib/tag.h \
137         lib/timeval.c \
138         lib/timeval.h \
139         lib/type-props.h \
140         lib/unaligned.h \
141         lib/unicode.c \
142         lib/unicode.h \
143         lib/unixctl.c \
144         lib/unixctl.h \
145         lib/util.c \
146         lib/util.h \
147         lib/uuid.c \
148         lib/uuid.h \
149         lib/valgrind.h \
150         lib/vconn-provider.h \
151         lib/vconn-stream.c \
152         lib/vconn.c \
153         lib/vconn.h \
154         lib/vlog-modules.def \
155         lib/vlog.c \
156         lib/vlog.h
157 nodist_lib_libopenvswitch_a_SOURCES = \
158         lib/coverage-counters.c \
159         lib/dirs.c
160 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
161
162 noinst_LIBRARIES += lib/libsflow.a
163 lib_libsflow_a_SOURCES = \
164         lib/sflow_api.h \
165         lib/sflow.h \
166         lib/sflow_agent.c \
167         lib/sflow_sampler.c \
168         lib/sflow_poller.c \
169         lib/sflow_receiver.c
170 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
171 if HAVE_WNO_UNUSED
172 lib_libsflow_a_CFLAGS += -Wno-unused
173 endif
174 if HAVE_WNO_UNUSED_PARAMETER
175 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
176 endif
177
178 if HAVE_NETLINK
179 lib_libopenvswitch_a_SOURCES += \
180         lib/dpif-linux.c \
181         lib/netdev-linux.c \
182         lib/netdev-vport.c \
183         lib/netdev-vport.h \
184         lib/netlink-protocol.h \
185         lib/netlink.c \
186         lib/netlink.h \
187         lib/rtnetlink.c \
188         lib/rtnetlink.h
189 endif
190
191 if HAVE_OPENSSL
192 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
193 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
194 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
195         (echo '#include "lib/dhparams.h"' &&                            \
196          openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
197          openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
198          openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
199         | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
200         mv lib/dhparams.c.tmp lib/dhparams.c
201 endif
202
203 EXTRA_DIST += \
204         lib/dh1024.pem \
205         lib/dh2048.pem \
206         lib/dh4096.pem
207
208 EXTRA_DIST += \
209         lib/common.man \
210         lib/common-syn.man \
211         lib/daemon.man \
212         lib/daemon-syn.man \
213         lib/dpif.man \
214         lib/leak-checker.man \
215         lib/ssl-bootstrap.man \
216         lib/ssl-bootstrap-syn.man \
217         lib/ssl-peer-ca-cert.man \
218         lib/ssl.man \
219         lib/ssl-syn.man \
220         lib/unixctl.man \
221         lib/unixctl-syn.man \
222         lib/vconn-active.man \
223         lib/vconn-passive.man \
224         lib/vlog-unixctl.man \
225         lib/vlog-syn.man \
226         lib/vlog.man
227
228 lib/dirs.c: Makefile
229         ($(ro_c) && \
230          echo 'const char ovs_pkgdatadir[] = "$(pkgdatadir)";' && \
231          echo 'const char ovs_rundir[] = "@RUNDIR@";' && \
232          echo 'const char ovs_logdir[] = "@LOGDIR@";' && \
233          echo 'const char ovs_bindir[] = "$(bindir)";') > lib/dirs.c.tmp
234         mv lib/dirs.c.tmp lib/dirs.c
235
236 install-data-local: lib-install-data-local
237 lib-install-data-local:
238         $(MKDIR_P) $(DESTDIR)$(RUNDIR)
239         $(MKDIR_P) $(DESTDIR)$(PKIDIR)
240         $(MKDIR_P) $(DESTDIR)$(LOGDIR)
241
242 # All the source files that have coverage counters.
243 COVERAGE_FILES = \
244         lib/dpif.c \
245         lib/flow.c \
246         lib/lockfile.c \
247         lib/hmap.c \
248         lib/mac-learning.c \
249         lib/netdev.c \
250         lib/netdev-linux.c \
251         lib/netlink.c \
252         lib/odp-util.c \
253         lib/poll-loop.c \
254         lib/process.c \
255         lib/rconn.c \
256         lib/rtnetlink.c \
257         lib/stream.c \
258         lib/stream-ssl.c \
259         lib/timeval.c \
260         lib/unixctl.c \
261         lib/util.c \
262         lib/vconn.c \
263         ofproto/ofproto.c \
264         ofproto/pktbuf.c \
265         vswitchd/bridge.c \
266         vswitchd/ovs-brcompatd.c
267 lib/coverage-counters.c: $(COVERAGE_FILES) lib/coverage-scan.pl
268         (cd $(srcdir) && $(PERL) lib/coverage-scan.pl $(COVERAGE_FILES)) > $@.tmp
269         mv $@.tmp $@
270 EXTRA_DIST += lib/coverage-scan.pl
271
272 ALL_LOCAL += check-vlog-modules
273 check-vlog-modules:
274         cd $(srcdir) && build-aux/check-vlog-modules
275 .PHONY: check-vlog-modules
276 EXTRA_DIST += build-aux/check-vlog-modules