rhel: Prevent duplicate ifup calls.
[sliver-openvswitch.git] / lib / automake.mk
1 # Copyright (C) 2009, 2010, 2011, 2012 Nicira, 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/bond.c \
18         lib/bond.h \
19         lib/bundle.c \
20         lib/bundle.h \
21         lib/byte-order.h \
22         lib/byteq.c \
23         lib/byteq.h \
24         lib/cfm.c \
25         lib/cfm.h \
26         lib/classifier.c \
27         lib/classifier.h \
28         lib/command-line.c \
29         lib/command-line.h \
30         lib/compiler.h \
31         lib/coverage.c \
32         lib/coverage.h \
33         lib/csum.c \
34         lib/csum.h \
35         lib/daemon.c \
36         lib/daemon.h \
37         lib/dhcp.h \
38         lib/dummy.c \
39         lib/dummy.h \
40         lib/dhparams.h \
41         lib/dirs.h \
42         lib/dpif-netdev.c \
43         lib/dpif-provider.h \
44         lib/dpif.c \
45         lib/dpif.h \
46         lib/heap.c \
47         lib/heap.h \
48         lib/dynamic-string.c \
49         lib/dynamic-string.h \
50         lib/entropy.c \
51         lib/entropy.h \
52         lib/fatal-signal.c \
53         lib/fatal-signal.h \
54         lib/flow.c \
55         lib/flow.h \
56         lib/hash.c \
57         lib/hash.h \
58         lib/hmap.c \
59         lib/hmap.h \
60         lib/hmapx.c \
61         lib/hmapx.h \
62         lib/jhash.c \
63         lib/jhash.h \
64         lib/json.c \
65         lib/json.h \
66         lib/jsonrpc.c \
67         lib/jsonrpc.h \
68         lib/lacp.c \
69         lib/lacp.h \
70         lib/leak-checker.c \
71         lib/leak-checker.h \
72         lib/learn.c \
73         lib/learn.h \
74         lib/learning-switch.c \
75         lib/learning-switch.h \
76         lib/list.c \
77         lib/list.h \
78         lib/lockfile.c \
79         lib/lockfile.h \
80         lib/mac-learning.c \
81         lib/mac-learning.h \
82         lib/match.c \
83         lib/match.h \
84         lib/memory.c \
85         lib/memory.h \
86         lib/meta-flow.c \
87         lib/meta-flow.h \
88         lib/multipath.c \
89         lib/multipath.h \
90         lib/netdev-dummy.c \
91         lib/netdev-provider.h \
92         lib/netdev-vport.c \
93         lib/netdev-vport.h \
94         lib/netdev.c \
95         lib/netdev.h \
96         lib/netflow.h \
97         lib/netlink.c \
98         lib/netlink.h \
99         lib/nx-match.c \
100         lib/nx-match.h \
101         lib/odp-util.c \
102         lib/odp-util.h \
103         lib/ofp-actions.c \
104         lib/ofp-actions.h \
105         lib/ofp-errors.c \
106         lib/ofp-errors.h \
107         lib/ofp-msgs.c \
108         lib/ofp-msgs.h \
109         lib/ofp-parse.c \
110         lib/ofp-parse.h \
111         lib/ofp-print.c \
112         lib/ofp-print.h \
113         lib/ofp-util.c \
114         lib/ofp-util.def \
115         lib/ofp-util.h \
116         lib/ofp-version-opt.h \
117         lib/ofp-version-opt.c \
118         lib/ofpbuf.c \
119         lib/ofpbuf.h \
120         lib/ovsdb-data.c \
121         lib/ovsdb-data.h \
122         lib/ovsdb-error.c \
123         lib/ovsdb-error.h \
124         lib/ovsdb-idl-provider.h \
125         lib/ovsdb-idl.c \
126         lib/ovsdb-idl.h \
127         lib/ovsdb-parser.c \
128         lib/ovsdb-parser.h \
129         lib/ovsdb-types.c \
130         lib/ovsdb-types.h \
131         lib/packets.c \
132         lib/packets.h \
133         lib/pcap-file.c \
134         lib/pcap-file.h \
135         lib/poll-loop.c \
136         lib/poll-loop.h \
137         lib/process.c \
138         lib/process.h \
139         lib/random.c \
140         lib/random.h \
141         lib/rconn.c \
142         lib/rconn.h \
143         lib/reconnect.c \
144         lib/reconnect.h \
145         lib/sat-math.h \
146         lib/sha1.c \
147         lib/sha1.h \
148         lib/shash.c \
149         lib/shash.h \
150         lib/simap.c \
151         lib/simap.h \
152         lib/signals.c \
153         lib/signals.h \
154         lib/smap.c \
155         lib/smap.h \
156         lib/socket-util.c \
157         lib/socket-util.h \
158         lib/sort.c \
159         lib/sort.h \
160         lib/sset.c \
161         lib/sset.h \
162         lib/stp.c \
163         lib/stp.h \
164         lib/stream-fd.c \
165         lib/stream-fd.h \
166         lib/stream-provider.h \
167         lib/stream-ssl.h \
168         lib/stream-tcp.c \
169         lib/stream-unix.c \
170         lib/stream.c \
171         lib/stream.h \
172         lib/stress.c \
173         lib/stress.h \
174         lib/string.c \
175         lib/string.h \
176         lib/svec.c \
177         lib/svec.h \
178         lib/table.c \
179         lib/table.h \
180         lib/tag.c \
181         lib/tag.h \
182         lib/timer.c \
183         lib/timer.h \
184         lib/timeval.c \
185         lib/timeval.h \
186         lib/token-bucket.c \
187         lib/token-bucket.h \
188         lib/type-props.h \
189         lib/unaligned.h \
190         lib/unicode.c \
191         lib/unicode.h \
192         lib/unixctl.c \
193         lib/unixctl.h \
194         lib/util.c \
195         lib/util.h \
196         lib/uuid.c \
197         lib/uuid.h \
198         lib/valgrind.h \
199         lib/vconn-provider.h \
200         lib/vconn-stream.c \
201         lib/vconn.c \
202         lib/vconn.h \
203         lib/vlan-bitmap.c \
204         lib/vlan-bitmap.h \
205         lib/vlandev.c \
206         lib/vlandev.h \
207         lib/vlog.c \
208         lib/vlog.h \
209         lib/vswitch-idl.c \
210         lib/vswitch-idl.h \
211         lib/worker.c \
212         lib/worker.h
213
214 nodist_lib_libopenvswitch_a_SOURCES = \
215         lib/dirs.c
216 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
217
218 noinst_LIBRARIES += lib/libsflow.a
219 lib_libsflow_a_SOURCES = \
220         lib/sflow_api.h \
221         lib/sflow.h \
222         lib/sflow_agent.c \
223         lib/sflow_sampler.c \
224         lib/sflow_poller.c \
225         lib/sflow_receiver.c
226 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
227 if HAVE_WNO_UNUSED
228 lib_libsflow_a_CFLAGS += -Wno-unused
229 endif
230 if HAVE_WNO_UNUSED_PARAMETER
231 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
232 endif
233
234 if LINUX_DATAPATH
235 lib_libopenvswitch_a_SOURCES += \
236         lib/dpif-linux.c \
237         lib/dpif-linux.h \
238         lib/netdev-linux.c \
239         lib/netdev-linux.h \
240         lib/netlink-notifier.c \
241         lib/netlink-notifier.h \
242         lib/netlink-protocol.h \
243         lib/netlink-socket.c \
244         lib/netlink-socket.h \
245         lib/rtnetlink-link.c \
246         lib/rtnetlink-link.h \
247         lib/route-table.c \
248         lib/route-table.h
249 endif
250
251 if ESX
252 lib_libopenvswitch_a_SOURCES += \
253         lib/route-table-stub.c
254 endif
255
256 if HAVE_IF_DL
257 lib_libopenvswitch_a_SOURCES += \
258         lib/netdev-bsd.c \
259         lib/rtbsd.c \
260         lib/rtbsd.h \
261         lib/route-table-bsd.c
262 endif
263
264 if HAVE_OPENSSL
265 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
266 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
267 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
268         (echo '#include "lib/dhparams.h"' &&                            \
269          openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
270          openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
271          openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
272         | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
273         mv lib/dhparams.c.tmp lib/dhparams.c
274 else
275 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
276 endif
277
278 EXTRA_DIST += \
279         lib/dh1024.pem \
280         lib/dh2048.pem \
281         lib/dh4096.pem \
282         lib/dirs.c.in
283
284 MAN_FRAGMENTS += \
285         lib/common.man \
286         lib/common-syn.man \
287         lib/coverage-unixctl.man \
288         lib/daemon.man \
289         lib/daemon-syn.man \
290         lib/leak-checker.man \
291         lib/memory-unixctl.man \
292         lib/ofp-version.man \
293         lib/ovs.tmac \
294         lib/ssl-bootstrap.man \
295         lib/ssl-bootstrap-syn.man \
296         lib/ssl-peer-ca-cert.man \
297         lib/ssl.man \
298         lib/ssl-syn.man \
299         lib/stress-unixctl.man \
300         lib/table.man \
301         lib/unixctl.man \
302         lib/unixctl-syn.man \
303         lib/vconn-active.man \
304         lib/vconn-passive.man \
305         lib/vlog-unixctl.man \
306         lib/vlog-syn.man \
307         lib/vlog.man
308
309 # vswitch IDL
310 OVSIDL_BUILT += \
311         $(srcdir)/lib/vswitch-idl.c \
312         $(srcdir)/lib/vswitch-idl.h \
313         $(srcdir)/lib/vswitch-idl.ovsidl
314
315 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
316 VSWITCH_IDL_FILES = \
317         $(srcdir)/vswitchd/vswitch.ovsschema \
318         $(srcdir)/lib/vswitch-idl.ann
319 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
320         $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
321         mv $@.tmp $@
322
323 lib/dirs.c: lib/dirs.c.in Makefile
324         ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
325                 -e 's,[@]srcdir[@],$(srcdir),g' \
326                 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
327                 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
328                 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
329                 -e 's,[@]bindir[@],"$(bindir)",g' \
330                 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
331                 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
332              > lib/dirs.c.tmp
333         mv lib/dirs.c.tmp lib/dirs.c
334
335 $(srcdir)/lib/ofp-errors.inc: \
336         lib/ofp-errors.h $(srcdir)/build-aux/extract-ofp-errors
337         $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
338                 $(srcdir)/lib/ofp-errors.h > $@.tmp && mv $@.tmp $@
339 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
340 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
341
342 $(srcdir)/lib/ofp-msgs.inc: \
343         lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
344         $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
345                 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
346 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
347 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
348
349 INSTALL_DATA_LOCAL += lib-install-data-local
350 lib-install-data-local:
351         $(MKDIR_P) $(DESTDIR)$(RUNDIR)
352         $(MKDIR_P) $(DESTDIR)$(PKIDIR)
353         $(MKDIR_P) $(DESTDIR)$(LOGDIR)
354         $(MKDIR_P) $(DESTDIR)$(DBDIR)
355
356 if !USE_LINKER_SECTIONS
357 # All distributed sources, with names adjust properly for referencing
358 # from $(builddir).
359 all_sources = \
360         `for file in $(DIST_SOURCES); do \
361                 if test -f $$file; then \
362                         echo $$file; \
363                 else \
364                         echo $(VPATH)/$$file; \
365                 fi; \
366          done`
367
368 lib/coverage.$(OBJEXT): lib/coverage.def
369 lib/coverage.def: $(DIST_SOURCES)
370         sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
371 CLEANFILES += lib/coverage.def
372
373 lib/stress.$(OBJEXT): lib/stress.def
374 lib/stress.def: $(DIST_SOURCES)
375         sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
376 CLEANFILES += lib/stress.def
377
378 lib/vlog.$(OBJEXT): lib/vlog-modules.def
379 lib/vlog-modules.def: $(DIST_SOURCES)
380         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 > $@
381 CLEANFILES += lib/vlog-modules.def
382 endif