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