1 # Copyright (C) 2009, 2010, 2011, 2012 Nicira Networks, 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 \
74 lib/learning-switch.c \
75 lib/learning-switch.h \
87 lib/netdev-provider.h \
112 lib/ovsdb-idl-provider.h \
150 lib/stream-provider.h \
181 lib/vconn-provider.h \
194 nodist_lib_libopenvswitch_a_SOURCES = \
196 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
198 noinst_LIBRARIES += lib/libsflow.a
199 lib_libsflow_a_SOURCES = \
203 lib/sflow_sampler.c \
206 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
208 lib_libsflow_a_CFLAGS += -Wno-unused
210 if HAVE_WNO_UNUSED_PARAMETER
211 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
215 lib_libopenvswitch_a_SOURCES += \
222 lib/netlink-notifier.c \
223 lib/netlink-notifier.h \
224 lib/netlink-protocol.h \
225 lib/netlink-socket.c \
226 lib/netlink-socket.h \
227 lib/rtnetlink-link.c \
228 lib/rtnetlink-link.h \
234 lib_libopenvswitch_a_SOURCES += \
241 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
242 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
243 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
244 (echo '#include "lib/dhparams.h"' && \
245 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
246 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
247 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
248 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
249 mv lib/dhparams.c.tmp lib/dhparams.c
251 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
263 lib/coverage-unixctl.man \
266 lib/leak-checker.man \
268 lib/ssl-bootstrap.man \
269 lib/ssl-bootstrap-syn.man \
270 lib/ssl-peer-ca-cert.man \
273 lib/stress-unixctl.man \
276 lib/unixctl-syn.man \
277 lib/vconn-active.man \
278 lib/vconn-passive.man \
279 lib/vlog-unixctl.man \
287 lib/vswitch-idl.ovsidl
289 EXTRA_DIST += lib/vswitch-idl.ann
290 VSWITCH_IDL_FILES = vswitchd/vswitch.ovsschema lib/vswitch-idl.ann
291 lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
292 $(OVSDB_IDLC) -C $(srcdir) annotate $(VSWITCH_IDL_FILES) > $@.tmp
295 lib/dirs.c: lib/dirs.c.in Makefile
296 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
297 -e 's,[@]srcdir[@],$(srcdir),g' \
298 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
299 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
300 -e 's,[@]bindir[@],"$(bindir)",g' \
301 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
302 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
304 mv lib/dirs.c.tmp lib/dirs.c
306 $(srcdir)/lib/ofp-errors.inc: \
307 lib/ofp-errors.h $(srcdir)/build-aux/extract-ofp-errors
308 $(PYTHON) $(srcdir)/build-aux/extract-ofp-errors \
309 $(srcdir)/lib/ofp-errors.h > $@.tmp && mv $@.tmp $@
310 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
311 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
313 INSTALL_DATA_LOCAL += lib-install-data-local
314 lib-install-data-local:
315 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
316 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
317 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
319 if !USE_LINKER_SECTIONS
320 # All distributed sources, with names adjust properly for referencing
323 `for file in $(DIST_SOURCES); do \
324 if test -f $$file; then \
327 echo $(VPATH)/$$file; \
331 lib/coverage.$(OBJEXT): lib/coverage.def
332 lib/coverage.def: $(DIST_SOURCES)
333 sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
334 CLEANFILES += lib/coverage.def
336 lib/stress.$(OBJEXT): lib/stress.def
337 lib/stress.def: $(DIST_SOURCES)
338 sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
339 CLEANFILES += lib/stress.def
341 lib/vlog.$(OBJEXT): lib/vlog-modules.def
342 lib/vlog-modules.def: $(DIST_SOURCES)
343 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 > $@
344 CLEANFILES += lib/vlog-modules.def