ovs-atomic-types: Move into ovs-atomic.h.
[sliver-openvswitch.git] / lib / automake.mk
1 # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 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 lib_LTLIBRARIES += lib/libopenvswitch.la
9
10 lib_libopenvswitch_la_LIBADD = $(SSL_LIBS)
11
12 if WIN32
13 lib_libopenvswitch_la_LIBADD += ${PTHREAD_LIBS}
14 endif
15
16 lib_libopenvswitch_la_LDFLAGS = -release $(VERSION)
17
18 lib_libopenvswitch_la_SOURCES = \
19         lib/aes128.c \
20         lib/aes128.h \
21         lib/async-append.h \
22         lib/backtrace.c \
23         lib/backtrace.h \
24         lib/bfd.c \
25         lib/bfd.h \
26         lib/bitmap.c \
27         lib/bitmap.h \
28         lib/bundle.c \
29         lib/bundle.h \
30         lib/byte-order.h \
31         lib/byteq.c \
32         lib/byteq.h \
33         lib/cfm.c \
34         lib/cfm.h \
35         lib/classifier.c \
36         lib/classifier.h \
37         lib/command-line.c \
38         lib/command-line.h \
39         lib/compiler.h \
40         lib/connectivity.c \
41         lib/connectivity.h \
42         lib/coverage.c \
43         lib/coverage.h \
44         lib/crc32c.c \
45         lib/crc32c.h \
46         lib/csum.c \
47         lib/csum.h \
48         lib/daemon.h \
49         lib/dhcp.h \
50         lib/dummy.c \
51         lib/dummy.h \
52         lib/dhparams.h \
53         lib/dirs.h \
54         lib/dpif-netdev.c \
55         lib/dpif-provider.h \
56         lib/dpif.c \
57         lib/dpif.h \
58         lib/heap.c \
59         lib/heap.h \
60         lib/dynamic-string.c \
61         lib/dynamic-string.h \
62         lib/entropy.c \
63         lib/entropy.h \
64         lib/fat-rwlock.c \
65         lib/fat-rwlock.h \
66         lib/fatal-signal.c \
67         lib/fatal-signal.h \
68         lib/flow.c \
69         lib/flow.h \
70         lib/guarded-list.c \
71         lib/guarded-list.h \
72         lib/hash.c \
73         lib/hash.h \
74         lib/hindex.c \
75         lib/hindex.h \
76         lib/hmap.c \
77         lib/hmap.h \
78         lib/hmapx.c \
79         lib/hmapx.h \
80         lib/jhash.c \
81         lib/jhash.h \
82         lib/json.c \
83         lib/json.h \
84         lib/jsonrpc.c \
85         lib/jsonrpc.h \
86         lib/lacp.c \
87         lib/lacp.h \
88         lib/latch.h \
89         lib/learn.c \
90         lib/learn.h \
91         lib/learning-switch.c \
92         lib/learning-switch.h \
93         lib/list.c \
94         lib/list.h \
95         lib/lockfile.c \
96         lib/lockfile.h \
97         lib/mac-learning.c \
98         lib/mac-learning.h \
99         lib/match.c \
100         lib/match.h \
101         lib/memory.c \
102         lib/memory.h \
103         lib/meta-flow.c \
104         lib/meta-flow.h \
105         lib/multipath.c \
106         lib/multipath.h \
107         lib/netdev-dummy.c \
108         lib/netdev-provider.h \
109         lib/netdev-vport.c \
110         lib/netdev-vport.h \
111         lib/netdev.c \
112         lib/netdev.h \
113         lib/netflow.h \
114         lib/netlink.c \
115         lib/netlink.h \
116         lib/nx-match.c \
117         lib/nx-match.h \
118         lib/odp-execute.c \
119         lib/odp-execute.h \
120         lib/odp-util.c \
121         lib/odp-util.h \
122         lib/ofp-actions.c \
123         lib/ofp-actions.h \
124         lib/ofp-errors.c \
125         lib/ofp-errors.h \
126         lib/ofp-msgs.c \
127         lib/ofp-msgs.h \
128         lib/ofp-parse.c \
129         lib/ofp-parse.h \
130         lib/ofp-print.c \
131         lib/ofp-print.h \
132         lib/ofp-util.c \
133         lib/ofp-util.def \
134         lib/ofp-util.h \
135         lib/ofp-version-opt.h \
136         lib/ofp-version-opt.c \
137         lib/ofpbuf.c \
138         lib/ofpbuf.h \
139         lib/ovs-atomic-c11.h \
140         lib/ovs-atomic-clang.h \
141         lib/ovs-atomic-flag-gcc4.7+.h \
142         lib/ovs-atomic-gcc4+.h \
143         lib/ovs-atomic-gcc4.7+.h \
144         lib/ovs-atomic-locked.c \
145         lib/ovs-atomic-locked.h \
146         lib/ovs-atomic-pthreads.h \
147         lib/ovs-atomic.h \
148         lib/ovs-thread.c \
149         lib/ovs-thread.h \
150         lib/ovsdb-data.c \
151         lib/ovsdb-data.h \
152         lib/ovsdb-error.c \
153         lib/ovsdb-error.h \
154         lib/ovsdb-idl-provider.h \
155         lib/ovsdb-idl.c \
156         lib/ovsdb-idl.h \
157         lib/ovsdb-parser.c \
158         lib/ovsdb-parser.h \
159         lib/ovsdb-types.c \
160         lib/ovsdb-types.h \
161         lib/packets.c \
162         lib/packets.h \
163         lib/pcap-file.c \
164         lib/pcap-file.h \
165         lib/poll-loop.c \
166         lib/poll-loop.h \
167         lib/process.c \
168         lib/process.h \
169         lib/random.c \
170         lib/random.h \
171         lib/rconn.c \
172         lib/rconn.h \
173         lib/reconnect.c \
174         lib/reconnect.h \
175         lib/sat-math.h \
176         lib/seq.c \
177         lib/seq.h \
178         lib/sha1.c \
179         lib/sha1.h \
180         lib/shash.c \
181         lib/shash.h \
182         lib/simap.c \
183         lib/simap.h \
184         lib/smap.c \
185         lib/smap.h \
186         lib/socket-util.c \
187         lib/socket-util.h \
188         lib/sort.c \
189         lib/sort.h \
190         lib/sset.c \
191         lib/sset.h \
192         lib/stp.c \
193         lib/stp.h \
194         lib/stream-fd.h \
195         lib/stream-provider.h \
196         lib/stream-ssl.h \
197         lib/stream-tcp.c \
198         lib/stream.c \
199         lib/stream.h \
200         lib/stdio.c \
201         lib/string.c \
202         lib/svec.c \
203         lib/svec.h \
204         lib/table.c \
205         lib/table.h \
206         lib/tag.c \
207         lib/tag.h \
208         lib/timer.c \
209         lib/timer.h \
210         lib/timeval.c \
211         lib/timeval.h \
212         lib/token-bucket.c \
213         lib/token-bucket.h \
214         lib/type-props.h \
215         lib/unaligned.h \
216         lib/unicode.c \
217         lib/unicode.h \
218         lib/unixctl.c \
219         lib/unixctl.h \
220         lib/util.c \
221         lib/util.h \
222         lib/uuid.c \
223         lib/uuid.h \
224         lib/valgrind.h \
225         lib/vconn-provider.h \
226         lib/vconn-stream.c \
227         lib/vconn.c \
228         lib/vconn.h \
229         lib/vlan-bitmap.c \
230         lib/vlan-bitmap.h \
231         lib/vlandev.c \
232         lib/vlandev.h \
233         lib/vlog.c \
234         lib/vlog.h \
235         lib/vswitch-idl.c \
236         lib/vswitch-idl.h \
237         lib/vtep-idl.c \
238         lib/vtep-idl.h
239
240 if WIN32
241 lib_libopenvswitch_la_SOURCES += \
242         lib/daemon-windows.c \
243         lib/getopt_long.c \
244         lib/getrusage-windows.c \
245         lib/latch-windows.c \
246         lib/route-table-stub.c \
247         lib/stream-fd-windows.c
248 else
249 lib_libopenvswitch_la_SOURCES += \
250         lib/daemon.c \
251         lib/latch-unix.c \
252         lib/signals.c \
253         lib/signals.h \
254         lib/stream-fd-unix.c \
255         lib/stream-unix.c
256 endif
257
258 EXTRA_DIST += \
259         lib/stdio.h.in \
260         lib/string.h.in
261
262 nodist_lib_libopenvswitch_la_SOURCES = \
263         lib/dirs.c
264 CLEANFILES += $(nodist_lib_libopenvswitch_la_SOURCES)
265
266 lib_LTLIBRARIES += lib/libsflow.la
267 lib_libsflow_la_LDFLAGS = -release $(VERSION)
268 lib_libsflow_la_SOURCES = \
269         lib/sflow_api.h \
270         lib/sflow.h \
271         lib/sflow_agent.c \
272         lib/sflow_sampler.c \
273         lib/sflow_poller.c \
274         lib/sflow_receiver.c
275 lib_libsflow_la_CPPFLAGS = $(AM_CPPFLAGS)
276 lib_libsflow_la_CFLAGS = $(AM_CFLAGS)
277 if HAVE_WNO_UNUSED
278 lib_libsflow_la_CFLAGS += -Wno-unused
279 endif
280 if HAVE_WNO_UNUSED_PARAMETER
281 lib_libsflow_la_CFLAGS += -Wno-unused-parameter
282 endif
283
284 if LINUX
285 lib_libopenvswitch_la_SOURCES += \
286         lib/dpif-linux.c \
287         lib/dpif-linux.h \
288         lib/netdev-linux.c \
289         lib/netdev-linux.h \
290         lib/netlink-notifier.c \
291         lib/netlink-notifier.h \
292         lib/netlink-protocol.h \
293         lib/netlink-socket.c \
294         lib/netlink-socket.h \
295         lib/rtnetlink-link.c \
296         lib/rtnetlink-link.h \
297         lib/route-table.c \
298         lib/route-table.h
299 endif
300
301 if HAVE_POSIX_AIO
302 lib_libopenvswitch_la_SOURCES += lib/async-append-aio.c
303 else
304 lib_libopenvswitch_la_SOURCES += lib/async-append-null.c
305 endif
306
307 if ESX
308 lib_libopenvswitch_la_SOURCES += \
309         lib/route-table-stub.c
310 endif
311
312 if HAVE_IF_DL
313 lib_libopenvswitch_la_SOURCES += \
314         lib/netdev-bsd.c \
315         lib/rtbsd.c \
316         lib/rtbsd.h \
317         lib/route-table-bsd.c
318 endif
319
320 if HAVE_OPENSSL
321 lib_libopenvswitch_la_SOURCES += lib/stream-ssl.c
322 nodist_lib_libopenvswitch_la_SOURCES += lib/dhparams.c
323 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
324         (echo '#include "lib/dhparams.h"' &&                            \
325          openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
326          openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
327          openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
328         | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
329         mv lib/dhparams.c.tmp lib/dhparams.c
330 else
331 lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c
332 endif
333
334 EXTRA_DIST += \
335         lib/dh1024.pem \
336         lib/dh2048.pem \
337         lib/dh4096.pem \
338         lib/dirs.c.in
339
340 MAN_FRAGMENTS += \
341         lib/common.man \
342         lib/common-syn.man \
343         lib/coverage-unixctl.man \
344         lib/daemon.man \
345         lib/daemon-syn.man \
346         lib/memory-unixctl.man \
347         lib/ofp-version.man \
348         lib/ovs.tmac \
349         lib/service.man \
350         lib/service-syn.man \
351         lib/ssl-bootstrap.man \
352         lib/ssl-bootstrap-syn.man \
353         lib/ssl-peer-ca-cert.man \
354         lib/ssl.man \
355         lib/ssl-syn.man \
356         lib/table.man \
357         lib/unixctl.man \
358         lib/unixctl-syn.man \
359         lib/vconn-active.man \
360         lib/vconn-passive.man \
361         lib/vlog-unixctl.man \
362         lib/vlog-syn.man \
363         lib/vlog.man
364
365 # vswitch IDL
366 OVSIDL_BUILT += \
367         $(srcdir)/lib/vswitch-idl.c \
368         $(srcdir)/lib/vswitch-idl.h \
369         $(srcdir)/lib/vswitch-idl.ovsidl \
370         $(srcdir)/lib/vtep-idl.c \
371         $(srcdir)/lib/vtep-idl.h \
372         $(srcdir)/lib/vtep-idl.ovsidl
373
374 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
375 VSWITCH_IDL_FILES = \
376         $(srcdir)/vswitchd/vswitch.ovsschema \
377         $(srcdir)/lib/vswitch-idl.ann
378 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
379         $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
380         mv $@.tmp $@
381
382 EXTRA_DIST += $(srcdir)/lib/vtep-idl.ann
383 VTEP_IDL_FILES = \
384         $(srcdir)/vtep/vtep.ovsschema \
385         $(srcdir)/lib/vtep-idl.ann
386 $(srcdir)/lib/vtep-idl.ovsidl: $(VTEP_IDL_FILES)
387         $(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp
388         mv $@.tmp $@
389
390 lib/dirs.c: lib/dirs.c.in Makefile
391         ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
392                 -e 's,[@]srcdir[@],$(srcdir),g' \
393                 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
394                 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
395                 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
396                 -e 's,[@]bindir[@],"$(bindir)",g' \
397                 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
398                 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
399              > lib/dirs.c.tmp
400         mv lib/dirs.c.tmp lib/dirs.c
401
402 $(srcdir)/lib/ofp-errors.inc: \
403         lib/ofp-errors.h include/openflow/openflow-common.h \
404         $(srcdir)/build-aux/extract-ofp-errors
405         $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
406                 $(srcdir)/lib/ofp-errors.h \
407                 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
408         mv $@.tmp $@
409 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
410 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
411
412 $(srcdir)/lib/ofp-msgs.inc: \
413         lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
414         $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
415                 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
416 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
417 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
418
419 INSTALL_DATA_LOCAL += lib-install-data-local
420 lib-install-data-local:
421         $(MKDIR_P) $(DESTDIR)$(RUNDIR)
422         $(MKDIR_P) $(DESTDIR)$(PKIDIR)
423         $(MKDIR_P) $(DESTDIR)$(LOGDIR)
424         $(MKDIR_P) $(DESTDIR)$(DBDIR)
425