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 \
87 lib/netdev-provider.h \
112 lib/ovsdb-idl-provider.h \
152 lib/stream-provider.h \
183 lib/vconn-provider.h \
196 nodist_lib_libopenvswitch_a_SOURCES = \
198 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
200 noinst_LIBRARIES += lib/libsflow.a
201 lib_libsflow_a_SOURCES = \
205 lib/sflow_sampler.c \
208 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
210 lib_libsflow_a_CFLAGS += -Wno-unused
212 if HAVE_WNO_UNUSED_PARAMETER
213 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
217 lib_libopenvswitch_a_SOURCES += \
224 lib/netlink-notifier.c \
225 lib/netlink-notifier.h \
226 lib/netlink-protocol.h \
227 lib/netlink-socket.c \
228 lib/netlink-socket.h \
229 lib/rtnetlink-link.c \
230 lib/rtnetlink-link.h \
236 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
237 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
238 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
239 (echo '#include "lib/dhparams.h"' && \
240 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
241 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
242 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
243 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
244 mv lib/dhparams.c.tmp lib/dhparams.c
246 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
258 lib/coverage-unixctl.man \
261 lib/leak-checker.man \
263 lib/ssl-bootstrap.man \
264 lib/ssl-bootstrap-syn.man \
265 lib/ssl-peer-ca-cert.man \
268 lib/stress-unixctl.man \
271 lib/unixctl-syn.man \
272 lib/vconn-active.man \
273 lib/vconn-passive.man \
274 lib/vlog-unixctl.man \
282 lib/vswitch-idl.ovsidl
284 EXTRA_DIST += lib/vswitch-idl.ann
285 VSWITCH_IDL_FILES = vswitchd/vswitch.ovsschema lib/vswitch-idl.ann
286 lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
287 $(OVSDB_IDLC) -C $(srcdir) annotate $(VSWITCH_IDL_FILES) > $@.tmp
290 lib/dirs.c: lib/dirs.c.in Makefile
291 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
292 -e 's,[@]srcdir[@],$(srcdir),g' \
293 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
294 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
295 -e 's,[@]bindir[@],"$(bindir)",g' \
296 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
297 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
299 mv lib/dirs.c.tmp lib/dirs.c
301 $(srcdir)/lib/ofp-errors.inc: \
302 lib/ofp-errors.h $(srcdir)/build-aux/extract-ofp-errors
303 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
304 $(srcdir)/lib/ofp-errors.h > $@.tmp && mv $@.tmp $@
305 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
306 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
308 INSTALL_DATA_LOCAL += lib-install-data-local
309 lib-install-data-local:
310 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
311 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
312 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
314 if !USE_LINKER_SECTIONS
315 # All distributed sources, with names adjust properly for referencing
318 `for file in $(DIST_SOURCES); do \
319 if test -f $$file; then \
322 echo $(VPATH)/$$file; \
326 lib/coverage.$(OBJEXT): lib/coverage.def
327 lib/coverage.def: $(DIST_SOURCES)
328 sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
329 CLEANFILES += lib/coverage.def
331 lib/stress.$(OBJEXT): lib/stress.def
332 lib/stress.def: $(DIST_SOURCES)
333 sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
334 CLEANFILES += lib/stress.def
336 lib/vlog.$(OBJEXT): lib/vlog-modules.def
337 lib/vlog-modules.def: $(DIST_SOURCES)
338 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 > $@
339 CLEANFILES += lib/vlog-modules.def