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