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-provider.h \
127 lib/ofp-version-opt.h \
128 lib/ofp-version-opt.c \
131 lib/ovs-atomic-c11.h \
132 lib/ovs-atomic-clang.h \
133 lib/ovs-atomic-flag-gcc4.7+.h \
134 lib/ovs-atomic-gcc4+.c \
135 lib/ovs-atomic-gcc4+.h \
136 lib/ovs-atomic-gcc4.7+.h \
137 lib/ovs-atomic-pthreads.c \
138 lib/ovs-atomic-pthreads.h \
146 lib/ovsdb-idl-provider.h \
190 lib/stream-provider.h \
221 lib/vconn-provider.h \
236 nodist_lib_libopenvswitch_a_SOURCES = \
238 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
240 noinst_LIBRARIES += lib/libsflow.a
241 lib_libsflow_a_SOURCES = \
245 lib/sflow_sampler.c \
248 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
250 lib_libsflow_a_CFLAGS += -Wno-unused
252 if HAVE_WNO_UNUSED_PARAMETER
253 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
257 lib_libopenvswitch_a_SOURCES += \
262 lib/netlink-notifier.c \
263 lib/netlink-notifier.h \
264 lib/netlink-protocol.h \
265 lib/netlink-socket.c \
266 lib/netlink-socket.h \
267 lib/rtnetlink-link.c \
268 lib/rtnetlink-link.h \
274 lib_libopenvswitch_a_SOURCES += lib/async-append-aio.c
276 lib_libopenvswitch_a_SOURCES += lib/async-append-null.c
280 lib_libopenvswitch_a_SOURCES += \
281 lib/route-table-stub.c
285 lib_libopenvswitch_a_SOURCES += \
289 lib/route-table-bsd.c
293 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
294 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
295 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
296 (echo '#include "lib/dhparams.h"' && \
297 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
298 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
299 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
300 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
301 mv lib/dhparams.c.tmp lib/dhparams.c
303 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
315 lib/coverage-unixctl.man \
318 lib/memory-unixctl.man \
319 lib/ofp-version.man \
321 lib/ssl-bootstrap.man \
322 lib/ssl-bootstrap-syn.man \
323 lib/ssl-peer-ca-cert.man \
328 lib/unixctl-syn.man \
329 lib/vconn-active.man \
330 lib/vconn-passive.man \
331 lib/vlog-unixctl.man \
337 $(srcdir)/lib/vswitch-idl.c \
338 $(srcdir)/lib/vswitch-idl.h \
339 $(srcdir)/lib/vswitch-idl.ovsidl \
340 $(srcdir)/lib/vtep-idl.c \
341 $(srcdir)/lib/vtep-idl.h \
342 $(srcdir)/lib/vtep-idl.ovsidl
344 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
345 VSWITCH_IDL_FILES = \
346 $(srcdir)/vswitchd/vswitch.ovsschema \
347 $(srcdir)/lib/vswitch-idl.ann
348 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
349 $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
352 EXTRA_DIST += $(srcdir)/lib/vtep-idl.ann
354 $(srcdir)/vtep/vtep.ovsschema \
355 $(srcdir)/lib/vtep-idl.ann
356 $(srcdir)/lib/vtep-idl.ovsidl: $(VTEP_IDL_FILES)
357 $(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp
360 lib/dirs.c: lib/dirs.c.in Makefile
361 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
362 -e 's,[@]srcdir[@],$(srcdir),g' \
363 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
364 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
365 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
366 -e 's,[@]bindir[@],"$(bindir)",g' \
367 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
368 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
370 mv lib/dirs.c.tmp lib/dirs.c
372 $(srcdir)/lib/ofp-errors.inc: \
373 lib/ofp-errors.h include/openflow/openflow-common.h \
374 $(srcdir)/build-aux/extract-ofp-errors
375 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
376 $(srcdir)/lib/ofp-errors.h \
377 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
379 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
380 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
382 $(srcdir)/lib/ofp-msgs.inc: \
383 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
384 $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
385 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
386 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
387 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
389 INSTALL_DATA_LOCAL += lib-install-data-local
390 lib-install-data-local:
391 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
392 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
393 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
394 $(MKDIR_P) $(DESTDIR)$(DBDIR)
396 if !USE_LINKER_SECTIONS
397 # All distributed sources, with names adjust properly for referencing
400 `for file in $(DIST_SOURCES); do \
401 if test -f $$file; then \
404 echo $(VPATH)/$$file; \
408 lib/coverage.$(OBJEXT): lib/coverage.def
409 lib/coverage.def: $(DIST_SOURCES)
410 sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
411 CLEANFILES += lib/coverage.def
413 lib/vlog.$(OBJEXT): lib/vlog-modules.def
414 lib/vlog-modules.def: $(DIST_SOURCES)
415 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 > $@
416 CLEANFILES += lib/vlog-modules.def