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