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