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 = \
50 lib/dynamic-string.c \
51 lib/dynamic-string.h \
78 lib/learning-switch.c \
79 lib/learning-switch.h \
95 lib/netdev-provider.h \
122 lib/ofp-version-opt.h \
123 lib/ofp-version-opt.c \
126 lib/ovs-atomic-c11.h \
127 lib/ovs-atomic-gcc4+.c \
128 lib/ovs-atomic-gcc4+.h \
129 lib/ovs-atomic-gcc4.7+.h \
130 lib/ovs-atomic-pthreads.c \
131 lib/ovs-atomic-pthreads.h \
139 lib/ovsdb-idl-provider.h \
181 lib/stream-provider.h \
212 lib/vconn-provider.h \
225 nodist_lib_libopenvswitch_a_SOURCES = \
227 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
229 noinst_LIBRARIES += lib/libsflow.a
230 lib_libsflow_a_SOURCES = \
234 lib/sflow_sampler.c \
237 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
239 lib_libsflow_a_CFLAGS += -Wno-unused
241 if HAVE_WNO_UNUSED_PARAMETER
242 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
246 lib_libopenvswitch_a_SOURCES += \
251 lib/netlink-notifier.c \
252 lib/netlink-notifier.h \
253 lib/netlink-protocol.h \
254 lib/netlink-socket.c \
255 lib/netlink-socket.h \
256 lib/rtnetlink-link.c \
257 lib/rtnetlink-link.h \
263 lib_libopenvswitch_a_SOURCES += \
264 lib/route-table-stub.c
268 lib_libopenvswitch_a_SOURCES += \
272 lib/route-table-bsd.c
276 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
277 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
278 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
279 (echo '#include "lib/dhparams.h"' && \
280 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
281 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
282 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
283 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
284 mv lib/dhparams.c.tmp lib/dhparams.c
286 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
298 lib/coverage-unixctl.man \
301 lib/memory-unixctl.man \
302 lib/ofp-version.man \
304 lib/ssl-bootstrap.man \
305 lib/ssl-bootstrap-syn.man \
306 lib/ssl-peer-ca-cert.man \
311 lib/unixctl-syn.man \
312 lib/vconn-active.man \
313 lib/vconn-passive.man \
314 lib/vlog-unixctl.man \
320 $(srcdir)/lib/vswitch-idl.c \
321 $(srcdir)/lib/vswitch-idl.h \
322 $(srcdir)/lib/vswitch-idl.ovsidl
324 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
325 VSWITCH_IDL_FILES = \
326 $(srcdir)/vswitchd/vswitch.ovsschema \
327 $(srcdir)/lib/vswitch-idl.ann
328 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
329 $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
332 lib/dirs.c: lib/dirs.c.in Makefile
333 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
334 -e 's,[@]srcdir[@],$(srcdir),g' \
335 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
336 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
337 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
338 -e 's,[@]bindir[@],"$(bindir)",g' \
339 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
340 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
342 mv lib/dirs.c.tmp lib/dirs.c
344 $(srcdir)/lib/ofp-errors.inc: \
345 lib/ofp-errors.h include/openflow/openflow-common.h \
346 $(srcdir)/build-aux/extract-ofp-errors
347 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
348 $(srcdir)/lib/ofp-errors.h \
349 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
351 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
352 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
354 $(srcdir)/lib/ofp-msgs.inc: \
355 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
356 $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
357 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
358 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
359 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
361 INSTALL_DATA_LOCAL += lib-install-data-local
362 lib-install-data-local:
363 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
364 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
365 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
366 $(MKDIR_P) $(DESTDIR)$(DBDIR)
368 if !USE_LINKER_SECTIONS
369 # All distributed sources, with names adjust properly for referencing
372 `for file in $(DIST_SOURCES); do \
373 if test -f $$file; then \
376 echo $(VPATH)/$$file; \
380 lib/coverage.$(OBJEXT): lib/coverage.def
381 lib/coverage.def: $(DIST_SOURCES)
382 sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
383 CLEANFILES += lib/coverage.def
385 lib/vlog.$(OBJEXT): lib/vlog-modules.def
386 lib/vlog-modules.def: $(DIST_SOURCES)
387 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 > $@
388 CLEANFILES += lib/vlog-modules.def