1 # Copyright (C) 2009, 2010, 2011, 2012 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 \
74 lib/learning-switch.c \
75 lib/learning-switch.h \
89 lib/netdev-provider.h \
116 lib/ovsdb-idl-provider.h \
158 lib/stream-provider.h \
191 lib/vconn-provider.h \
206 nodist_lib_libopenvswitch_a_SOURCES = \
208 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
210 noinst_LIBRARIES += lib/libsflow.a
211 lib_libsflow_a_SOURCES = \
215 lib/sflow_sampler.c \
218 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
220 lib_libsflow_a_CFLAGS += -Wno-unused
222 if HAVE_WNO_UNUSED_PARAMETER
223 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
227 lib_libopenvswitch_a_SOURCES += \
234 lib/netlink-notifier.c \
235 lib/netlink-notifier.h \
236 lib/netlink-protocol.h \
237 lib/netlink-socket.c \
238 lib/netlink-socket.h \
239 lib/rtnetlink-link.c \
240 lib/rtnetlink-link.h \
246 lib_libopenvswitch_a_SOURCES += \
250 lib/route-table-bsd.c
254 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
255 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
256 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
257 (echo '#include "lib/dhparams.h"' && \
258 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
259 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
260 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
261 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
262 mv lib/dhparams.c.tmp lib/dhparams.c
264 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
276 lib/coverage-unixctl.man \
279 lib/leak-checker.man \
280 lib/memory-unixctl.man \
282 lib/ssl-bootstrap.man \
283 lib/ssl-bootstrap-syn.man \
284 lib/ssl-peer-ca-cert.man \
287 lib/stress-unixctl.man \
290 lib/unixctl-syn.man \
291 lib/vconn-active.man \
292 lib/vconn-passive.man \
293 lib/vlog-unixctl.man \
301 lib/vswitch-idl.ovsidl
303 EXTRA_DIST += lib/vswitch-idl.ann
304 VSWITCH_IDL_FILES = vswitchd/vswitch.ovsschema lib/vswitch-idl.ann
305 lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
306 $(OVSDB_IDLC) -C $(srcdir) annotate $(VSWITCH_IDL_FILES) > $@.tmp
309 lib/dirs.c: lib/dirs.c.in Makefile
310 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
311 -e 's,[@]srcdir[@],$(srcdir),g' \
312 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
313 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
314 -e 's,[@]bindir[@],"$(bindir)",g' \
315 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
316 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
318 mv lib/dirs.c.tmp lib/dirs.c
320 $(srcdir)/lib/ofp-errors.inc: \
321 lib/ofp-errors.h $(srcdir)/build-aux/extract-ofp-errors
322 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
323 $(srcdir)/lib/ofp-errors.h > $@.tmp && mv $@.tmp $@
324 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
325 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
327 INSTALL_DATA_LOCAL += lib-install-data-local
328 lib-install-data-local:
329 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
330 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
331 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
333 if !USE_LINKER_SECTIONS
334 # All distributed sources, with names adjust properly for referencing
337 `for file in $(DIST_SOURCES); do \
338 if test -f $$file; then \
341 echo $(VPATH)/$$file; \
345 lib/coverage.$(OBJEXT): lib/coverage.def
346 lib/coverage.def: $(DIST_SOURCES)
347 sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
348 CLEANFILES += lib/coverage.def
350 lib/stress.$(OBJEXT): lib/stress.def
351 lib/stress.def: $(DIST_SOURCES)
352 sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
353 CLEANFILES += lib/stress.def
355 lib/vlog.$(OBJEXT): lib/vlog-modules.def
356 lib/vlog-modules.def: $(DIST_SOURCES)
357 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 > $@
358 CLEANFILES += lib/vlog-modules.def