1 # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
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.
8 lib_LTLIBRARIES += lib/libopenvswitch.la
10 lib_libopenvswitch_la_LIBADD = $(SSL_LIBS)
13 lib_libopenvswitch_la_LIBADD += ${PTHREAD_LIBS}
16 lib_libopenvswitch_la_LDFLAGS = -release $(VERSION)
18 lib_libopenvswitch_la_SOURCES = \
60 lib/dynamic-string.c \
61 lib/dynamic-string.h \
91 lib/learning-switch.c \
92 lib/learning-switch.h \
108 lib/netdev-provider.h \
135 lib/ofp-version-opt.h \
136 lib/ofp-version-opt.c \
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 \
156 lib/ovsdb-idl-provider.h \
197 lib/stream-provider.h \
227 lib/vconn-provider.h \
243 lib_libopenvswitch_la_SOURCES += \
244 lib/daemon-windows.c \
246 lib/getrusage-windows.c \
247 lib/latch-windows.c \
248 lib/route-table-stub.c \
250 lib/stream-fd-windows.c
252 lib_libopenvswitch_la_SOURCES += \
257 lib/stream-fd-unix.c \
265 nodist_lib_libopenvswitch_la_SOURCES = \
267 CLEANFILES += $(nodist_lib_libopenvswitch_la_SOURCES)
269 lib_LTLIBRARIES += lib/libsflow.la
270 lib_libsflow_la_LDFLAGS = -release $(VERSION)
271 lib_libsflow_la_SOURCES = \
275 lib/sflow_sampler.c \
278 lib_libsflow_la_CPPFLAGS = $(AM_CPPFLAGS)
279 lib_libsflow_la_CFLAGS = $(AM_CFLAGS)
281 lib_libsflow_la_CFLAGS += -Wno-unused
283 if HAVE_WNO_UNUSED_PARAMETER
284 lib_libsflow_la_CFLAGS += -Wno-unused-parameter
288 lib_libopenvswitch_la_SOURCES += \
293 lib/netlink-notifier.c \
294 lib/netlink-notifier.h \
295 lib/netlink-protocol.h \
296 lib/netlink-socket.c \
297 lib/netlink-socket.h \
298 lib/rtnetlink-link.c \
299 lib/rtnetlink-link.h \
305 lib_libopenvswitch_la_SOURCES += lib/async-append-aio.c
307 lib_libopenvswitch_la_SOURCES += lib/async-append-null.c
311 lib_libopenvswitch_la_SOURCES += \
312 lib/route-table-stub.c
316 lib_libopenvswitch_la_SOURCES += \
320 lib/route-table-bsd.c
324 lib_libopenvswitch_la_SOURCES += lib/stream-ssl.c
325 nodist_lib_libopenvswitch_la_SOURCES += lib/dhparams.c
326 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
327 (echo '#include "lib/dhparams.h"' && \
328 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
329 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
330 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
331 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
332 mv lib/dhparams.c.tmp lib/dhparams.c
334 lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c
346 lib/coverage-unixctl.man \
349 lib/memory-unixctl.man \
350 lib/ofp-version.man \
353 lib/service-syn.man \
354 lib/ssl-bootstrap.man \
355 lib/ssl-bootstrap-syn.man \
356 lib/ssl-peer-ca-cert.man \
361 lib/unixctl-syn.man \
362 lib/vconn-active.man \
363 lib/vconn-passive.man \
364 lib/vlog-unixctl.man \
370 $(srcdir)/lib/vswitch-idl.c \
371 $(srcdir)/lib/vswitch-idl.h \
372 $(srcdir)/lib/vswitch-idl.ovsidl \
373 $(srcdir)/lib/vtep-idl.c \
374 $(srcdir)/lib/vtep-idl.h \
375 $(srcdir)/lib/vtep-idl.ovsidl
377 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
378 VSWITCH_IDL_FILES = \
379 $(srcdir)/vswitchd/vswitch.ovsschema \
380 $(srcdir)/lib/vswitch-idl.ann
381 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
382 $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
385 EXTRA_DIST += $(srcdir)/lib/vtep-idl.ann
387 $(srcdir)/vtep/vtep.ovsschema \
388 $(srcdir)/lib/vtep-idl.ann
389 $(srcdir)/lib/vtep-idl.ovsidl: $(VTEP_IDL_FILES)
390 $(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp
393 lib/dirs.c: lib/dirs.c.in Makefile
394 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
395 -e 's,[@]srcdir[@],$(srcdir),g' \
396 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
397 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
398 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
399 -e 's,[@]bindir[@],"$(bindir)",g' \
400 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
401 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
403 mv lib/dirs.c.tmp lib/dirs.c
405 $(srcdir)/lib/ofp-errors.inc: \
406 lib/ofp-errors.h include/openflow/openflow-common.h \
407 $(srcdir)/build-aux/extract-ofp-errors
408 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
409 $(srcdir)/lib/ofp-errors.h \
410 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
412 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
413 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
415 $(srcdir)/lib/ofp-msgs.inc: \
416 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
417 $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
418 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
419 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
420 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
422 INSTALL_DATA_LOCAL += lib-install-data-local
423 lib-install-data-local:
424 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
425 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
426 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
427 $(MKDIR_P) $(DESTDIR)$(DBDIR)