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