1 # Copyright (C) 2009, 2010, 2011, 2012, 2013 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)
11 lib_libopenvswitch_la_LDFLAGS = -release $(VERSION)
13 lib_libopenvswitch_la_SOURCES = \
56 lib/dynamic-string.c \
57 lib/dynamic-string.h \
86 lib/learning-switch.c \
87 lib/learning-switch.h \
103 lib/netdev-provider.h \
130 lib/ofp-version-opt.h \
131 lib/ofp-version-opt.c \
134 lib/ovs-atomic-c11.h \
135 lib/ovs-atomic-clang.h \
136 lib/ovs-atomic-flag-gcc4.7+.h \
137 lib/ovs-atomic-gcc4+.c \
138 lib/ovs-atomic-gcc4+.h \
139 lib/ovs-atomic-gcc4.7+.h \
140 lib/ovs-atomic-pthreads.c \
141 lib/ovs-atomic-pthreads.h \
149 lib/ovsdb-idl-provider.h \
193 lib/stream-provider.h \
224 lib/vconn-provider.h \
242 nodist_lib_libopenvswitch_la_SOURCES = \
244 CLEANFILES += $(nodist_lib_libopenvswitch_la_SOURCES)
246 lib_LTLIBRARIES += lib/libsflow.la
247 lib_libsflow_la_LDFLAGS = -release $(VERSION)
248 lib_libsflow_la_SOURCES = \
252 lib/sflow_sampler.c \
255 lib_libsflow_la_CPPFLAGS = $(AM_CPPFLAGS)
256 lib_libsflow_la_CFLAGS = $(AM_CFLAGS)
258 lib_libsflow_la_CFLAGS += -Wno-unused
260 if HAVE_WNO_UNUSED_PARAMETER
261 lib_libsflow_la_CFLAGS += -Wno-unused-parameter
265 lib_libopenvswitch_la_SOURCES += \
270 lib/netlink-notifier.c \
271 lib/netlink-notifier.h \
272 lib/netlink-protocol.h \
273 lib/netlink-socket.c \
274 lib/netlink-socket.h \
275 lib/rtnetlink-link.c \
276 lib/rtnetlink-link.h \
282 lib_libopenvswitch_la_SOURCES += lib/async-append-aio.c
284 lib_libopenvswitch_la_SOURCES += lib/async-append-null.c
288 lib_libopenvswitch_la_SOURCES += \
289 lib/route-table-stub.c
293 lib_libopenvswitch_la_SOURCES += \
297 lib/route-table-bsd.c
301 lib_libopenvswitch_la_SOURCES += lib/stream-ssl.c
302 nodist_lib_libopenvswitch_la_SOURCES += lib/dhparams.c
303 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
304 (echo '#include "lib/dhparams.h"' && \
305 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
306 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
307 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
308 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
309 mv lib/dhparams.c.tmp lib/dhparams.c
311 lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c
323 lib/coverage-unixctl.man \
326 lib/memory-unixctl.man \
327 lib/ofp-version.man \
329 lib/ssl-bootstrap.man \
330 lib/ssl-bootstrap-syn.man \
331 lib/ssl-peer-ca-cert.man \
336 lib/unixctl-syn.man \
337 lib/vconn-active.man \
338 lib/vconn-passive.man \
339 lib/vlog-unixctl.man \
345 $(srcdir)/lib/vswitch-idl.c \
346 $(srcdir)/lib/vswitch-idl.h \
347 $(srcdir)/lib/vswitch-idl.ovsidl \
348 $(srcdir)/lib/vtep-idl.c \
349 $(srcdir)/lib/vtep-idl.h \
350 $(srcdir)/lib/vtep-idl.ovsidl
352 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
353 VSWITCH_IDL_FILES = \
354 $(srcdir)/vswitchd/vswitch.ovsschema \
355 $(srcdir)/lib/vswitch-idl.ann
356 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
357 $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
360 EXTRA_DIST += $(srcdir)/lib/vtep-idl.ann
362 $(srcdir)/vtep/vtep.ovsschema \
363 $(srcdir)/lib/vtep-idl.ann
364 $(srcdir)/lib/vtep-idl.ovsidl: $(VTEP_IDL_FILES)
365 $(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp
368 lib/dirs.c: lib/dirs.c.in Makefile
369 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
370 -e 's,[@]srcdir[@],$(srcdir),g' \
371 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
372 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
373 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
374 -e 's,[@]bindir[@],"$(bindir)",g' \
375 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
376 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
378 mv lib/dirs.c.tmp lib/dirs.c
380 $(srcdir)/lib/ofp-errors.inc: \
381 lib/ofp-errors.h include/openflow/openflow-common.h \
382 $(srcdir)/build-aux/extract-ofp-errors
383 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
384 $(srcdir)/lib/ofp-errors.h \
385 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
387 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
388 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
390 $(srcdir)/lib/ofp-msgs.inc: \
391 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
392 $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
393 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
394 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
395 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
397 INSTALL_DATA_LOCAL += lib-install-data-local
398 lib-install-data-local:
399 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
400 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
401 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
402 $(MKDIR_P) $(DESTDIR)$(DBDIR)