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 \
81 lib/learning-switch.c \
82 lib/learning-switch.h \
98 lib/netdev-provider.h \
125 lib/ofp-version-opt.h \
126 lib/ofp-version-opt.c \
129 lib/ovs-atomic-c11.h \
130 lib/ovs-atomic-clang.h \
131 lib/ovs-atomic-flag-gcc4.7+.h \
132 lib/ovs-atomic-gcc4+.c \
133 lib/ovs-atomic-gcc4+.h \
134 lib/ovs-atomic-gcc4.7+.h \
135 lib/ovs-atomic-pthreads.c \
136 lib/ovs-atomic-pthreads.h \
144 lib/ovsdb-idl-provider.h \
188 lib/stream-provider.h \
217 lib/vconn-provider.h \
230 nodist_lib_libopenvswitch_a_SOURCES = \
232 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
234 noinst_LIBRARIES += lib/libsflow.a
235 lib_libsflow_a_SOURCES = \
239 lib/sflow_sampler.c \
242 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
244 lib_libsflow_a_CFLAGS += -Wno-unused
246 if HAVE_WNO_UNUSED_PARAMETER
247 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
251 lib_libopenvswitch_a_SOURCES += \
256 lib/netlink-notifier.c \
257 lib/netlink-notifier.h \
258 lib/netlink-protocol.h \
259 lib/netlink-socket.c \
260 lib/netlink-socket.h \
261 lib/rtnetlink-link.c \
262 lib/rtnetlink-link.h \
268 lib_libopenvswitch_a_SOURCES += lib/async-append-aio.c
270 lib_libopenvswitch_a_SOURCES += lib/async-append-null.c
274 lib_libopenvswitch_a_SOURCES += \
275 lib/route-table-stub.c
279 lib_libopenvswitch_a_SOURCES += \
283 lib/route-table-bsd.c
287 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
288 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
289 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
290 (echo '#include "lib/dhparams.h"' && \
291 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
292 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
293 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
294 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
295 mv lib/dhparams.c.tmp lib/dhparams.c
297 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
309 lib/coverage-unixctl.man \
312 lib/memory-unixctl.man \
313 lib/ofp-version.man \
315 lib/ssl-bootstrap.man \
316 lib/ssl-bootstrap-syn.man \
317 lib/ssl-peer-ca-cert.man \
322 lib/unixctl-syn.man \
323 lib/vconn-active.man \
324 lib/vconn-passive.man \
325 lib/vlog-unixctl.man \
331 $(srcdir)/lib/vswitch-idl.c \
332 $(srcdir)/lib/vswitch-idl.h \
333 $(srcdir)/lib/vswitch-idl.ovsidl
335 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
336 VSWITCH_IDL_FILES = \
337 $(srcdir)/vswitchd/vswitch.ovsschema \
338 $(srcdir)/lib/vswitch-idl.ann
339 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
340 $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
343 lib/dirs.c: lib/dirs.c.in Makefile
344 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
345 -e 's,[@]srcdir[@],$(srcdir),g' \
346 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
347 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
348 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
349 -e 's,[@]bindir[@],"$(bindir)",g' \
350 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
351 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
353 mv lib/dirs.c.tmp lib/dirs.c
355 $(srcdir)/lib/ofp-errors.inc: \
356 lib/ofp-errors.h include/openflow/openflow-common.h \
357 $(srcdir)/build-aux/extract-ofp-errors
358 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
359 $(srcdir)/lib/ofp-errors.h \
360 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
362 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
363 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
365 $(srcdir)/lib/ofp-msgs.inc: \
366 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
367 $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
368 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
369 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
370 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
372 INSTALL_DATA_LOCAL += lib-install-data-local
373 lib-install-data-local:
374 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
375 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
376 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
377 $(MKDIR_P) $(DESTDIR)$(DBDIR)
379 if !USE_LINKER_SECTIONS
380 # All distributed sources, with names adjust properly for referencing
383 `for file in $(DIST_SOURCES); do \
384 if test -f $$file; then \
387 echo $(VPATH)/$$file; \
391 lib/coverage.$(OBJEXT): lib/coverage.def
392 lib/coverage.def: $(DIST_SOURCES)
393 sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
394 CLEANFILES += lib/coverage.def
396 lib/vlog.$(OBJEXT): lib/vlog-modules.def
397 lib/vlog-modules.def: $(DIST_SOURCES)
398 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 > $@
399 CLEANFILES += lib/vlog-modules.def