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 = \
51 lib/dynamic-string.c \
52 lib/dynamic-string.h \
79 lib/learning-switch.c \
80 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-gcc4+.c \
131 lib/ovs-atomic-gcc4+.h \
132 lib/ovs-atomic-gcc4.7+.h \
133 lib/ovs-atomic-pthreads.c \
134 lib/ovs-atomic-pthreads.h \
142 lib/ovsdb-idl-provider.h \
184 lib/stream-provider.h \
215 lib/vconn-provider.h \
228 nodist_lib_libopenvswitch_a_SOURCES = \
230 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
232 noinst_LIBRARIES += lib/libsflow.a
233 lib_libsflow_a_SOURCES = \
237 lib/sflow_sampler.c \
240 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
242 lib_libsflow_a_CFLAGS += -Wno-unused
244 if HAVE_WNO_UNUSED_PARAMETER
245 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
249 lib_libopenvswitch_a_SOURCES += \
254 lib/netlink-notifier.c \
255 lib/netlink-notifier.h \
256 lib/netlink-protocol.h \
257 lib/netlink-socket.c \
258 lib/netlink-socket.h \
259 lib/rtnetlink-link.c \
260 lib/rtnetlink-link.h \
266 lib_libopenvswitch_a_SOURCES += lib/async-append-aio.c
268 lib_libopenvswitch_a_SOURCES += lib/async-append-null.c
272 lib_libopenvswitch_a_SOURCES += \
273 lib/route-table-stub.c
277 lib_libopenvswitch_a_SOURCES += \
281 lib/route-table-bsd.c
285 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
286 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
287 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
288 (echo '#include "lib/dhparams.h"' && \
289 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
290 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
291 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
292 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
293 mv lib/dhparams.c.tmp lib/dhparams.c
295 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
307 lib/coverage-unixctl.man \
310 lib/memory-unixctl.man \
311 lib/ofp-version.man \
313 lib/ssl-bootstrap.man \
314 lib/ssl-bootstrap-syn.man \
315 lib/ssl-peer-ca-cert.man \
320 lib/unixctl-syn.man \
321 lib/vconn-active.man \
322 lib/vconn-passive.man \
323 lib/vlog-unixctl.man \
329 $(srcdir)/lib/vswitch-idl.c \
330 $(srcdir)/lib/vswitch-idl.h \
331 $(srcdir)/lib/vswitch-idl.ovsidl
333 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
334 VSWITCH_IDL_FILES = \
335 $(srcdir)/vswitchd/vswitch.ovsschema \
336 $(srcdir)/lib/vswitch-idl.ann
337 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
338 $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
341 lib/dirs.c: lib/dirs.c.in Makefile
342 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
343 -e 's,[@]srcdir[@],$(srcdir),g' \
344 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
345 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
346 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
347 -e 's,[@]bindir[@],"$(bindir)",g' \
348 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
349 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
351 mv lib/dirs.c.tmp lib/dirs.c
353 $(srcdir)/lib/ofp-errors.inc: \
354 lib/ofp-errors.h include/openflow/openflow-common.h \
355 $(srcdir)/build-aux/extract-ofp-errors
356 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
357 $(srcdir)/lib/ofp-errors.h \
358 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
360 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
361 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
363 $(srcdir)/lib/ofp-msgs.inc: \
364 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
365 $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
366 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
367 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
368 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
370 INSTALL_DATA_LOCAL += lib-install-data-local
371 lib-install-data-local:
372 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
373 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
374 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
375 $(MKDIR_P) $(DESTDIR)$(DBDIR)
377 if !USE_LINKER_SECTIONS
378 # All distributed sources, with names adjust properly for referencing
381 `for file in $(DIST_SOURCES); do \
382 if test -f $$file; then \
385 echo $(VPATH)/$$file; \
389 lib/coverage.$(OBJEXT): lib/coverage.def
390 lib/coverage.def: $(DIST_SOURCES)
391 sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
392 CLEANFILES += lib/coverage.def
394 lib/vlog.$(OBJEXT): lib/vlog-modules.def
395 lib/vlog-modules.def: $(DIST_SOURCES)
396 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 > $@
397 CLEANFILES += lib/vlog-modules.def