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 noinst_LIBRARIES += lib/libopenvswitch.a
10 lib_libopenvswitch_a_SOURCES = \
53 lib/dynamic-string.c \
54 lib/dynamic-string.h \
83 lib/learning-switch.c \
84 lib/learning-switch.h \
100 lib/netdev-tunnel.c \
102 lib/netdev-provider.h \
129 lib/ofp-version-opt.h \
130 lib/ofp-version-opt.c \
133 lib/ovs-atomic-c11.h \
134 lib/ovs-atomic-clang.h \
135 lib/ovs-atomic-flag-gcc4.7+.h \
136 lib/ovs-atomic-gcc4+.c \
137 lib/ovs-atomic-gcc4+.h \
138 lib/ovs-atomic-gcc4.7+.h \
139 lib/ovs-atomic-pthreads.c \
140 lib/ovs-atomic-pthreads.h \
148 lib/ovsdb-idl-provider.h \
192 lib/stream-provider.h \
225 lib/vconn-provider.h \
240 nodist_lib_libopenvswitch_a_SOURCES = \
242 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
244 noinst_LIBRARIES += lib/libsflow.a
245 lib_libsflow_a_SOURCES = \
249 lib/sflow_sampler.c \
252 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
254 lib_libsflow_a_CFLAGS += -Wno-unused
256 if HAVE_WNO_UNUSED_PARAMETER
257 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
261 lib_libopenvswitch_a_SOURCES += \
266 lib/netlink-notifier.c \
267 lib/netlink-notifier.h \
268 lib/netlink-protocol.h \
269 lib/netlink-socket.c \
270 lib/netlink-socket.h \
271 lib/rtnetlink-link.c \
272 lib/rtnetlink-link.h \
278 lib_libopenvswitch_a_SOURCES += lib/async-append-aio.c
280 lib_libopenvswitch_a_SOURCES += lib/async-append-null.c
284 lib_libopenvswitch_a_SOURCES += \
285 lib/route-table-stub.c
289 lib_libopenvswitch_a_SOURCES += \
293 lib/route-table-bsd.c
297 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
298 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
299 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
300 (echo '#include "lib/dhparams.h"' && \
301 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
302 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
303 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
304 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
305 mv lib/dhparams.c.tmp lib/dhparams.c
307 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
319 lib/coverage-unixctl.man \
322 lib/memory-unixctl.man \
323 lib/ofp-version.man \
325 lib/ssl-bootstrap.man \
326 lib/ssl-bootstrap-syn.man \
327 lib/ssl-peer-ca-cert.man \
332 lib/unixctl-syn.man \
333 lib/vconn-active.man \
334 lib/vconn-passive.man \
335 lib/vlog-unixctl.man \
341 $(srcdir)/lib/vswitch-idl.c \
342 $(srcdir)/lib/vswitch-idl.h \
343 $(srcdir)/lib/vswitch-idl.ovsidl \
344 $(srcdir)/lib/vtep-idl.c \
345 $(srcdir)/lib/vtep-idl.h \
346 $(srcdir)/lib/vtep-idl.ovsidl
348 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
349 VSWITCH_IDL_FILES = \
350 $(srcdir)/vswitchd/vswitch.ovsschema \
351 $(srcdir)/lib/vswitch-idl.ann
352 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
353 $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
356 EXTRA_DIST += $(srcdir)/lib/vtep-idl.ann
358 $(srcdir)/vtep/vtep.ovsschema \
359 $(srcdir)/lib/vtep-idl.ann
360 $(srcdir)/lib/vtep-idl.ovsidl: $(VTEP_IDL_FILES)
361 $(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp
364 lib/dirs.c: lib/dirs.c.in Makefile
365 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
366 -e 's,[@]srcdir[@],$(srcdir),g' \
367 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
368 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
369 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
370 -e 's,[@]bindir[@],"$(bindir)",g' \
371 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
372 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
374 mv lib/dirs.c.tmp lib/dirs.c
376 $(srcdir)/lib/ofp-errors.inc: \
377 lib/ofp-errors.h include/openflow/openflow-common.h \
378 $(srcdir)/build-aux/extract-ofp-errors
379 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
380 $(srcdir)/lib/ofp-errors.h \
381 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
383 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
384 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
386 $(srcdir)/lib/ofp-msgs.inc: \
387 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
388 $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
389 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
390 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
391 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
393 INSTALL_DATA_LOCAL += lib-install-data-local
394 lib-install-data-local:
395 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
396 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
397 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
398 $(MKDIR_P) $(DESTDIR)$(DBDIR)
400 if !USE_LINKER_SECTIONS
401 # All distributed sources, with names adjust properly for referencing
404 `for file in $(DIST_SOURCES); do \
405 if test -f $$file; then \
408 echo $(VPATH)/$$file; \
412 lib/coverage.$(OBJEXT): lib/coverage.def
413 lib/coverage.def: $(DIST_SOURCES)
414 sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
415 CLEANFILES += lib/coverage.def
417 lib/vlog.$(OBJEXT): lib/vlog-modules.def
418 lib/vlog-modules.def: $(DIST_SOURCES)
419 sed -n 's|^VLOG_DEFINE_\(THIS_\)\{0,1\}MODULE(\([_a-zA-Z0-9]\{1,\}\)).*$$|VLOG_MODULE(\2)|p' $(all_sources) | LC_ALL=C sort -u > $@
420 CLEANFILES += lib/vlog-modules.def