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 \
154 lib/ovsdb-idl-provider.h \
195 lib/stream-provider.h \
225 lib/vconn-provider.h \
241 lib_libopenvswitch_la_SOURCES += \
242 lib/daemon-windows.c \
244 lib/getrusage-windows.c \
245 lib/latch-windows.c \
246 lib/route-table-stub.c \
248 lib/stream-fd-windows.c
250 lib_libopenvswitch_la_SOURCES += \
255 lib/stream-fd-unix.c \
263 nodist_lib_libopenvswitch_la_SOURCES = \
265 CLEANFILES += $(nodist_lib_libopenvswitch_la_SOURCES)
267 lib_LTLIBRARIES += lib/libsflow.la
268 lib_libsflow_la_LDFLAGS = -release $(VERSION)
269 lib_libsflow_la_SOURCES = \
273 lib/sflow_sampler.c \
276 lib_libsflow_la_CPPFLAGS = $(AM_CPPFLAGS)
277 lib_libsflow_la_CFLAGS = $(AM_CFLAGS)
279 lib_libsflow_la_CFLAGS += -Wno-unused
281 if HAVE_WNO_UNUSED_PARAMETER
282 lib_libsflow_la_CFLAGS += -Wno-unused-parameter
286 lib_libopenvswitch_la_SOURCES += \
291 lib/netlink-notifier.c \
292 lib/netlink-notifier.h \
293 lib/netlink-protocol.h \
294 lib/netlink-socket.c \
295 lib/netlink-socket.h \
296 lib/rtnetlink-link.c \
297 lib/rtnetlink-link.h \
303 lib_libopenvswitch_la_SOURCES += lib/async-append-aio.c
305 lib_libopenvswitch_la_SOURCES += lib/async-append-null.c
309 lib_libopenvswitch_la_SOURCES += \
310 lib/route-table-stub.c
314 lib_libopenvswitch_la_SOURCES += \
318 lib/route-table-bsd.c
322 lib_libopenvswitch_la_SOURCES += lib/stream-ssl.c
323 nodist_lib_libopenvswitch_la_SOURCES += lib/dhparams.c
324 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
325 (echo '#include "lib/dhparams.h"' && \
326 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
327 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
328 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
329 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
330 mv lib/dhparams.c.tmp lib/dhparams.c
332 lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c
344 lib/coverage-unixctl.man \
347 lib/memory-unixctl.man \
348 lib/ofp-version.man \
351 lib/service-syn.man \
352 lib/ssl-bootstrap.man \
353 lib/ssl-bootstrap-syn.man \
354 lib/ssl-peer-ca-cert.man \
359 lib/unixctl-syn.man \
360 lib/vconn-active.man \
361 lib/vconn-passive.man \
362 lib/vlog-unixctl.man \
368 $(srcdir)/lib/vswitch-idl.c \
369 $(srcdir)/lib/vswitch-idl.h \
370 $(srcdir)/lib/vswitch-idl.ovsidl \
371 $(srcdir)/lib/vtep-idl.c \
372 $(srcdir)/lib/vtep-idl.h \
373 $(srcdir)/lib/vtep-idl.ovsidl
375 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
376 VSWITCH_IDL_FILES = \
377 $(srcdir)/vswitchd/vswitch.ovsschema \
378 $(srcdir)/lib/vswitch-idl.ann
379 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
380 $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
383 EXTRA_DIST += $(srcdir)/lib/vtep-idl.ann
385 $(srcdir)/vtep/vtep.ovsschema \
386 $(srcdir)/lib/vtep-idl.ann
387 $(srcdir)/lib/vtep-idl.ovsidl: $(VTEP_IDL_FILES)
388 $(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp
391 lib/dirs.c: lib/dirs.c.in Makefile
392 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
393 -e 's,[@]srcdir[@],$(srcdir),g' \
394 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
395 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
396 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
397 -e 's,[@]bindir[@],"$(bindir)",g' \
398 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
399 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
401 mv lib/dirs.c.tmp lib/dirs.c
403 $(srcdir)/lib/ofp-errors.inc: \
404 lib/ofp-errors.h include/openflow/openflow-common.h \
405 $(srcdir)/build-aux/extract-ofp-errors
406 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
407 $(srcdir)/lib/ofp-errors.h \
408 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
410 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
411 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
413 $(srcdir)/lib/ofp-msgs.inc: \
414 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
415 $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
416 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
417 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
418 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
420 INSTALL_DATA_LOCAL += lib-install-data-local
421 lib-install-data-local:
422 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
423 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
424 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
425 $(MKDIR_P) $(DESTDIR)$(DBDIR)