4c6a87720e9becc9b0eee2a6961e41d3eec83f5c
[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/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-parse.c \
85         lib/ofp-parse.h \
86         lib/ofp-print.c \
87         lib/ofp-print.h \
88         lib/ofp-util.c \
89         lib/ofp-util.h \
90         lib/ofpbuf.c \
91         lib/ofpbuf.h \
92         lib/ovsdb-data.c \
93         lib/ovsdb-data.h \
94         lib/ovsdb-error.c \
95         lib/ovsdb-error.h \
96         lib/ovsdb-idl-provider.h \
97         lib/ovsdb-idl.c \
98         lib/ovsdb-idl.h \
99         lib/ovsdb-parser.c \
100         lib/ovsdb-parser.h \
101         lib/ovsdb-types.c \
102         lib/ovsdb-types.h \
103         lib/packets.c \
104         lib/packets.h \
105         lib/pcap.c \
106         lib/pcap.h \
107         lib/poll-loop.c \
108         lib/poll-loop.h \
109         lib/process.c \
110         lib/process.h \
111         lib/random.c \
112         lib/random.h \
113         lib/rconn.c \
114         lib/rconn.h \
115         lib/reconnect.c \
116         lib/reconnect.h \
117         lib/sat-math.h \
118         lib/sha1.c \
119         lib/sha1.h \
120         lib/shash.c \
121         lib/shash.h \
122         lib/signals.c \
123         lib/signals.h \
124         lib/socket-util.c \
125         lib/socket-util.h \
126         lib/sort.c \
127         lib/sort.h \
128         lib/stream-fd.c \
129         lib/stream-fd.h \
130         lib/stream-provider.h \
131         lib/stream-ssl.h \
132         lib/stream-tcp.c \
133         lib/stream-unix.c \
134         lib/stream.c \
135         lib/stream.h \
136         lib/stress.c \
137         lib/stress.h \
138         lib/string.h \
139         lib/svec.c \
140         lib/svec.h \
141         lib/tag.c \
142         lib/tag.h \
143         lib/timeval.c \
144         lib/timeval.h \
145         lib/type-props.h \
146         lib/unaligned.h \
147         lib/unicode.c \
148         lib/unicode.h \
149         lib/unixctl.c \
150         lib/unixctl.h \
151         lib/util.c \
152         lib/util.h \
153         lib/uuid.c \
154         lib/uuid.h \
155         lib/valgrind.h \
156         lib/vconn-provider.h \
157         lib/vconn-stream.c \
158         lib/vconn.c \
159         lib/vconn.h \
160         lib/vlog.c \
161         lib/vlog.h
162 nodist_lib_libopenvswitch_a_SOURCES = \
163         lib/dirs.c
164 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
165
166 noinst_LIBRARIES += lib/libsflow.a
167 lib_libsflow_a_SOURCES = \
168         lib/sflow_api.h \
169         lib/sflow.h \
170         lib/sflow_agent.c \
171         lib/sflow_sampler.c \
172         lib/sflow_poller.c \
173         lib/sflow_receiver.c
174 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
175 if HAVE_WNO_UNUSED
176 lib_libsflow_a_CFLAGS += -Wno-unused
177 endif
178 if HAVE_WNO_UNUSED_PARAMETER
179 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
180 endif
181
182 if HAVE_NETLINK
183 lib_libopenvswitch_a_SOURCES += \
184         lib/dpif-linux.c \
185         lib/netdev-linux.c \
186         lib/netdev-vport.c \
187         lib/netdev-vport.h \
188         lib/netlink-protocol.h \
189         lib/netlink-socket.c \
190         lib/netlink-socket.h \
191         lib/rtnetlink.c \
192         lib/rtnetlink.h \
193         lib/rtnetlink-link.c \
194         lib/rtnetlink-link.h
195 endif
196
197 if HAVE_OPENSSL
198 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
199 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
200 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
201         (echo '#include "lib/dhparams.h"' &&                            \
202          openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
203          openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
204          openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
205         | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
206         mv lib/dhparams.c.tmp lib/dhparams.c
207 endif
208
209 EXTRA_DIST += \
210         lib/dh1024.pem \
211         lib/dh2048.pem \
212         lib/dh4096.pem \
213         lib/dirs.c.in
214
215 EXTRA_DIST += \
216         lib/common.man \
217         lib/common-syn.man \
218         lib/daemon.man \
219         lib/daemon-syn.man \
220         lib/dpif.man \
221         lib/leak-checker.man \
222         lib/ssl-bootstrap.man \
223         lib/ssl-bootstrap-syn.man \
224         lib/ssl-peer-ca-cert.man \
225         lib/ssl.man \
226         lib/ssl-syn.man \
227         lib/stress-unixctl.man \
228         lib/unixctl.man \
229         lib/unixctl-syn.man \
230         lib/vconn-active.man \
231         lib/vconn-passive.man \
232         lib/vlog-unixctl.man \
233         lib/vlog-syn.man \
234         lib/vlog.man
235
236 lib/dirs.c: lib/dirs.c.in Makefile
237         ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
238                 -e 's,[@]srcdir[@],$(srcdir),g' \
239                 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
240                 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
241                 -e 's,[@]bindir[@],"$(bindir)",g' \
242                 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
243              > lib/dirs.c.tmp
244         mv lib/dirs.c.tmp lib/dirs.c
245
246 install-data-local: lib-install-data-local
247 lib-install-data-local:
248         $(MKDIR_P) $(DESTDIR)$(RUNDIR)
249         $(MKDIR_P) $(DESTDIR)$(PKIDIR)
250         $(MKDIR_P) $(DESTDIR)$(LOGDIR)
251
252 if !USE_LINKER_SECTIONS
253 # All distributed sources, with names adjust properly for referencing
254 # from $(builddir).
255 all_sources = \
256         `for file in $(DIST_SOURCES); do \
257                 if test -f $$file; then \
258                         echo $$file; \
259                 else \
260                         echo $(VPATH)/$$file; \
261                 fi; \
262          done`
263
264 lib/coverage.$(OBJEXT): lib/coverage.def
265 lib/coverage.def: $(DIST_SOURCES)
266         sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
267 CLEANFILES += lib/coverage.def
268
269 lib/stress.$(OBJEXT): lib/stress.def
270 lib/stress.def: $(DIST_SOURCES)
271         sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
272 CLEANFILES += lib/stress.def
273
274 lib/vlog.$(OBJEXT): lib/vlog-modules.def
275 lib/vlog-modules.def: $(DIST_SOURCES)
276         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 > $@
277 CLEANFILES += lib/vlog-modules.def
278 endif